diff --git a/.github/workflows/adapter-schemas.yml b/.github/workflows/adapter-schemas.yml new file mode 100644 index 00000000..21b235ad --- /dev/null +++ b/.github/workflows/adapter-schemas.yml @@ -0,0 +1,65 @@ +name: Adapter schemas + +# Generates the native provider resource schemas from their pinned upstream +# sources (Claude Agent SDK type declarations, Codex and Gemini CLI release +# schemas) plus the declarative patches in hack/adapterresources/patches, checks +# the result, and on main publishes it to the orphan `schemas` branch that the +# web UI loads from. The Captain binary does not embed these schemas. + +on: + push: + branches: [main] + paths: + - hack/adapterresources/** + - pkg/adapters/** + - .github/workflows/adapter-schemas.yml + pull_request: + paths: + - hack/adapterresources/** + - pkg/adapters/** + - .github/workflows/adapter-schemas.yml + workflow_dispatch: + +permissions: + contents: read + +jobs: + generate: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-go + - uses: actions/setup-node@v4 + with: + node-version: 22 + - name: Capture pinned upstream sources + run: ./hack/adapterresources/fetch-sources.sh + - name: Generate native resource schemas + run: go run ./hack/adapterresources resources -out .tmp/adapter-schemas + - name: Check the generated catalog + run: go test -tags adapterresources -count=1 -run TestAdapters ./pkg/adapters + env: + CAPTAIN_ADAPTER_RESOURCES: ${{ github.workspace }}/.tmp/adapter-schemas + - uses: actions/upload-artifact@v4 + with: + name: adapter-schemas + path: .tmp/adapter-schemas + if-no-files-found: error + + publish: + needs: generate + if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' + runs-on: ubuntu-latest + permissions: + contents: write + concurrency: + group: adapter-schemas-publish + cancel-in-progress: false + steps: + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 + with: + name: adapter-schemas + path: ${{ runner.temp }}/adapter-schemas + - name: Publish to the schemas branch + run: ./hack/adapterresources/publish-schemas-branch.sh "${{ runner.temp }}/adapter-schemas" "${{ github.sha }}" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2d14b2d3..61f9e0fd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,7 +19,7 @@ jobs: with: fetch-depth: 0 - - uses: flanksource/deps@v1.0.47 + - uses: flanksource/deps@v1.0.49 with: tools: | svu diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9c533670..3f0af476 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,7 +24,7 @@ jobs: with: restore: false - name: Lint with Gavel - uses: flanksource/gavel@ce8e88b2ad8b9dc62802ae4230bb086768d3d105 # v0.0.56 + uses: flanksource/gavel@fa6cc17dc723d13a354febfee843b3323a9a9251 # v0.0.79 with: args: lint golangci-lint version: v0.0.54 @@ -63,7 +63,7 @@ jobs: # pkg/cli/webapp is ignored: its vitest suite needs a sibling clicky-ui # checkout (a link: dependency), which does not exist on CI runners. - name: Test with Gavel - uses: flanksource/gavel@ce8e88b2ad8b9dc62802ae4230bb086768d3d105 # v0.0.56 + uses: flanksource/gavel@fa6cc17dc723d13a354febfee843b3323a9a9251 # v0.0.79 with: # --test-timeout is the per-package deadline (gavel defaults to 5m). # pkg/ai/fixture drives real agent subprocesses and exceeded it on a diff --git a/.gitignore b/.gitignore index 13910f24..d103f82e 100644 --- a/.gitignore +++ b/.gitignore @@ -31,9 +31,14 @@ hack/ !hack/ hack/* !hack/gitagent_empirical.sh +!hack/adapterresources/ +!hack/adapterdto/ +!hack/adapterbrowser/ .ok/ .okignore .ginkgo/ !pkg/cli/webapp/dist/index.html *.test .codegraph/ +/assets/brand/captain-formation/presentation/ +/.new diff --git a/README.md b/README.md index ea95867d..49a39947 100644 --- a/README.md +++ b/README.md @@ -1,877 +1,152 @@ # Captain -Captain is a Go CLI for working with **Claude Code sessions, hooks, and sandboxes**. - -It provides tools to: - -- inspect Claude Code project/session history -- summarize tool usage, paths, binaries, and API cost -- list files changed by a session -- install Claude Code hooks -- run a workflow's **verification** checks — commands, LLM judges, and fixtures — as a definition of done -- test and use AI providers from the command line -- run iterative AI agents with verifiers, worktrees, and commits -- generate/build/run containerized Claude Code sandboxes -- inspect and clean stored Claude project session data -- expose captain commands as an MCP server -- run a web UI for launching and chatting with AI agents -- configure default backend, model, and AI safety toggles - -```xml h=185px w=358px preview -
- -
$2,500
- -

Drag to adjust — the figure updates live.

- -
-``` - -```html preview -
-
- -
-``` - -## What it does - -From the codebase, Captain is organized around a few core capabilities: - -### 1. Claude Code history and cost analysis - -Captain reads Claude session history and exposes commands for: - -- `history` — inspect tool usage from Claude sessions -- `info` — show project/session metadata for the current directory -- `cost` — estimate and group token/API usage across sessions -- `projects list` — list tracked Claude projects and sessions -- `projects clean` — remove old session history - -It analyzes: - -- tools used -- files/directories read and written -- domains accessed -- binaries executed -- approval / denial state -- categories of bash activity -- token and cost summaries - -### 2. Claude hooks - -Captain can install hook commands into Claude settings for: - -- **PreToolUse bash scanning** via `hook bash-check` - -The bash-check hook scans bash commands and can deny unsafe or disallowed commands. - -### 3. Verification - -`captain verify` runs the checks an `api.Workflow` declares against a working tree and reports each one's verdict: - -- `--command` — a shell command run as a pass/fail check (repeatable) -- `--prompt` — a `.prompt` LLM judge, judged by the run's provider (repeatable) -- `--fixture` — a fixture document handed to the runner configured as `verify.fixtureRunner` in `~/.captain.yaml` - -The same checks are the generate→verify loop's definition of done: a failing verdict's output feeds the next iteration. A declared check with nothing to run it is an error, never a silent pass. - -`captain verify` is local only — it is excluded from both the REST API and the MCP tool set, because `--command` runs through `sh -c` against a caller-chosen `--cwd`, and published as REST or MCP that would be unauthenticated remote code execution. - -### 4. Session changes - -`captain changes` lists the files written or edited during a Claude Code or Codex session: - -- defaults to the most recent session in the current directory -- `--session-id` targets a specific session by exact or prefix match -- `--all` searches across all projects -- `--claude` / `--codex` filter by session source -- `--agents` (default: true) includes files edited by nested sub-agents -- `--plans` / `--ignored` control whether plan files and git-ignored files are shown - -### 5. AI provider utilities +Captain is a Go CLI and embeddable runtime for AI prompts, agent execution, verification and session history. It runs API, agent, CLI and cmux runtimes selected by model, records Claude and Codex sessions, brokers approvals, and exposes a local web workbench. -Captain includes provider-agnostic AI utilities under `captain ai`: - -- `ai prompt` — send a prompt to a selected backend/model -- `ai agent` — run an iterative agent loop with optional verifiers, a throwaway git worktree, commit, and LLM judge -- `ai models` — list model information -- `ai test` — verify provider connectivity -- `ai fixture` — run a YAML benchmark fixture across multiple Claude configurations and capture a markdown evidence report - -Supported backends are inferred from code and dependencies, including: - -- Anthropic -- Gemini / Google -- OpenAI-compatible paths via the internal provider layer -- CLI/provider abstractions for local tool-backed backends (claude, codex, gemini) - -### 6. Adapter status and configuration - -- `whoami` — lists every AI adapter (API providers and CLI agents), how each is authenticated, whether its binary is installed, and the models it exposes -- `configure` — configure per-provider agent, model, and effort defaults in `~/.captain.yaml`, or validate and save direct-provider API tokens in `~/.config/captain/vault` - -### 7. Web UI and MCP server - -- `serve` — starts an HTTP API and embedded web UI for launching AI agents and opening follow-up chat sessions; supports `--dev` to proxy to the Vite dev server -- `mcp` — exposes captain commands (history, info, cost, changes, verify, etc.) as MCP tools so Claude Code can invoke them directly - -### 8. Utility commands - -- `cmux info ` — resolves all processes in a cmux surface, pane, or workspace and reports runtime, CPU, memory, listening TCP ports, and optional Go stacks -- `cmux screenshot` — captures a screenshot of the active browser surface in cmux and copies the path to the clipboard -- `port kill ` — finds and kills the process listening on a TCP port - -### 9. Container sandbox builder - -Captain can discover Claude-related local configuration and package it into a container sandbox. - -Supported workflows include: - -- `container` — interactive TUI -- `container list` — list discovered components -- `container generate` — generate Dockerfile/build context and sandbox config -- `container build` — build the sandbox image -- `container run` — run the generated sandbox -- `sandbox presets` — list available sandbox-runtime presets - -The container workflow is designed to package things like: - -- Claude config -- agents -- commands -- hooks -- MCP server config -- project settings -- token/env passthrough -- sandbox-runtime presets for languages/tools +## Quick start -## Project layout +Build with the Go version declared in [go.mod](go.mod), Node.js/pnpm for the web assets, and [Task](https://taskfile.dev) installed: -```text -captain/ -├── cmd/captain/ # CLI entrypoint -├── docs/ # Astro documentation site -├── pkg/ai/ # AI abstraction, provider config, models -├── pkg/ai/agent/ # Iterative agent loop, plugins (verify, worktree, judge) -├── pkg/ai/fixture/ # YAML fixture runner for Claude configuration benchmarks -├── pkg/api/ # HTTP API types and handlers (used by serve) -├── pkg/bash/ # Bash scanning, classification, rules -├── pkg/captainconfig/ # ~/.captain.yaml config load/save -├── pkg/claude/ # Claude history, sessions, parsing, formatting -├── pkg/cli/ # Cobra/clicky command implementations -├── pkg/cli/webapp/ # Embedded React web UI (served by captain serve) -├── pkg/cmux/ # Terminal multiplexer integration (processes and screenshots) -├── pkg/collections/ # Generic collection utilities -├── pkg/container/ # Sandbox discovery, generation, build/run logic -├── pkg/container/base/ # Embedded agent base image (Dockerfile, deps.yaml, entrypoint.sh) -├── pkg/git/ # Git worktree helpers -├── pkg/sandbox/ # Token/preset/sandbox helpers -├── Makefile # Thin wrapper around Taskfile -└── Taskfile.yaml # Main developer tasks +```sh +task www:build +make build +.bin/captain configure +.bin/captain prompt list +.bin/captain prompt run --model agent:sonnet -p 'Explain this repository' +.bin/captain serve --open ``` -## CLI overview - -Top-level commands exposed by `cmd/captain/main.go`: - -```bash -captain history -captain info -captain cost -captain changes -captain sandbox -captain ai -captain whoami -captain configure -captain serve -captain verify -captain hook -captain projects -captain container -captain mcp -captain cmux -captain port -``` +Local agent runtimes require their CLI and its login. API runtimes require provider credentials; `captain configure openai` securely validates and stores an API token. `captain whoami --models=false` inspects runtime readiness. Server/session persistence uses PostgreSQL; startup logs identify the selected database. -### History +## Prompts -```bash -captain history -captain history --summary -captain history --all -captain history --tool Bash --since now-7d -captain history --category git --compact -captain history --session-id 019e0365-dc2a-7ad0-a5a8-78936481a928 -captain history 019e0365-dc2a-7ad0-a5a8-78936481a928 -``` +Keep instructions and runtime declarations in a `.prompt` file: -Useful flags include: - -- `--file` -- `--tool` -- `--dir` -- `--category` -- `--approved` -- `--session-id` -- `--limit` -- `--since` -- `--all` -- `--short` -- `--compact` -- `--summary` - -### Info - -```bash -captain info -captain info --path /path/to/project +```yaml +--- +name: Review a package +model: agent:sonnet +permissions: + access: read-only +budget: + timeout: 10m +input: + default: + target: pkg/cli +--- +{{role "user"}} +Review {{target}} for correctness. Report findings with file paths and lines. ``` -Shows project root detection, Claude project directory, session counts, history range, and tool call totals. - -### Cost +Save as `review.prompt`, preview the effective request, then execute: -```bash -captain cost -captain cost --group-by project -captain cost --group-by model -captain cost --group-by tool -captain cost --group-by category -captain cost --session-id 019e0365-dc2a-7ad0-a5a8-78936481a928 -captain cost --all --since now-30d +```sh +captain lint promptfile review.prompt +captain prompt render review.prompt -V target=pkg/promptrun --json +captain prompt run review.prompt -V target=pkg/promptrun +captain prompt run review.prompt -M agent:sonnet -M agent:gpt-6.1-sol ``` -Supported groupings from the code: - -- `session` -- `project` -- `model` -- `day` -- `dir` -- `file` -- `tool` -- `category` - -### Changes - -```bash -captain changes -captain changes --session-id -captain changes --all --since now-7d -captain changes --claude -captain changes --agents=false +Render performs no model call or setup. Files are templates; inline `-p` and piped text are literal unless variables or `{{input}}` opt into templating. Piped input binds to `input`, a named `-V key=-`, or is appended when unused. Use `--attach` for files/URLs, `--preset` for reusable runtime layers and `--no-stream --json` for a buffered structured result. + +```sh +captain prompt --help +captain prompt run --help +captain prompt render --no-color --help +captain prompt --schema ``` -Lists the files written or edited during a Claude Code or Codex session. Defaults to the most recent session in the current directory. +`prompt` and every child command have colored terminal help, plain output with `--no-color`, `NO_COLOR` or redirection, and Markdown in detected agent sessions. Root help covers authoring; child help adds command examples and generated flags. See the [Prompt CLI guide](docs/src/pages/prompts/cli.mdx), [format](docs/src/pages/prompts/format.mdx), [runtime composition](docs/src/pages/prompts/runtime.mdx) and [sources/API](docs/src/pages/prompts/sources-api.mdx). -### Hook installation +## Command map -Install the bash safety hook: +| Area | Commands | Documentation | +| --- | --- | --- | +| Prompts | `prompt list/get/create/update/delete/render/run/observe`, `lint promptfile` | [Prompt CLI](docs/src/pages/prompts/cli.mdx) | +| Runtime configuration | `configure`, `whoami`, `runtime-preset`, `permissions explain/matrix/convert` | [Configuration](docs/src/pages/configuration/index.mdx) | +| Verification | `verify`, prompt `workflow.verify` | [Verification](docs/src/pages/agents/verification.mdx) | +| Sessions | `sessions`, `history`, `info`, `cost`, `changes`, `browser ls` | [Sessions](docs/src/pages/sessions/index.mdx) | +| Web/API | `serve`, `mcp`, `token` | [Serve](docs/src/pages/serve/index.mdx) | +| Benchmarks | `ai fixture`, `prompt observe` | [Fixtures](docs/src/pages/fixtures/index.mdx) | +| Isolation | `container`, `sandbox`, `sandbox credentials`, `sandbox git-agent` | [Sandboxes](docs/src/pages/sandboxes/index.mdx) | +| Gavel integration | `gavel todos` embeds Captain | [TODO lifecycle](docs/src/pages/todos/index.mdx) | -```bash -captain hook bash-check install -captain hook bash-check install --user -``` +`captain ai prompt` aliases `captain prompt run`. Other AI utilities include `ai agent` for explicit generate/verify workflows, `ai models`, `ai test`, `ai tokens` and `ai mock`. Use each command's help for its current flags. A runtime is `(model, mode)`; mode is `api`, `agent`, `cli` or `cmux`, with provider derived from the model. Configure provider defaults with `captain configure openai --mode agent --model gpt-6.1-sol --effort high --active`. -### Verification +## Verification and embedding -```bash -captain verify --command "go test ./..." --command "golangci-lint run" +```sh +captain verify --command 'make build' --command 'go test ./pkg/ai/prompt' captain verify --fixture acceptance.md --cwd /path/to/repo -captain verify --prompt review-diff.prompt --model claude-sonnet-4-6 ``` -Running fixtures needs a runner, since captain declares fixtures but does not execute them: +Fixtures require a runner, configured in `~/.captain.yaml`: ```yaml -# ~/.captain.yaml verify: - fixtureRunner: [gavel, fixture, verify] -``` - -The runner is handed the fixture document on stdin, plus `--cwd ` and one `--changed ` per changed file, and answers on stdout with NDJSON: any number of `{"progress": }` lines, then exactly one `{"report": }`. - -### AI utilities - -```bash -captain ai prompt --model claude-sonnet-4 --prompt "Summarize this diff" -captain ai agent --prompt "Fix the failing tests" --verify "go test ./..." -captain ai agent --prompt "Refactor this module" --worktree --commit --judge "all tests pass" -captain ai test --model gemini-2.0-flash -captain ai models -captain ai fixture --file examples/ai-fixtures/mission-control-investigate.yaml + fixtureRunner: [gavel, fixtures, run, --format, captain-verify-report] ``` -Relevant provider flags include: - -- `--model` -- `--backend` -- `--api-key` -- `--no-cache` -- `--budget` -- `--debug` - -#### AI agent - -`captain ai agent` runs an iterative AI agent loop with optional quality gates: - -- `--prompt` / `-p` — task prompt (required; can be piped from stdin) -- `--system` / `-s` — system prompt override -- `--verify` — shell command run after each turn; non-zero exit triggers a re-run (repeatable) -- `--max-iterations` — max verify-and-rerun iterations (default: 1) -- `--scope` — verifier scope: `changed` (only changed files) or `all` (default) -- `--worktree` — run in a throwaway git branch/worktree -- `--branch` — worktree branch name (default: `captain/agent-`) -- `--commit` — commit changes on the worktree branch (requires `--worktree`) -- `--judge` — LLM rubric; fails a turn when the judge rejects the result - -#### Fixture benchmarks - -`captain ai fixture` runs the same prompt against multiple Claude -configurations (different models, tool allowlists, MCP servers, prompt -caching on/off) and prints a side-by-side table of duration, cost, -tokens, and tool-call counts. It's intended to produce **evidence** that -one approach — e.g. a structured MCP — is faster and cheaper than a -Bash/CLI equivalent. - -```bash -captain ai fixture -f examples/ai-fixtures/mission-control-investigate.yaml -captain ai fixture -f examples/ai-fixtures/mission-control-describe.yaml --report /tmp/mc-describe.md -captain ai fixture -f examples/ai-fixtures/mission-control-multistep.yaml --repeat 5 -``` +The external runner receives fixture Markdown on stdin plus cwd/changed-file arguments and returns NDJSON progress followed by one report. Captain's `verify` command is local only. Workflow prompts can declare commands, LLM judges and fixtures under `workflow.verify`; failed verdicts feed the next iteration up to `maxIterations`. -Flags: - -- `--file` / `-f` — path to the YAML fixture (required) -- `--report` / `-r` — write an evidence report (headline, metrics table, per-run config, tool-usage breakdown) to this path -- `--format` — report format: `markdown` (default), `html`, or `ansi` -- `--artifacts` — directory for per-run `stream-json` captures (default: `/.captain/fixtures//`) -- `--repeat` — override every run's repeat count (useful for smoke tests: `--repeat 1`) - -YAML schema (abridged): - -```yaml -name: my-benchmark -description: What you're measuring and why -prompt: | - The prompt sent to every run (can be overridden per-run). -baseline: direct # which run to compare against for Speedup/Cheaper ratios -repeat: 3 # default N per run; overridable per-run and via --repeat - -defaults: - timeout: 3m - permissionMode: bypassPermissions - promptCaching: true - model: claude-sonnet-4 - -runs: - - name: direct - tools: [Bash] - allowedTools: ["Bash(kubectl *)", "Bash(aws *)"] - - - name: mission-control - tools: [default] - mcpConfig: [.mcp.json] - allowedTools: ["mcp__mission-control__*"] - repeat: 5 # overrides fixture-level repeat for this run -``` - -#### Isolation guarantees - -Two rules the runner enforces for you so direct-vs-MCP comparisons stay -honest — both are automatic, no extra flags needed: - -- **MCP is opt-in per run.** A run gets MCP servers only when `mcpConfig` - is set. With no `mcpConfig`, the runner passes `--strict-mcp-config` - with an empty inline config, so ambient `.mcp.json` in the fixture - directory and user-level MCP servers are never picked up. -- **`allowedTools` is treated as a real allowlist.** Claude CLI's - `--allowedTools` is natively an auto-approve list, not a restriction — - under `bypassPermissions` the model can still reach for anything. When - a run specifies `allowedTools`, the runner demotes the effective - `--permission-mode` from `bypassPermissions` to `default` so unlisted - tools are denied in non-interactive mode. If you set `permissionMode` - to anything other than `bypassPermissions` explicitly, your choice is - preserved. Runs without `allowedTools` keep whatever permission mode - they asked for. - -Practical consequence for a direct-vs-MCP fixture: the `direct` run with -`allowedTools: [Bash(kubectl *), ...]` can only shell out to those -patterns; the `mission-control` run with -`allowedTools: [mcp__mission-control__*]` can only use MCP — Bash is off -even though it's a built-in. Neither run can accidentally borrow from -the other's toolset. - -Supported per-run fields: `name`, `prompt`, `system`, `model`, `timeout`, -`cwd`, `permissionMode`, `appendSystemPrompt`, `settings`, -`maxBudgetUSD`, `repeat`, `tools`, `allowedTools`, `disallowedTools`, -`mcpConfig`, `addDir`, `betas`, `extraArgs`, `env`, `promptCaching`, -`noSessionPersistence`, `bare`. See -[`examples/ai-fixtures/`](examples/ai-fixtures/) for working benchmarks. - -Repeats (`repeat: N`) execute each run N times and report the mean -duration/cost plus a sample standard deviation — single-shot LLM numbers -are noisy and N≥3 makes comparisons defensible. The raw per-iteration -`stream-json` is saved under the artifacts directory so every claim in -the report is reproducible. - -#### Kubernetes proxy capture - -Set `captureKubernetesProxy: true` at the fixture level to route every -`kubectl` call made during the fixture through a captain-managed reverse -proxy, and record both layers of activity: - -```yaml -captureKubernetesProxy: true -kubeconfig: ~/.kube/config # optional; defaults to client-go discovery -``` - -When enabled, the runner: - -- starts a localhost reverse proxy that loads the user's kubeconfig (auth - plugins included) and forwards to the real cluster -- generates a temp kubeconfig pointing at the proxy and injects - `KUBECONFIG=` into every run's environment, so kubectl can't - bypass it -- writes a JSONL log per run/iteration to - `/-.kubectl.jsonl` with two record types: - - `{"type":"command","command":"kubectl get pods -n prod"}` — literal - CLI invocation parsed from the model's Bash tool calls - - `{"type":"request","method":"GET","path":"/api/v1/...","status":200}` - — every API call observed by the proxy -- surfaces a **Kubectl activity** section in the report with per-run CLI - and API counts plus a few sample commands - -### Container sandbox workflow - -```bash -captain container -captain container list -captain container generate -captain container generate -i -captain container build --preset golang -captain container run -captain sandbox presets -``` +Go hosts call `promptrun.Preflight` and `promptrun.Run` with a resolved spec, prepared attachments, timeout and optional recording/approval settings. Gavel uses this same seam and owns its commit finalization. See [Embedding a run](docs/src/pages/agents/embedding.mdx), [Approvals](docs/src/pages/agents/approvals.mdx), [runtime composition](pkg/runtimeprofiles/README.md), [prompt rendering](pkg/ai/prompt/README.md), [recording](pkg/promptrun/README.md), [chat](pkg/aichat/README.md) and [budget rules](pkg/budgets/README.md). -Important generate/build flags: - -- `--interactive` -- `--preset` -- `--base` -- `--mode copy|mount` - -### Whoami - -```bash -captain whoami -captain whoami --backend anthropic -captain whoami --models=false -captain whoami --no-cache -``` - -Lists every AI adapter (API providers and CLI agents: `anthropic`, `openai`, `gemini`, `claude-cli`, `claude-agent`, `codex-cli`, `gemini-cli`), their authentication method, binary availability, and a live model listing. - -Provider model listings are resolved through credential- and endpoint-scoped entries under `~/.config/captain/models/` (24h TTL), and priced from the OpenRouter snapshot in `~/Library/Caches/flanksource/openrouter-pricing.json` (24h TTL). The model cache uses a machine-local keyed namespace, so different provider accounts cannot reuse one another's availability. `--no-cache` skips both caches, re-queries every provider's model endpoint plus OpenRouter pricing, and rewrites only the affected model-cache entries with the fresh result. Add `-v` to see an access line per request, `-vv` for headers and query params, `-vvv` for request bodies, `-vvvv` for response bodies; credentials are redacted at every rung. Failed requests (status >= 400 or a transport error) are logged at the default verbosity. `-Plog.level.http=` raises HTTP logging alone, and `-Phttp.log.base-level=` (or `HTTP_LOG_BASE_LEVEL`) shifts the whole ladder. - -To keep the traffic instead of watching it scroll past, `-Phttp.har=` writes every request/response pair — including redirect hops and retries — to a HAR 1.2 archive you can open in browser DevTools. It applies to any command, not just `whoami`, and the file is written even when the command fails. `-Phttp.har.level=metadata` records headers, query strings and timings without bodies; `-Phttp.har.maxBodySize=` changes the 64 KB per-body cap (`0` for none). Credentials are masked the same way as in the wire log, which means the archive is safe to attach to a bug report but cannot be replayed — `-Phttp.har.sensitive=true` keeps them verbatim and writes the file `0600`. Use `-Phttp.captain.har=` to capture captain's own traffic when a shared `http.har` is already set. - -### Configure - -```bash -captain configure -captain configure openai -captain configure openai --test -captain configure openai --agent codex-agent --model gpt-5.6-sol --effort high --active -``` - -The providerless interactive wizard writes `~/.captain.yaml` with defaults for backend, model, reasoning effort, budget, timeout, and feature toggles (caching, MCP, hooks, skills, user/project settings, memory). - -With a provider and any of `--agent`, `--model`, `--effort`, or `--active`, `configure` saves provider-specific runtime defaults in `~/.captain.yaml`. `--effort default` clears an explicit effort so the selected model chooses its own default. The active provider supplies the agent and model for completely flagless runs. Explicit command flags still win, and each fallback model independently inherits defaults from its own provider. - -Passing `anthropic`, `openai`, `gemini`, or `deepseek` securely prompts for an API token, validates it with the provider's model-list endpoint, and saves it to `~/.config/captain/vault` only when validation succeeds. `--test` validates the currently effective token without writing. Automation may use `--token`, but interactive input is preferred because command-line arguments can be retained in shell history or process listings. Explicit runtime keys take precedence over the vault, and the vault takes precedence over environment variables. - -The `/whoami` page in `captain serve` exposes the same token operations plus agent, model, effort, and active-provider controls. Stored tokens are never displayed; only a masked identifier and credential source are returned. - -### Serve - -```bash -captain serve -captain serve --port 8080 -captain serve --dev -go run ./cmd/captain serve --dev --open -task www:dev -task www:build -``` - -Starts an HTTP API and embedded web UI. The UI launches `captain ai agent` operations and opens follow-up chat windows that resume the returned session. `--dev` keeps the Go API on the configured `--port` (`9020` by default), starts Vite on a random free port, and proxies `/api` to the API. Pass `--ui-port` to use a specific Vite port. Use `task www:dev` for the local Go-backed Vite proxy with the browser opened, and `task www:build` to rebuild the embedded web UI assets. - -### MCP server - -```bash -captain mcp -``` +## History, hooks and utilities -Exposes captain commands as MCP tools. Auto-exposes all commands except `sandbox`, `projects`, `container`, `hook`, and `ai`. - -### Browser sessions - -```bash -# List live agent-browser sessions with their cost and owning agent session -captain browser ls - -# Include sessions whose daemon has exited, and search by name/pid/agent session +```sh +captain history --summary +captain history --tool Bash --since now-7d +captain cost --group-by model +captain changes --session-id SESSION_ID +captain sessions get SESSION_ID --json --limit 0 captain browser ls --all -captain browser ls -q 8c630de6 - -# Register captain as an agent-browser launch plugin (inspect the merge first) -captain browser install --global --dry-run -captain browser install --global -``` - -``` - SESSION AGE CPU MEMORY PID AGENT SESSION PROJECT - captain-fb7c9f910548 12m 3.1% 412MB 11473 claude 8c630de6 captain - designpg/default 2h4m 0.4% 180MB 9921 codex 01f2a9c clicky-ui ``` -An `agent-browser` session is only a name plus a set of sidecar files, and its `.pid` holds the **daemon's** pid — the browser itself is an unrecorded child of that daemon. So CPU and memory are summed across the daemon's whole process tree, and age comes from the daemon's start time. - -The owning agent session is resolved from three independent signals, first hit wins, and the one used is reported as the row's link source: - -1. **`env`** — the daemon inherits the environment of the shell the agent ran `agent-browser` from, including `CLAUDE_CODE_SESSION_ID` or `CODEX_THREAD_ID`. This needs no setup and works for browsers started before the plugin was installed. -2. **`sidecar`** — the record `captain browser install` arranges for, written to `~/.captain/browser//.json` when the browser launches. Covers the cases where the environment cannot be read. -3. **`ancestor`** — the nearest claude/codex process above the daemon in the process tree. - -`captain browser install` merges captain into `agent-browser.json` as a `launch.mutate` plugin, preserving the rest of the configuration. The plugin appends nothing to the launch: agent-browser hashes the launch configuration into `.config`, and a hash that varied per agent session would restart the daemon and discard the browser's state. Captain never deletes agent-browser's sidecar files — `agent-browser doctor` owns that cleanup. - -Install also creates `~/.captain/browser` and registers it as writable in both agent sandboxes, because the plugin runs inside whatever sandbox confines the agent's own tools and cannot grant itself access once it is running: - -| Agent | File | Key | -|---|---|---| -| Claude Code | `~/.claude/settings.json` | `sandbox.filesystem.allowWrite` | -| codex | `~/.codex/config.toml` | `[sandbox_workspace_write].writable_roots` | - -Without this the plugin's write is denied as a bare "operation not permitted" and browsers silently go unattributed. `pkg/agentsandbox.EnsureWritable` is the reusable entry point for any other captain feature that has to write from inside an agent's sandbox; pass `--sandbox=false` to skip it. The codex edit is line-level so comments and ordering survive; `settings.json` is rewritten by `encoding/json` and comes back key-sorted, exactly as `captain hook monitor install` already leaves it. - -Browsers a session opened also appear on `captain sessions get ` under `browsers`. - -### Utility commands - -```bash -# Inspect every process attributed to a copied cmux surface -captain cmux info \ - surface_ref=surface:21 \ - surface_id=65BB4725-B785-48DE-B3FD-31167ECB8300 - -# Pipe the Copy IDs block directly from the clipboard -pbpaste | captain cmux info - -# Inspect a PID and request a Go goroutine stack through gops -captain cmux info 33745 --stack - -# Screenshot active browser surface in cmux -captain cmux screenshot +History filters include tool, category, path, time range and session. Changes defaults to the latest session in the current directory; `--agents=false` excludes nested agents. Token costs distinguish recorded usage, provider-reported cost and estimates; see [Sessions](docs/src/pages/sessions/index.mdx). -# Kill the process on a TCP port -captain port kill 3000 -``` - -## Build and development - -This repo uses `task` as the main task runner. - -### Build - -Build the web UI before the Go binary so the generated JavaScript and CSS assets -are included in the embedded filesystem: - -```bash -task www:build -task build -``` - -Binary output: - -```text -.bin/captain +```sh +captain hook bash-check install --user +captain hook monitor install +captain hook monitor install --capture-cost +captain browser install --global --dry-run ``` -### Docs - -```bash -task docs:dev -task docs:build -``` +The bash-check hook scans shell calls. Monitor hooks track session lifecycle; `--capture-cost` opts into Claude's custom status line and records its client-side estimate separately from provider billing. Installation refuses a higher-precedence project status line that would override it. Browser installation previews/merges an agent-browser launch plugin; see [browser attribution](docs/src/pages/sessions/index.mdx#browser-sessions). -The Astro docs site lives in `docs/`. The prompts engine is the first complete section; other Captain areas are scaffolded for future expansion. +`captain cmux info` accepts copied surface IDs, a PID or stdin and reports process trees, resource use and listening ports; `--stack` requests Go stacks through gops. `captain cmux screenshot` captures the active browser surface. `captain port kill PORT` stops the port's listener. `projects list` and `projects clean` inspect and maintain stored Claude project history. -### Test +## Development -```bash -task test -# or +```sh +make build +make lint +gavel test ./pkg/ai/prompt make test -``` - -### Lint - -```bash -task lint -``` - -### Install - -```bash task install ``` -By default this copies the built binary to: - -```text -/usr/local/bin/captain -``` - -## Docker image - -`pkg/container/base/Dockerfile` (embedded into the binary, built as `claude-env:base` by -`captain container`) builds on `flanksource/base-image` and installs a full agent toolchain: - -- **Agent CLIs** — one per backend: `claude` (`@anthropic-ai/claude-code`), `codex` - (`@openai/codex`), `gemini` (`@google/gemini-cli`), plus `tsx` for the `claude-agent` - SDK bridge -- **Flanksource tools** — `captain`, `gavel`, `repomap` (installed via `deps` from - `pkg/container/base/deps.yaml`) -- **Go** — toolchain, `task`, `ginkgo`, `golangci-lint` -- **Node** — Node.js 22, `npm`, `pnpm`, `typescript` -- **Browser automation** — `agent-browser` and Playwright Chromium (shared at - `/ms-playwright`) -- **Shell tooling** — `rg`, `fd`, `bat`, `delta`, `gh`, `jq`, `tree`, `htop`, `lsof`, - `sqlite3`, `psql`, `tmux`, `shellcheck`, `vim`, `nano`, `zsh`, `fzf`, git - -The image is set up to: - -- create a user matching host UID/GID -- switch execution using `gosu` -- use `/workspace` as the working directory - -Building it requires BuildKit. Set `GITHUB_TOKEN` (or `GH_TOKEN`) before -`captain container build` to avoid GitHub's unauthenticated API rate limit — captain passes -it through as a BuildKit secret, so it never lands in image history. To build by hand: - -```bash -DOCKER_BUILDKIT=1 docker build -t claude-env:base \ - --secret id=GITHUB_TOKEN,env=GITHUB_TOKEN \ - pkg/container/base -``` - -Publishing to `flanksource/captain` on Docker Hub and GHCR (`linux/amd64` + -`linux/arm64`) is the **Publish Image** workflow. It is manual only — dispatch it from -the tag you want to ship, and only once that tag's release exists, since the image -installs `captain` from the latest GitHub release. - -### Running a git-agent sidecar from it - -`captain sandbox git-agent deploy` enrolls an agent and places its sidecar on Docker or -Kubernetes using this image: - -```bash -captain sandbox git-agent serve --role mailbox --listen :7422 & # once, on the supervisor -captain sandbox git-agent deploy worker-01 --target docker --dry-run -captain sandbox git-agent deploy worker-01 --target docker -``` - -It applies by default; `--dry-run` prints every intended mutation first. Before minting -anything it proves a live mailbox is listening and presenting this host's own key, then -resolves the two addresses the protocol needs in opposite directions — the one the agent -reaches the mailbox on, and the one the supervisor dispatches back to. Leaving either to -be derived produces an agent that enrols, looks healthy in `git-agent list`, and fails at -the first dispatch, so `deploy` refuses rather than guesses. For `--target kubernetes` -that means `--supervisor-address` is required unless captain is itself running in the -cluster: a laptop is not routable from a managed cluster. - -The sidecar runs unprivileged (uid 501, all capabilities dropped, no privilege -escalation, read-only root with scratch on `/tmp`) and never receives a container runtime -socket — that would be a full host escape, and there is no flag to grant one. Sizing is -`--cpu-limit` / `--memory-limit` / `--storage`; the image is `--image`. The captain token -reaches the workload as a mounted file, never in argv, and `undeploy` tears the workload -down and revokes both the key and the token together. - -### Over HTTPS, with no separate mailbox process - -The mailbox can be hosted on the ordinary `captain serve` instead of its own SSH -listener. That is the process holding the database the tokens live in, so one server -serves the API, the UI and the git endpoint: - -```bash -captain serve --host 0.0.0.0 --tls --tls-host supervisor.internal # supervisor -captain sandbox git-agent add worker-01 --endpoint https://supervisor.internal:9020 -# run the printed join command on the agent host -``` - -`--tls` generates a self-signed certificate beside the git-agent keys and reuses it; -`--tls-cert` / `--tls-key` supply a real one instead. The certificate is never silently -re-issued, because every enrolled agent pins it — a certificate that does not cover an -address you name with `--tls-host` is an error at startup rather than a push failure -weeks later. An enrolling agent receives that certificate over the exchange it already -pinned, and verifies later relays against it. - -Requests from `127.0.0.1` need no token, so the local UI, CLI and hooks are unaffected; -anything off-box needs one. See `captain token` to mint, list and revoke them. Two -scopes exist: `git` reaches the push endpoint only, and `api` reaches the command API — -an agent gets `git`, so a leaked agent token cannot run commands on the supervisor. - -Tokens are durable rather than single-use, which is what lets a restarting or rescheduled -sidecar re-present the one it already has. `captain sandbox git-agent add --pool ---max-agents 5` mints one token that names each member as it arrives, for a scaled -deployment; members of a pool share a secret, so a token bound to a single agent remains -the default and stronger choice. - -## Sandbox credentials - -A sandbox needs a way to reach a model provider. An API key can simply be passed through, -but a **subscription** login cannot: Claude Code keeps its OAuth credential in the macOS -Keychain (item `Claude Code-credentials`) or `~/.claude/.credentials.json`, and Codex keeps -a ChatGPT-plan credential in `~/.codex/auth.json`, which has no env-var form at all. - -`captain sandbox credentials` mirrors those logins **with the refresh token stripped**, so a -sandbox holds an access token it can use but cannot use to mint another. For Claude that -also drops the entire `mcpOAuth` map, which holds unrelated client secrets for every MCP -server the user has authorized. - -```bash -captain sandbox credentials status # expiry per provider, and where it publishes -captain sandbox credentials sync --directory ~/.captain/sandbox/credentials -captain sandbox credentials sync --namespace agents # into a Kubernetes Secret -``` - -Because the copy cannot refresh itself, the supervisor has to. `captain serve` runs a -republish loop whose schedule comes from the credential's own expiry rather than a fixed -interval, so what lands in the target is as fresh as the host can make it. An -already-expired source is refused rather than published — a dead token in a Secret would -surface as an unexplained `401` inside an agent instead of an error where it was caused. -The host CLIs refresh their own tokens when used, so the fix is to use them. - -```yaml -# ~/.captain.yaml — publishing is opt-in; with no entries nothing is mirrored -credentials: - refreshMargin: 5m - publish: - - providers: [claude, codex] - directory: ~/.captain/sandbox/credentials # docker bind-mounts this - - providers: [claude, codex] - kubernetes: { namespace: agents, secret: captain-agent-credentials } -``` - -Local `srt` and `container` sandboxes consume the same credentials through the backend's -`tokens:` block, which also finally makes the cloud providers beside them take effect: - -```yaml -sandbox: - backends: - local: - kind: srt - tokens: { claude: {}, codex: {}, github: {} } -``` - -The redacted copy lands in a private directory and the CLI is pointed at it with -`CLAUDE_CONFIG_DIR` / `CODEX_HOME`. Once that replacement exists the host's own credential -file is added to the sandbox's deny-read list, so the sandboxed CLI can no longer reach the -refresh token — only the credential file, not the whole state directory, since the CLI still -needs its own settings and history. - -A deployed sidecar receives the Secret as a read-only **directory** mount at -`/run/captain/credentials` (`--credentials-secret`, or `--credentials-dir` for docker) and -copies each credential to the path its CLI reads. The mount is a directory rather than a -`subPath` deliberately: kubelet never updates a `subPath` volume after the pod starts, which -would pin the sidecar to the first credential it ever saw. The Secret is shared across every -agent in the namespace, so `undeploy` leaves it alone. - -## Dependencies and stack - -Primary stack: - -- **Go 1.25.8** -- **Cobra** for CLI wiring -- **clicky** for formatting/output/flag binding -- **charmbracelet/huh** for the interactive `configure` TUI -- **sandbox-runtime** for sandbox preset handling -- AI SDKs for Anthropic, OpenAI, and Gemini/Google -- shell parsing via `mvdan.cc/sh/v3` - -## Quick start - -```bash -cd captain -make build -.bin/captain info -.bin/captain history --summary -.bin/captain changes -.bin/captain container list -``` - -Configure defaults: +`make` forwards to [Taskfile.yaml](Taskfile.yaml). Build writes `.bin/captain`; install uses `go install` and its configured Go bin directory. Rebuild `task www:build` before the Go binary when changing embedded UI assets. `task www:dev` starts the Go-backed Vite development proxy. -```bash -.bin/captain configure -.bin/captain whoami -``` - -If you want to use hooks: - -```bash -.bin/captain hook bash-check install --user -.bin/captain hook monitor install -# Opt in to Claude CLI estimate capture: -.bin/captain hook monitor install --capture-cost -``` - -`--capture-cost` is opt-in because it configures a Claude Code custom status -line, with Claude's normal custom-status-line UI effects. Captain composes with -an existing status-line command and captures `cost.total_cost_usd` as Claude's -client-side session estimate. It is never attributed to model calls or written -as provider-reported billing. If the current project defines a higher-precedence -`.claude/settings.json` or `.claude/settings.local.json` status line, installation -fails rather than silently configuring an overridden user command. Without the -flag, monitor installation changes only the existing lifecycle hooks and Codex -notify configuration. Ordinary Claude transcripts and Codex's local artifacts -do not expose a monetary total, so those histories keep Captain's token-based -list-price estimate. - -Start the web UI: - -```bash -.bin/captain serve -``` - -## Notes - -- Captain is tightly focused on **Claude Code workflows**. -- It is both an analysis tool and an execution/control tool. -- The container/sandbox functionality is a major part of the project, not a side feature. -- Many commands assume the presence of Claude local state under the user’s Claude config/projects directories. -- Runtime defaults are persisted to `~/.captain.yaml`; validated provider tokens are persisted separately to the private `~/.config/captain/vault` file. +```sh +task docs:dev +task docs:build +pnpm --dir docs check +``` + +The Astro site covers prompts, runtime composition, approvals, verification, sessions, server configuration, fixtures, sandboxes and the Gavel integration. Start at [the documentation overview](docs/src/pages/index.mdx). Source docs and examples should match the current generated CLI/schema; historical designs in `docs/plans` remain design records. + +## Source layout + +| Path | Owns | +| --- | --- | +| `cmd/captain` | CLI wiring | +| `pkg/api` | Typed runtime, approval and verification contracts | +| `pkg/ai` | Providers, model catalog, prompt rendering, agent loop and middleware | +| `pkg/promptrun` | Execution admission, run lifecycle and recording | +| `pkg/runtimeprofiles` | Preset catalogs and layered composition | +| `pkg/session`, `pkg/claude` | Unified sessions and transcript parsing | +| `pkg/database`, `migrations` | PostgreSQL storage and migrations | +| `pkg/cli`, `pkg/cli/webapp` | Command handlers and embedded React UI | +| `pkg/captainconfig` | Saved defaults and credential publishing configuration | +| `pkg/sandbox`, `pkg/container`, `pkg/gitagent` | Isolation and remote execution | +| `pkg/bash`, `pkg/cmux` | Shell classification and terminal integration | +| `docs` | Astro documentation | diff --git a/Taskfile.yaml b/Taskfile.yaml index 4aac9cd5..d201a158 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -128,12 +128,20 @@ tasks: cmds: - go test -tags=e2e -count=1 -v -timeout=8m ./tests/e2e/mcp2cli + schemas:generate: + desc: Generate and check the native adapter resource schemas the schemas branch publishes + cmds: + - ./hack/adapterresources/fetch-sources.sh + - go run ./hack/adapterresources resources -out .tmp/adapter-schemas + - CAPTAIN_ADAPTER_RESOURCES=$PWD/.tmp/adapter-schemas go test -tags adapterresources -count=1 ./pkg/adapters + test:fixtures: desc: Run gavel fixture tests deps: [build] cmds: - PATH="$PWD/.bin:$PATH" gavel fixtures pkg/cli/testdata/history_test.md - PATH="$PWD/.bin:$PATH" gavel fixtures pkg/cli/testdata/permissions_matrix_test.md + - gavel fixtures 'pkg/cli/testdata/prompt-questions/*.fixture.yaml' install: desc: Build and install captain to the default Go bin diff --git a/assets/brand/captain-formation/GUIDELINES.md b/assets/brand/captain-formation/GUIDELINES.md new file mode 100644 index 00000000..505c4be2 --- /dev/null +++ b/assets/brand/captain-formation/GUIDELINES.md @@ -0,0 +1,44 @@ +# Captain / Formation + +Independent agents. One heading. Three separate bands form one directional silhouette. Use the supplied artwork; the lowercase wordmark is original outlined lettering. + +## Choose the artwork + +| Use | File | +| --- | --- | +| Light background | `source/captain-horizontal.svg` | +| Dark background | `source/captain-horizontal-dark.svg` | +| Centred placement | `source/captain-stacked.svg` or `source/captain-stacked-dark.svg` | +| Symbol, 48 px and larger | `source/captain-symbol.svg` | +| Symbol, 16–47 px | `source/captain-symbol-small.svg`; white/warm versions in `digital/` | +| Browser tab | Adaptive `web/favicon.svg`; PNG and ICO alternatives are included | +| App / social tile | `web/captain-app-icon.svg` or `social/captain-avatar.svg` | +| One colour | Black, white, and orange SVGs in `digital/` | + +## Space and size + +Keep clear space equal to the central band's thickness: **40 units on the 256-unit symbol grid**, measured outside the visible artwork. Scale that distance with the logo. Built-in canvas padding counts towards this space; add the balance in the surrounding layout. Use the existing proportions and spacing within each lockup. + +Minimum screen sizes: **horizontal 160 px wide; stacked 160 px wide; wordmark 128 px wide; small symbol 16 px square; app tile 32 px square**. Use the dedicated small drawing below 48 px. Print starting points are 35 mm horizontal, 30 mm stacked, and 6 mm symbol; inspect a physical proof before production. + +## Palette + +| Colour | HEX | RGB | Approximate CMYK % | Role | +| --- | --- | --- | --- | --- | +| Signal orange | `#C45125` | 196, 81, 37 | 0, 59, 81, 23 | Primary symbol; solid logo tile | +| Graphite | `#18252B` | 24, 37, 43 | 44, 14, 0, 83 | Wordmark; dark background | +| Warm signal | `#F2A477` | 242, 164, 119 | 0, 32, 51, 5 | Symbol on graphite | +| Paper | `#F5F4F0` | 245, 244, 240 | 0, 0, 2, 4 | Canvas | +| White | `#FFFFFF` | 255, 255, 255 | 0, 0, 0, 0 | Reversed artwork | + +Approved pairs: orange/graphite on white or Paper; warm signal/white on Graphite; white on Signal orange; black on white. Keep warm signal for dark surfaces. On photography, use a solid approved tile behind the mark. + +CMYK numbers are mathematical starting points, not profile-specific press values. No Pantone match or physical proof has been approved; have the printer match a physical spot-ink guide before a print run. + +## Typography and handling + +The logo requires no installed font. Supporting text uses the platform's system sans-serif stack; monospace is reserved for commands and code. No font files are distributed. + +Preserve the mark's orientation, silhouette, three separate bands, and lockup proportions. Use the supplied reverse and small-size drawings. Keep artwork flat and leave clear space free of text or decoration. All SVG masters remain editable vector outlines. + +Masters and handover notes live beside this guide. Public trademark clearance remains outside the supplied artwork checks. diff --git a/assets/brand/captain-formation/README.md b/assets/brand/captain-formation/README.md new file mode 100644 index 00000000..1e11362f --- /dev/null +++ b/assets/brand/captain-formation/README.md @@ -0,0 +1,49 @@ +# Captain / Formation logo kit + +Formation is the direction selected by Moshe. This kit develops it in Signal orange and Graphite, with original outlined lettering and dedicated dark, reversed, and small-size artwork. It contains design assets only; application integration is separate. + +Start with [the identity overview](presentation/overview.png), [the usage guide](GUIDELINES.md), and [the presentation board](presentation/board.html). The board shows six illustrative contexts: README, app icon, website header, terminal, sticker, and social profile. The terminal example uses existing Captain commands; it is not a captured CLI session. + +## Files + +| Folder | Contents | +| --- | --- | +| `source/` | Colour horizontal/stacked/symbol/wordmark masters, dark lockups, reverse symbol, small drawing | +| `digital/` | Black, white, orange, Graphite, and warm-signal SVGs; transparent PNG exports | +| `web/` | Adaptive SVG favicon, ICO with 16/32/48 px frames, matching PNGs, app tile, Apple/PWA icons, manifest, head snippet | +| `social/` | Graphite avatar with a circle-safe symbol, SVG and 1024 px PNG | +| `presentation/` | Overview SVG/PNG, HTML board and spec, browser mockup capture, and export QA page/screenshots | + +The primary source files are `source/captain-horizontal.svg` for light backgrounds and `source/captain-horizontal-dark.svg` for dark backgrounds. Use `source/captain-symbol-small.svg` below 48 px. White and warm small versions are in `digital/`. The ordinary white symbol and white lockups have slightly lighter symbol geometry to balance apparent weight on dark backgrounds. + +The small drawing opens the band's gaps from 20 to 24 units and makes the central band 48 units high. Favicons use that drawing. App artwork occupies 66% of its tile; the maskable icon reduces it to 50% so the mark remains inside the platform's safe circle. PWA and Apple icons have full-bleed backgrounds; the decorative app tile retains rounded corners. + +## Web handover + +Copy the files in `web/` to the host application's public root and include the markup in `web/head-snippet.html`. The manifest's image paths are relative to the manifest; the supplied head snippet assumes a public-root installation. For a different prefix, update the snippet's URLs to match. Review the host's existing manifest before replacing it. + +The SVG favicon changes from Signal orange to Warm signal under `prefers-color-scheme: dark`. Its default fill remains explicit for SVG consumers that do not process the style block. PNG and ICO alternatives use the primary orange and do not adapt. + +To inspect the local presentation and export checks from the repository root: + +```bash +python3 -m http.server 19372 --bind 127.0.0.1 --directory assets/brand/captain-formation +``` + +Open `http://127.0.0.1:19372/presentation/board.html` for the deck or `http://127.0.0.1:19372/presentation/qa.html` for the exact-size checks. Stop the server when finished. The overview SVG and HTML board contain their artwork internally and remain portable when shared. + +## Verification + +- SVG structure and geometry checked across every master and exported SVG. The stacked lockups retain an informational complexity note because their seven outlined letters contribute most of the points. The favicon's conditional style and the app tile also have expected informational notes. +- Light and dark logo/background pairs passed the audit's 3:1 logo-contrast threshold. Colour carries no meaning that is lost in the one-colour versions. +- Actual browser checks covered 16, 24, 32, and 48 px symbols; PNG favicons; minimum lockup sizes; the adaptive favicon in light and dark modes; and the QA page at desktop and 390 px widths. +- PNG dimensions checked: favicons 16/32/48, Apple 180, PWA 192/512, maskable 512, app tile 512/1024, horizontal colour 1776×512, stacked colour 1280×1024, avatar 1024×1024. The ICO contains three sizes. Transparent logo exports retain alpha; full-bleed install icons are opaque. +- The six mockups were inspected in Chrome through agent-browser. Browser checks succeeded in this pass; the earlier concept-round timeouts were not reproduced. + +Run the artwork audit from the repository root: + +```bash +python3 /Users/moshe/.agents/skills/logo-design/scripts/svg_audit.py assets/brand/captain-formation/source/*.svg assets/brand/captain-formation/digital/*.svg assets/brand/captain-formation/web/*.svg assets/brand/captain-formation/social/*.svg +``` + +The palette, clear space, and size rules are in [GUIDELINES.md](GUIDELINES.md). All lettering is filled vector geometry with no installed-font dependency. No physical print proof, Pantone assignment, or professional trademark clearance is included. Application build/lint gates are outside this asset-only change; no application source was edited. PNG exports follow the repository's existing `*.png` ignore rule; the downloadable kit archive includes them. diff --git a/assets/brand/captain-formation/digital/captain-horizontal-black.svg b/assets/brand/captain-formation/digital/captain-horizontal-black.svg new file mode 100644 index 00000000..9a4ca67c --- /dev/null +++ b/assets/brand/captain-formation/digital/captain-horizontal-black.svg @@ -0,0 +1,13 @@ + + Captain Formation horizontal logo + + + + + + + + + + + diff --git a/assets/brand/captain-formation/digital/captain-horizontal-mono-c45125.svg b/assets/brand/captain-formation/digital/captain-horizontal-mono-c45125.svg new file mode 100644 index 00000000..e31ecd2f --- /dev/null +++ b/assets/brand/captain-formation/digital/captain-horizontal-mono-c45125.svg @@ -0,0 +1,13 @@ + + Captain Formation horizontal logo + + + + + + + + + + + diff --git a/assets/brand/captain-formation/digital/captain-horizontal-white.svg b/assets/brand/captain-formation/digital/captain-horizontal-white.svg new file mode 100644 index 00000000..53daac54 --- /dev/null +++ b/assets/brand/captain-formation/digital/captain-horizontal-white.svg @@ -0,0 +1,13 @@ + + Captain Formation horizontal logo for dark backgrounds + + + + + + + + + + + diff --git a/assets/brand/captain-formation/digital/captain-stacked-black.svg b/assets/brand/captain-formation/digital/captain-stacked-black.svg new file mode 100644 index 00000000..579be280 --- /dev/null +++ b/assets/brand/captain-formation/digital/captain-stacked-black.svg @@ -0,0 +1,13 @@ + + Captain Formation stacked logo + + + + + + + + + + + diff --git a/assets/brand/captain-formation/digital/captain-stacked-mono-c45125.svg b/assets/brand/captain-formation/digital/captain-stacked-mono-c45125.svg new file mode 100644 index 00000000..4224a21d --- /dev/null +++ b/assets/brand/captain-formation/digital/captain-stacked-mono-c45125.svg @@ -0,0 +1,13 @@ + + Captain Formation stacked logo + + + + + + + + + + + diff --git a/assets/brand/captain-formation/digital/captain-stacked-white.svg b/assets/brand/captain-formation/digital/captain-stacked-white.svg new file mode 100644 index 00000000..88de8439 --- /dev/null +++ b/assets/brand/captain-formation/digital/captain-stacked-white.svg @@ -0,0 +1,13 @@ + + Captain Formation stacked logo for dark backgrounds + + + + + + + + + + + diff --git a/assets/brand/captain-formation/digital/captain-symbol-black.svg b/assets/brand/captain-formation/digital/captain-symbol-black.svg new file mode 100644 index 00000000..f4a1a952 --- /dev/null +++ b/assets/brand/captain-formation/digital/captain-symbol-black.svg @@ -0,0 +1,4 @@ + + Captain Formation symbol + + diff --git a/assets/brand/captain-formation/digital/captain-symbol-mono-18252b.svg b/assets/brand/captain-formation/digital/captain-symbol-mono-18252b.svg new file mode 100644 index 00000000..c0439fa2 --- /dev/null +++ b/assets/brand/captain-formation/digital/captain-symbol-mono-18252b.svg @@ -0,0 +1,4 @@ + + Captain Formation symbol + + diff --git a/assets/brand/captain-formation/digital/captain-symbol-mono-c45125.svg b/assets/brand/captain-formation/digital/captain-symbol-mono-c45125.svg new file mode 100644 index 00000000..8bb23686 --- /dev/null +++ b/assets/brand/captain-formation/digital/captain-symbol-mono-c45125.svg @@ -0,0 +1,4 @@ + + Captain Formation symbol + + diff --git a/assets/brand/captain-formation/digital/captain-symbol-mono-f2a477.svg b/assets/brand/captain-formation/digital/captain-symbol-mono-f2a477.svg new file mode 100644 index 00000000..6e9db017 --- /dev/null +++ b/assets/brand/captain-formation/digital/captain-symbol-mono-f2a477.svg @@ -0,0 +1,4 @@ + + Captain Formation symbol in reverse + + diff --git a/assets/brand/captain-formation/digital/captain-symbol-small-mono-f2a477.svg b/assets/brand/captain-formation/digital/captain-symbol-small-mono-f2a477.svg new file mode 100644 index 00000000..f190ecba --- /dev/null +++ b/assets/brand/captain-formation/digital/captain-symbol-small-mono-f2a477.svg @@ -0,0 +1,4 @@ + + Captain Formation symbol for small sizes + + diff --git a/assets/brand/captain-formation/digital/captain-symbol-small-white.svg b/assets/brand/captain-formation/digital/captain-symbol-small-white.svg new file mode 100644 index 00000000..c00118d7 --- /dev/null +++ b/assets/brand/captain-formation/digital/captain-symbol-small-white.svg @@ -0,0 +1,4 @@ + + Captain Formation symbol for small sizes + + diff --git a/assets/brand/captain-formation/digital/captain-symbol-white.svg b/assets/brand/captain-formation/digital/captain-symbol-white.svg new file mode 100644 index 00000000..3da9146e --- /dev/null +++ b/assets/brand/captain-formation/digital/captain-symbol-white.svg @@ -0,0 +1,4 @@ + + Captain Formation symbol in reverse + + diff --git a/assets/brand/captain-formation/digital/captain-wordmark-black.svg b/assets/brand/captain-formation/digital/captain-wordmark-black.svg new file mode 100644 index 00000000..0e00f2b7 --- /dev/null +++ b/assets/brand/captain-formation/digital/captain-wordmark-black.svg @@ -0,0 +1,12 @@ + + Captain custom wordmark + + + + + + + + + + diff --git a/assets/brand/captain-formation/digital/captain-wordmark-mono-c45125.svg b/assets/brand/captain-formation/digital/captain-wordmark-mono-c45125.svg new file mode 100644 index 00000000..987cff87 --- /dev/null +++ b/assets/brand/captain-formation/digital/captain-wordmark-mono-c45125.svg @@ -0,0 +1,12 @@ + + Captain custom wordmark + + + + + + + + + + diff --git a/assets/brand/captain-formation/digital/captain-wordmark-white.svg b/assets/brand/captain-formation/digital/captain-wordmark-white.svg new file mode 100644 index 00000000..79fa3af7 --- /dev/null +++ b/assets/brand/captain-formation/digital/captain-wordmark-white.svg @@ -0,0 +1,12 @@ + + Captain custom wordmark + + + + + + + + + + diff --git a/assets/brand/captain-formation/social/captain-avatar.svg b/assets/brand/captain-formation/social/captain-avatar.svg new file mode 100644 index 00000000..fd372ce2 --- /dev/null +++ b/assets/brand/captain-formation/social/captain-avatar.svg @@ -0,0 +1,5 @@ + + Captain Formation avatar + + + diff --git a/assets/brand/captain-formation/source/captain-horizontal-dark.svg b/assets/brand/captain-formation/source/captain-horizontal-dark.svg new file mode 100644 index 00000000..dca3697a --- /dev/null +++ b/assets/brand/captain-formation/source/captain-horizontal-dark.svg @@ -0,0 +1,13 @@ + + Captain Formation horizontal logo for dark backgrounds + + + + + + + + + + + diff --git a/assets/brand/captain-formation/source/captain-horizontal.svg b/assets/brand/captain-formation/source/captain-horizontal.svg new file mode 100644 index 00000000..157db7f0 --- /dev/null +++ b/assets/brand/captain-formation/source/captain-horizontal.svg @@ -0,0 +1,13 @@ + + Captain Formation horizontal logo + + + + + + + + + + + diff --git a/assets/brand/captain-formation/source/captain-stacked-dark.svg b/assets/brand/captain-formation/source/captain-stacked-dark.svg new file mode 100644 index 00000000..8f2eb796 --- /dev/null +++ b/assets/brand/captain-formation/source/captain-stacked-dark.svg @@ -0,0 +1,13 @@ + + Captain Formation stacked logo for dark backgrounds + + + + + + + + + + + diff --git a/assets/brand/captain-formation/source/captain-stacked.svg b/assets/brand/captain-formation/source/captain-stacked.svg new file mode 100644 index 00000000..85792f05 --- /dev/null +++ b/assets/brand/captain-formation/source/captain-stacked.svg @@ -0,0 +1,13 @@ + + Captain Formation stacked logo + + + + + + + + + + + diff --git a/assets/brand/captain-formation/source/captain-symbol-reverse.svg b/assets/brand/captain-formation/source/captain-symbol-reverse.svg new file mode 100644 index 00000000..bc1c7f32 --- /dev/null +++ b/assets/brand/captain-formation/source/captain-symbol-reverse.svg @@ -0,0 +1,4 @@ + + Captain Formation symbol in reverse + + diff --git a/assets/brand/captain-formation/source/captain-symbol-small.svg b/assets/brand/captain-formation/source/captain-symbol-small.svg new file mode 100644 index 00000000..32088c5e --- /dev/null +++ b/assets/brand/captain-formation/source/captain-symbol-small.svg @@ -0,0 +1,4 @@ + + Captain Formation symbol for small sizes + + diff --git a/assets/brand/captain-formation/source/captain-symbol.svg b/assets/brand/captain-formation/source/captain-symbol.svg new file mode 100644 index 00000000..2822a7bb --- /dev/null +++ b/assets/brand/captain-formation/source/captain-symbol.svg @@ -0,0 +1,4 @@ + + Captain Formation symbol + + diff --git a/assets/brand/captain-formation/source/captain-wordmark.svg b/assets/brand/captain-formation/source/captain-wordmark.svg new file mode 100644 index 00000000..dea6b1de --- /dev/null +++ b/assets/brand/captain-formation/source/captain-wordmark.svg @@ -0,0 +1,12 @@ + + Captain custom wordmark + + + + + + + + + + diff --git a/assets/brand/captain-formation/web/captain-app-icon.svg b/assets/brand/captain-formation/web/captain-app-icon.svg new file mode 100644 index 00000000..5fbc85f8 --- /dev/null +++ b/assets/brand/captain-formation/web/captain-app-icon.svg @@ -0,0 +1,4 @@ +Captain + Captain Formation symbol for small sizes + + \ No newline at end of file diff --git a/assets/brand/captain-formation/web/captain-favicon.svg b/assets/brand/captain-formation/web/captain-favicon.svg new file mode 100644 index 00000000..612853d7 --- /dev/null +++ b/assets/brand/captain-formation/web/captain-favicon.svg @@ -0,0 +1,4 @@ +Captain + Captain Formation symbol for small sizes + + \ No newline at end of file diff --git a/assets/brand/captain-formation/web/favicon.ico b/assets/brand/captain-formation/web/favicon.ico new file mode 100644 index 00000000..2b4a6095 Binary files /dev/null and b/assets/brand/captain-formation/web/favicon.ico differ diff --git a/assets/brand/captain-formation/web/favicon.svg b/assets/brand/captain-formation/web/favicon.svg new file mode 100644 index 00000000..7b05d5ce --- /dev/null +++ b/assets/brand/captain-formation/web/favicon.svg @@ -0,0 +1,5 @@ + + Captain + + + diff --git a/assets/brand/captain-formation/web/head-snippet.html b/assets/brand/captain-formation/web/head-snippet.html new file mode 100644 index 00000000..2bebe2b5 --- /dev/null +++ b/assets/brand/captain-formation/web/head-snippet.html @@ -0,0 +1,5 @@ + + + + + diff --git a/assets/brand/captain-formation/web/site.webmanifest b/assets/brand/captain-formation/web/site.webmanifest new file mode 100644 index 00000000..24af6426 --- /dev/null +++ b/assets/brand/captain-formation/web/site.webmanifest @@ -0,0 +1,25 @@ +{ + "name": "Captain", + "short_name": "Captain", + "icons": [ + { + "src": "icon-192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "icon-512.png", + "sizes": "512x512", + "type": "image/png" + }, + { + "src": "maskable-512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable" + } + ], + "theme_color": "#C45125", + "background_color": "#C45125", + "display": "standalone" +} diff --git a/cmd/captain/help_test.go b/cmd/captain/help_test.go index 3973efc5..95552541 100644 --- a/cmd/captain/help_test.go +++ b/cmd/captain/help_test.go @@ -48,6 +48,16 @@ var _ = Describe("root help", func() { Expect(out.String()).ToNot(ContainSubstring(commonsMarker)) }) + It("documents prompt lookup locations in root help", func() { + root, _, out := newRoot() + root.SetArgs([]string{"--help"}) + + Expect(root.Execute()).To(Succeed()) + for _, location := range []string{"Prompt lookup locations", "~/.captain.yaml", "prompts.dirs", ".captain/prompts", "~/.config/captain/prompts", "$XDG_CONFIG_HOME/captain/prompts"} { + Expect(out.String()).To(ContainSubstring(location)) + } + }) + It("drops ANSI escapes when --no-color is set", func() { defer func(previous bool) { clicky.Flags.NoColor = previous }(clicky.Flags.NoColor) clicky.Flags.NoColor = true diff --git a/cmd/captain/internal/rootcmd/help.go b/cmd/captain/internal/rootcmd/help.go index 6f30050d..6c04a2ee 100644 --- a/cmd/captain/internal/rootcmd/help.go +++ b/cmd/captain/internal/rootcmd/help.go @@ -3,13 +3,13 @@ package rootcmd import ( "fmt" + "github.com/flanksource/captain/pkg/cli" "github.com/flanksource/clicky" "github.com/flanksource/commons/help" "github.com/spf13/cobra" ) -// InstallRootHelp appends commons' documentation of the runtime knobs captain -// inherits to the root command without changing subcommand help. +// InstallRootHelp appends prompt locations and inherited runtime knobs to root help. func InstallRootHelp(root *cobra.Command) { cobraHelp := root.HelpFunc() root.SetHelpFunc(func(cmd *cobra.Command, args []string) { @@ -17,6 +17,7 @@ func InstallRootHelp(root *cobra.Command) { if cmd != root { return } + fmt.Fprintf(cmd.OutOrStdout(), "\nPrompt lookup locations\n%s\n", cli.PromptLookupHelp) text := help.Help() out := text.ANSI() if clicky.Flags.NoColor { diff --git a/cmd/captain/internal/rootcmd/lint.go b/cmd/captain/internal/rootcmd/lint.go new file mode 100644 index 00000000..a89d6f98 --- /dev/null +++ b/cmd/captain/internal/rootcmd/lint.go @@ -0,0 +1,56 @@ +package rootcmd + +import ( + "context" + "errors" + "io" + "os" + + "github.com/flanksource/captain/pkg/cli" + "github.com/flanksource/captain/pkg/lint/promptfile" + "github.com/flanksource/clicky" + "github.com/flanksource/gavel/linters" + "github.com/flanksource/gavel/models" + "github.com/spf13/cobra" +) + +type promptfileLintOptions struct { + Paths []string `args:"true" help:"Promptfiles or directories (default: current directory)"` + Var []string `flag:"var" short:"V" split:"false" help:"Sample template input (repeatable): key=value, key:=json, or key[]=@file for a list of lines"` + Vars string `flag:"vars" clicky:"cli-file-read" help:"Sample template inputs as a JSON object, or @file"` +} + +func RegisterLintCommand(root *cobra.Command, isStdinAvailable func() bool) { + parent := &cobra.Command{Use: "lint", Short: "Validate Captain configuration files"} + clicky.MarkLocalOnly(parent) + root.AddCommand(parent) + command := clicky.AddNamedCommandWithContext("promptfile", parent, promptfileLintOptions{}, func(ctx context.Context, options promptfileLintOptions) (promptfile.Results, error) { + workDir, err := os.Getwd() + if err != nil { + return promptfileLintFailure(err) + } + var stdin []byte + if isStdinAvailable() { + stdin, err = io.ReadAll(os.Stdin) + if err != nil { + return promptfileLintFailure(err) + } + } + variables, err := cli.ParsePromptVariables(cli.AIPromptOptions{Var: options.Var}, options.Vars, string(stdin), false) + if err != nil { + return promptfileLintFailure(err) + } + results := promptfile.Run(ctx, promptfile.Options{WorkDir: workDir, Paths: options.Paths, Data: variables.Data}) + if results[0].Test().Sum().Failed > 0 { + return results, errors.New("promptfile lint failed") + } + return results, nil + }) + command.Use = "promptfile [paths...]" + command.Short = "Validate .prompt declarations and template syntax without running a model" + command.Long = "Validate .prompt files using Gavel's linter framework. Directory discovery respects Git ignore rules. Missing frontmatter inputs warn and defer declaration checks; use --var or --vars for full validation. Missing body variables are allowed. Warnings exit successfully; errors exit nonzero." +} + +func promptfileLintFailure(err error) (promptfile.Results, error) { + return promptfile.Results{&linters.LinterResult{Linter: "promptfile", Error: err.Error(), Violations: []models.Violation{}}}, err +} diff --git a/cmd/captain/lint_ginkgo_test.go b/cmd/captain/lint_ginkgo_test.go new file mode 100644 index 00000000..a9d75dbf --- /dev/null +++ b/cmd/captain/lint_ginkgo_test.go @@ -0,0 +1,109 @@ +package main + +import ( + "encoding/json" + "os" + "path/filepath" + + "github.com/flanksource/clicky" + "github.com/flanksource/gavel/linters" + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +var _ = Describe("Promptfile lint command", func() { + It("registers a local-only command with sample-input flags", func() { + command, _, err := newRootCommand().Find([]string{"lint", "promptfile"}) + Expect(err).NotTo(HaveOccurred()) + Expect(command.Name()).To(Equal("promptfile")) + Expect(clicky.IsLocalOnly(command)).To(BeTrue()) + Expect(command.Flags().Lookup("var")).NotTo(BeNil()) + Expect(command.Flags().Lookup("vars")).NotTo(BeNil()) + }) + + DescribeTable("emits Gavel JSON and applies the framework severity verdict", + func(source string, extra []string, fails bool, findings int) { + path := filepath.Join(GinkgoT().TempDir(), "review.prompt") + Expect(os.WriteFile(path, []byte(source), 0o600)).To(Succeed()) + output, err := capturePromptfileOutput(append([]string{"lint", "promptfile", path, "--format", "json"}, extra...)) + Expect(err != nil).To(Equal(fails), output) + var results []*linters.LinterResult + Expect(json.Unmarshal([]byte(output), &results)).To(Succeed(), output) + Expect(results).To(HaveLen(1)) + Expect(results[0].Linter).To(Equal("promptfile")) + Expect(results[0].FileCount).To(Equal(1)) + Expect(results[0].Violations).To(HaveLen(findings)) + }, + Entry("valid reusable prompt", "Review {{missing}}\n", nil, false, 0), + Entry("invalid YAML retains its finding", "---\nmodel: [unfinished\n---\nbody\n", nil, true, 1), + Entry("missing inputs warn", "---\nbudget:\n maxTokens: {{limit}}\n---\nbody\n", nil, false, 1), + Entry("JSON sample inputs", "---\nbudget:\n maxTokens: {{limit}}\n---\nbody\n", []string{"--vars", `{"limit": 100}`}, false, 0), + Entry("individual inputs override JSON", "---\nbudget:\n maxTokens: {{limit}}\n---\nbody\n", []string{"--vars", `{"limit": -1}`, "--var", "limit=100"}, false, 0), + Entry("rendered invalid option", "---\nbudget:\n maxTokens: {{limit}}\n---\nbody\n", []string{"--var", "limit=-1"}, true, 1), + ) + + DescribeTable("preserves structured failures for invalid inputs", + func(extra []string, message string) { + output, err := capturePromptfileOutput(append([]string{"lint", "promptfile", "--format", "json"}, extra...)) + Expect(err).To(HaveOccurred()) + var results []*linters.LinterResult + Expect(json.Unmarshal([]byte(output), &results)).To(Succeed(), output) + Expect(results).To(ConsistOf(And(HaveField("Success", false), HaveField("Error", ContainSubstring(message))))) + }, + Entry("missing file", []string{"missing-review.prompt"}, "missing-review.prompt"), + Entry("malformed JSON", []string{"--vars", "["}, "--vars"), + Entry("null JSON", []string{"--vars", "null", "--var", "limit=100"}, "object"), + Entry("malformed variable", []string{"--var", "limit"}, "key=value"), + ) + + It("renders actionable diagnostics in the human format", func() { + path := filepath.Join(GinkgoT().TempDir(), "review.prompt") + Expect(os.WriteFile(path, []byte("---\nmode: invalid\n---\nbody\n"), 0o600)).To(Succeed()) + output, err := capturePromptfileOutput([]string{"lint", "promptfile", path, "--format", "pretty", "--no-color"}) + Expect(err).To(HaveOccurred()) + Expect(output).To(ContainSubstring("review.prompt")) + Expect(output).To(ContainSubstring("mode")) + Expect(output).To(ContainSubstring("Prompt lint")) + Expect(output).To(ContainSubstring("1 error")) + Expect(output).To(ContainSubstring("0 warnings")) + }) + + It("distinguishes warning-only lint results in the human format", func() { + path := filepath.Join(GinkgoT().TempDir(), "review.prompt") + Expect(os.WriteFile(path, []byte("---\nmodel: {{model}}\n---\nReview.\n"), 0o600)).To(Succeed()) + output, err := capturePromptfileOutput([]string{"lint", "promptfile", path, "--format", "pretty", "--no-color"}) + Expect(err).NotTo(HaveOccurred()) + Expect(output).To(ContainSubstring("0 errors")) + Expect(output).To(ContainSubstring("1 warning")) + Expect(output).To(ContainSubstring("review.prompt")) + }) + + It("keeps the broken-link cause visible in human output", func() { + directory := GinkgoT().TempDir() + path := filepath.Join(directory, "broken.prompt") + Expect(os.Symlink(filepath.Join(directory, "missing.prompt"), path)).To(Succeed()) + output, err := capturePromptfileOutput([]string{"lint", "promptfile", path, "--format", "pretty", "--no-color"}) + Expect(err).NotTo(HaveOccurred()) + Expect(output).To(ContainSubstring("1 warning")) + Expect(output).To(ContainSubstring("no such file or directory")) + Expect(output).To(ContainSubstring("promptfile/symlink")) + }) +}) + +func capturePromptfileOutput(args []string) (string, error) { + GinkgoHelper() + output, err := os.CreateTemp(GinkgoT().TempDir(), "stdout") + Expect(err).NotTo(HaveOccurred()) + previousStdout, previousFlags := os.Stdout, *clicky.Flags + defer func() { + os.Stdout, *clicky.Flags = previousStdout, previousFlags + Expect(output.Close()).To(Succeed()) + }() + os.Stdout = output + root := newRootCommand() + root.SetArgs(args) + err = root.Execute() + data, readErr := os.ReadFile(output.Name()) + Expect(readErr).NotTo(HaveOccurred()) + return string(data), err +} diff --git a/cmd/captain/main.go b/cmd/captain/main.go index a0c529f3..5c2305b3 100644 --- a/cmd/captain/main.go +++ b/cmd/captain/main.go @@ -9,6 +9,7 @@ import ( "github.com/flanksource/captain/pkg/cli" "github.com/flanksource/captain/pkg/gitagent" "github.com/flanksource/clicky" + "github.com/flanksource/clicky/extensions" "github.com/flanksource/clicky/flags" "github.com/flanksource/clicky/mcp" "github.com/flanksource/commons/properties" @@ -27,6 +28,7 @@ func main() { // Flush before exiting: PersistentPostRun does not run when a command // fails, and a failed run is the one whose HAR you want. cli.FlushHAR() + cli.FlushTelemetry() if err != nil { os.Exit(1) } @@ -68,6 +70,12 @@ func newRootCommand() *cobra.Command { fmt.Fprintln(os.Stderr, err) os.Exit(1) } + // A configured collector that cannot be set up is a hard stop rather + // than a run whose traces silently go nowhere. + if err := cli.InitTelemetry(cmd.Context()); err != nil { + fmt.Fprintln(os.Stderr, err) + os.Exit(1) + } // Bind the database context every command reads from, so an unknown // --context fails before the command runs rather than at first query. name, err := cli.ResolveDatabaseContextName(cmd.Context()) @@ -85,8 +93,9 @@ func newRootCommand() *cobra.Command { Dirty: dirty, }) - clicky.BindAllFlags(rootCmd.PersistentFlags(), "format") + clicky.BindAllFlagsToCommand(rootCmd, "format") cli.BindDatabaseFlags(rootCmd.PersistentFlags()) + cli.BindTelemetryFlags(rootCmd.PersistentFlags()) // Bind commons' -P/--properties flag so per-subsystem log levels and HTTP // wire logging can be toggled, e.g. -Plog.level.http=trace or // -Phttp.log.base-level=info. @@ -141,8 +150,12 @@ func newRootCommand() *cobra.Command { clicky.AddNamedCommandWithContext("live", sessionsCmd, cli.SessionLiveOptions{}, cli.RunSessionLive).Short = "List sessions with live process health" clicky.AddNamedCommandWithContext("get", sessionsCmd, cli.SessionGetOptions{}, cli.RunSessionGet).Short = "Show a session transcript" clicky.AddNamedCommandWithContext("tokens", sessionsCmd, cli.SessionTokensOptions{}, cli.RunSessionTokens).Short = "Size canonical transcript rows without changing recorded usage" + deliverCmd := clicky.AddNamedCommandWithContext("deliver", sessionsCmd, cli.SessionDeliverOptions{}, cli.RunSessionDeliver) + deliverCmd.Short = "Send a message into a live session through its own channel" + deliverCmd.Long = "Deliver --text into a running claude or codex session that captain did not launch: Claude Code's messaging socket, `codex queue`, or else typing into the agent's cmux pane. The session must be live; it is never resumed in a second process." rootCmd.AddCommand(cli.NewBrowserCommand()) + rootcmd.RegisterLintCommand(rootCmd, isStdinAvailable) psCmd := clicky.AddNamedCommandWithContext("ps", rootCmd, cli.PSOptions{}, cli.RunPS) psCmd.Short = "List live agent sessions, or inspect specific process IDs" @@ -159,6 +172,10 @@ func newRootCommand() *cobra.Command { rootCmd.AddCommand(permissionsCmd) clicky.AddNamedCommand("matrix", permissionsCmd, cli.PermissionsMatrixOptions{}, cli.RunPermissionsMatrix).Short = "Print the declared permission capability matrix (settings × runtimes)" + clicky.AddNamedCommandWithContext("explain", permissionsCmd, cli.PermissionsExplainOptions{}, cli.RunPermissionsExplain).Short = + "Show what a prompt's permissions compile to on each runtime, and the portable form" + clicky.AddNamedCommand("convert", permissionsCmd, cli.PermissionsConvertOptions{}, cli.RunPermissionsConvert).Short = + "Rewrite a prompt or preset's permissions as permissions.access when the conversion is exact or tighter" sandboxCmd := &cobra.Command{ Use: "sandbox", @@ -362,6 +379,10 @@ func newRootCommand() *cobra.Command { cli.RegisterRuntimeEntities() cli.RegisterBudgetEntities() clicky.GenerateCLI(rootCmd) + if err := cli.AttachPromptListOutput(rootCmd); err != nil { + fmt.Fprintf(os.Stderr, "failed to attach prompt list output: %v\n", err) + os.Exit(1) + } if err := cli.AttachPromptSchemaFlag(rootCmd); err != nil { fmt.Fprintf(os.Stderr, "failed to attach prompt schema flag: %v\n", err) os.Exit(1) @@ -370,6 +391,10 @@ func newRootCommand() *cobra.Command { fmt.Fprintf(os.Stderr, "failed to attach prompt help: %v\n", err) os.Exit(1) } + if err := cli.AttachPromptInputFiles(rootCmd); err != nil { + fmt.Fprintf(os.Stderr, "failed to attach prompt input files: %v\n", err) + os.Exit(1) + } mcpConfig := &mcp.Config{ Name: "captain", @@ -411,6 +436,7 @@ func newRootCommand() *cobra.Command { portKillCmd.Short = "Kill the process listening on a TCP port" portKillCmd.Long = "Find the process bound to the specified TCP port using lsof and kill it with SIGKILL. Reports the process name and PID before killing." + extensions.CobraExtensions(rootCmd).Interactive() return rootCmd } diff --git a/cmd/captain/version_test.go b/cmd/captain/version_test.go index 24080e13..0cfc4fd2 100644 --- a/cmd/captain/version_test.go +++ b/cmd/captain/version_test.go @@ -35,7 +35,7 @@ var _ = Describe("version information", func() { info := rootcmd.BuildInfo{Version: "v1.2.3", Commit: "abc1234", Date: "2026-07-27T12:34:56Z", Dirty: "maybe"} Expect(func() { - info.String() + _ = info.String() }).To(PanicWith(`invalid build dirty state "maybe"`)) }) diff --git a/docs/adapter-resource-schemas.md b/docs/adapter-resource-schemas.md new file mode 100644 index 00000000..b2263b9e --- /dev/null +++ b/docs/adapter-resource-schemas.md @@ -0,0 +1,70 @@ +# Adapter and resource schemas + +Open `/adapter-schemas` in `captain serve --dev`. Select a provider and resource to inspect its schema or edit a local Form, JSON or YAML draft. Resource selection, view and search are shareable URLs; draft values remain in the mounted page and are discarded on reload. Switching resources retains each draft. Invalid JSON/YAML stays editable and disables form editing and validation until corrected. + +“Validate schema” checks the document against its selected JSON Schema. It does not resolve profile inheritance, inspect credential files, check installed tools, enforce runtime capabilities, execute hooks or apply configuration. Execution-only managed/unsupported options and enrollment-managed agent records render read-only. Native resource schemas describe the provider's configuration independently of Captain's forwarding support. + +## Catalog + +The page combines two catalogs of documents with stable `id`, `kind`, `provider`, `title`, `description` and `schema` fields; execution documents additionally carry `mode`. + +- `GET /api/captain/ai/adapter-schemas` returns the schemas embedded in the Captain binary: execution schemas (`anthropic/api`, `openai/agent`, …) and Captain's own resources (`captain/permissions`, `captain/preset`, `captain/docker-backend`, `captain/git-agent-backend`, …). +- Native provider resources (`openai/permission-profile`, `anthropic/sandbox`, `google/settings`, …) are not embedded. The browser loads them from the published catalog at `https://raw.githubusercontent.com/flanksource/captain/schemas/adapters/native-resources.json`. When that fetch fails, the page reports the URL and status and keeps the embedded schemas usable. Build the web app with `VITE_CAPTAIN_NATIVE_RESOURCES_URL` set to point it at another catalog, such as one generated locally. + +POST a value without saving or applying it. An embedded document is looked up by `id`. A published document is not known to the server, so the request carries its `schema`: + +```sh +curl -sS http://localhost:9020/api/captain/ai/adapter-schemas/validate \ + -H 'Content-Type: application/json' \ + -d '{"id":"captain/permissions","value":{"mode":"plan","tools":{"Bash":"deny"}}}' +``` + +Errors include JSON-pointer instance and schema paths. A well-formed request with invalid values returns HTTP 200 and `valid:false`. Malformed requests and uncompilable carried schemas return 400, unknown embedded IDs 404, and invalid embedded schemas 500. A carried schema must be self-contained: external `$ref`s are never loaded. The endpoint has a 16 MiB request limit, which fits the largest carried schema. No runtime or persistence call occurs. + +## Sources and regeneration + +Configuration snapshots record source versions, references, SHA-256 and top-level property counts in `x-captain-resource`. Execution schemas retain `x-captain-adapter` provenance, support annotations and source inventories. CLI inventories include every long option in the captured execution command help, including aliases. API inventories follow the module-pinned request types and nested definitions, preserving required fields, literal discriminators, native enums and typed maps. + +### Native resources: generated by CI, published to the `schemas` branch + +The `Adapter schemas` workflow (`.github/workflows/adapter-schemas.yml`) runs on pull requests that touch `hack/adapterresources` or `pkg/adapters`, and on `main`: + +1. `hack/adapterresources/fetch-sources.sh` captures the pinned sources into `.tmp/adapter-schema-sources`: the Codex and Gemini release configuration schemas, and the Claude settings, agent, MCP and plugin schemas that `ts-json-schema-generator` derives from the `@anthropic-ai/claude-agent-sdk` type declarations (`hack/adapterresources/claude-types.ts`). +2. `go run ./hack/adapterresources resources -out .tmp/adapter-schemas` applies the patches, annotates the schemas for forms, and writes `.json` plus `native-resources.json`, the catalog projected by `adapters.NativeResourceSchemas`. +3. `go test -tags adapterresources ./pkg/adapters` with `CAPTAIN_ADAPTER_RESOURCES=.tmp/adapter-schemas` checks the generated catalog: every projection is present and annotated, native examples validate, and the patches took effect. Without the variable these specs fail rather than skip. +4. On `main` only, `hack/adapterresources/publish-schemas-branch.sh` commits the output to `adapters/` on the orphan `schemas` branch. The branch holds only generated artifacts. The first run creates it, and an unchanged output publishes nothing. + +`task schemas:generate` runs steps 1–3 locally. It needs `curl`, Node.js and Go. + +#### Patches + +`hack/adapterresources/patches/.yaml` corrects upstream help text, typing and enums declaratively, as an RFC 6902 JSON Patch authored in YAML. A provider's patch file is named in `nativeSources` (`hack/adapterresources/main.go`). Patches apply to the source as captured, before root flattening, so a change to a definition reaches every projection of it. Put a `test` op before each change that depends on an upstream value. If the SDK changes that value, generation fails instead of silently patching something else. Never edit generated output by hand. + +### Execution schemas: committed + +The execution schemas under `pkg/adapters//` are committed and embedded. Enriching them needs locally installed CLIs (Claude CLI 2.1.309, Codex CLI 0.164.0 and Gemini CLI 0.64.0) and the generated native resources. Capture the CLI sources after `task schemas:generate`: + +```sh +codex app-server generate-json-schema --experimental --out .tmp/adapter-schema-sources/codex-protocol +claude --help > .tmp/adapter-schema-sources/claude-help.txt +codex exec --help > .tmp/adapter-schema-sources/codex-help.txt +gemini --help > .tmp/adapter-schema-sources/gemini-help.txt +go run ./hack/adapterresources execution -resources .tmp/adapter-schemas +go generate ./pkg/adapters +``` + +Then run `gavel test ./pkg/adapters`. Review source-version changes deliberately. The importer rejects missing native root shapes and newly uncovered CLI flags. Codex's generated schema omits `serde(flatten)` permission maps; their value schemas are supplied from `codex-rs/config/src/permissions_toml.rs` at the same release, with source references on each supplemented definition. + +Captain backend JSON follows `sandbox.backends.` in `~/.captain.yaml`: `kind` and backend option keys are siblings. Docker backend volume values are strings (`source:target[:ro]`), distinct from the structured volumes in `.container-sandbox.yaml`. Git Agent enrollment entries contain endpoint trust and credential **paths**, never credential contents. Its `waitTimeout` remains subject to positive-duration validation at runtime. + +## Form annotations + +Use `title`, `description`, `x-help.links`, `x-clicky-order`, `x-clicky-section`, `x-enum-labels`, `x-enum-display`, `x-enum-icons`, `x-array-display` and `readOnly` on the owning schema nodes. Documentation links are absolute HTTP(S) URLs. Icons resolve through Clicky UI's offline icon provider. Presentation annotations do not replace validation constraints or native wire names. + +Clicky UI renders object/array/scalar unions with a branch selector and retains branch drafts. `format:json` explicitly requests a typed JSON editor for genuinely arbitrary JSON. Typed `additionalProperties` and `patternProperties` remain editable maps; recursive references are kept in the schema graph rather than expanded indefinitely. Native source schemas can evolve independently of Captain's executable option coverage. + +## Live form smoke check + +With the development server on port 9020, run `go run ./hack/adapterbrowser`. It uses `agent-browser --engine chrome --session captain-adapters-impl` to open every document of the embedded catalog and of the published native catalog (`-native-catalog` overrides its URL) in Form view, verifies the local-preview and validation controls, and fails on a render error. It does not change resource values or apply configuration. Close that browser session after inspection with `agent-browser --engine chrome --session captain-adapters-impl close`. + +The expansion was checked against all 50 live form views, JSON/YAML draft retention and correction, server-side nested permission errors, documentation links and offline enum icons, plus desktop and 390px compact layouts. Focused Go contract/API tests, 485 shared form tests, Captain UI tests, scoped lint, Go and Clicky builds, and repeated-generation hashes passed. Repository-wide lint encounters unrelated duplicate `main` declarations under `hack/`; the production webapp build encounters the existing `RuntimePreset.order` mismatch with the pinned published Clicky package. The shared form improvements live in the sibling Clicky UI checkout and need its normal release/dependency update before shipping. diff --git a/docs/package.json b/docs/package.json index 3f704001..fb115a6f 100644 --- a/docs/package.json +++ b/docs/package.json @@ -13,7 +13,7 @@ "@ai-sdk/react": "^3.0.201", "@astrojs/mdx": "^7.0.2", "@astrojs/react": "^6.0.1", - "@flanksource/clicky-ui": "0.3.51", + "@flanksource/clicky-ui": "0.3.56", "@mdxeditor/editor": "^4.0.4", "@shikijs/langs": "^1.24.0", "@shikijs/themes": "^1.24.0", diff --git a/docs/plans/adapter-resource-schemas.md b/docs/plans/adapter-resource-schemas.md new file mode 100644 index 00000000..866f122e --- /dev/null +++ b/docs/plans/adapter-resource-schemas.md @@ -0,0 +1,23 @@ +# Adapter resource schema expansion + +Status: implemented; final validation recorded in the execution report. + +## Approved scope + +Expand all registered API, Agent and CLI execution schemas and expose native provider configuration and reusable resources alongside portable Captain configuration. Include sandbox policies, named permission profiles, filesystem and network grants, hooks, MCP, agents, skills, plugins, model/environment settings and trusted Docker/Git Agent backend configuration. Keep provider execution wiring unchanged. + +Expose a stable resource ID and kind on each catalog document, retain existing execution modes and URLs, and provide stateless schema validation. Compile local references without fetching external schemas. Preserve source versions and native constraints. + +Use shared Clicky UI form annotations and controls for editing, enums, enum icons, documentation links, typed maps and unions. Offer Schema, Form, JSON and YAML views with independent local drafts per resource, recoverable malformed source and explicit schema validation. Selection, search and view belong in the URL. Drafts are local preview state and have no save/apply action. + +## Implementation + +`pkg/adapters/resources` contains pinned native source snapshots. The resource catalog projects reusable definitions with their transitive local references. Captain resources derive from the owning Go API models; trusted backend shapes follow their adapter option readers. `hack/adapterresources` imports pinned sources, completes Rust flatten-map declarations and annotates the schema graph without changing native enum values. Generated DTO union aliases preserve JSON marshaling methods. + +The existing GET endpoint returns the expanded array. POST `/api/captain/ai/adapter-schemas/validate` takes `{id,value}` and returns `valid` and structured errors containing `instancePath`, `schemaPath` and `message`. Malformed requests return 400, unknown IDs return 404 and schema compilation failures return 500. + +## Verification + +Contract tests cover the complete registry matrix, source inventory, recursive annotations, self-contained schema compilation, invalid nested permissions and native DTO round trips. UI tests cover union selection, typed JSON, help links and independent recoverable resource drafts. Verify generation twice, focused Go and Vitest suites, Clicky UI check/build, Captain lint/build, and the exact development route in Chrome at desktop and compact widths. + +See [the resource guide](../adapter-resource-schemas.md) for source capture, validation examples and operating limits. diff --git a/docs/plans/inline-tool-environment.md b/docs/plans/inline-tool-environment.md new file mode 100644 index 00000000..7b4f4911 --- /dev/null +++ b/docs/plans/inline-tool-environment.md @@ -0,0 +1,180 @@ +# Inline tool environment: placement and credentials + +Status: Phases 0–3 implemented (2026-10-23); Phase 4 pending open questions 1–2 · 2026-10-23 · follows the inline-tools change (`pkg/api/inline_tool.go`, `pkg/ai/tools/exectool`, `pkg/promptrun/inline_tools.go`) + +## Context + +An inline tool is a script the model calls. Two questions decide what the script can reach, and today neither one is configurable: + +1. **Placement.** Does the script run inside the run's sandbox, or outside it on the host next to captain? +2. **Credentials.** How do the script's connections reach it? + - `none`: the script gets no credentials. + - `direct`: the script holds the real credentials and performs the credentialed operation itself. On the host, this makes the tool the proxy: the sandboxed agent only ever sees the tool's result. + - `proxied`: the script gets credential-free configuration pointing at a host-side proxy that injects the credentials on the way out. This is the pattern `pkg/ai/fixture/kubeproxy` already uses for fixtures. + +Today every inline tool runs **on the host with direct credentials**, whatever the sandbox: + +- `promptrun.Input.Verify.Wrap` is never set by `captain prompt run` or `captain ai agent` (`pkg/cli/prompt_run_live.go:60`, `pkg/cli/ai_agent.go:224`), so `exectool` calls `shell.RunCmd` with a nil `Wrap`. +- The docs say the opposite: `docs/src/pages/prompts/format.mdx` claims "In a sandboxed run, the script is confined by the same wrapper as `workflow.verify` commands." That sentence is false. + +The goal is to make placement and credentials explicit, declared per tool and checked against what the run's sandbox can support. A combination the sandbox cannot provide is refused before the model is called. Nothing is silently downgraded. + +```yaml +tools: + deploy_status: + exec: kubectl get deploy -o json + readonly: true + placement: host # host | sandbox + credentials: proxied # none | direct | proxied + connections: + kubernetes: {kubeconfig: {valueFrom: {secretKeyRef: {name: prod, key: kubeconfig}}}} + release_notes: + exec: ./hack/notes.sh + placement: sandbox + credentials: none +``` + +## Gaps + +| # | Gap | Evidence | +|---|-----|----------| +| G1 | Placement and credentials are not declarable; the docs claim tool scripts are confined, but they never are | `Verify.Wrap` is unset at both `promptrun.Run` call sites; `format.mdx` inline-tools section | +| G2 | No run-scoped wrapper is available to tools. The only `CommandWrapper` is built per agent CLI process | `provider/cli.go:152-215` (`newSandboxedCommand`); `gitagent/hookmain.go:105` (`ResolveHookWrap`, git-agent hooks only) | +| G3 | commons-db `Exec.Wrap` receives the full prepared environment (host allowlist included). The docker wrapper would forward host `PATH`/`HOME` into the container | `commons-db/shell/shell.go` `wrapCommand`; captain deliberately passes only declared env to agent wrappers (`provider/cli.go:218` `declaredSetupEnv`) | +| G4 | Connections are materialized on **every** tool call: a new `.creds/` directory in the workspace cwd, plus `gcloud auth` / `az login`, which change host state | `commons-db/connection/environment.go` (`saveConfig` writes into `cmd.Dir`, L253-308); `exectool.execFor`, then `RunCmd` per call | +| G5 | No proxied credential mode is wired anywhere. Two working building blocks exist: `kubeproxy` (a credential-free kubeconfig plus an auth-injecting reverse proxy) and `gitagent/proxy` (HTTP grants with placeholder substitution). Neither is used on the run path | `pkg/ai/fixture/kubeproxy/proxy.go:78,215`; `pkg/gitagent/proxy/grants.go:36,143`; `gitagent_deploy.go:116` ("egress credential proxy has no callers") | +| G6 | Under docker, caller tools are unreachable for **any** placement. The loopback MCP server binds `127.0.0.1` on the host; the container has no `--add-host` and the MCP config temp file is not mounted. Nothing refuses this combination | `callertools/runtime.go:123`; `sandbox/adapter/container.go:212-242`; `promptrun/preflight.go` checks only the mode | +| G7 | Native sandboxes are provider-enforced (claude `--settings`, codex), so there is no wrapper that could hold a tool. git-agent runs refuse inline tools outright | `adapter/none.go`; `promptrun/inline_tools.go` (supplied Provider) | +| G8 | Tools inherit the run's `setup.connections`, so a tool that should run with `none` silently gets them. Separately, run-level connections give the agent the same secrets the tool was meant to keep away from it | `exectool.Workspace.execFor`; `provider/cli.go:180-184` (agent env = `req.Setup.Env`) | + +## Design + +### Fields + +They are added to `api.InlineTool`; a spec-level `toolDefaults` is deferred. + +- `placement: host | sandbox`. The default is `host`, which is today's behavior. +- `credentials: none | direct | proxied`. The default is derived and never guessed: + - The tool's connections (its own plus any it inherits) are empty → `none`. + - Otherwise, `placement: host` → `direct`. This is today's behavior. + - Otherwise, `placement: sandbox` → **refused** until `credentials` is set. Secrets never enter a sandbox implicitly. +- What counts as credentials: `connections`, plus `envVars` that use `valueFrom`. Static `envVars` and `dotenv` are configuration and pass through in every mode. + +### Semantics + +| credentials | host placement | sandbox placement | +|---|---|---| +| `none` | Run connections are not inherited. A tool that declares `connections` or secret `envVars` is a validation error. | Same rule, inside the sandbox. | +| `direct` | Real credential files and env on the host. **The tool is the proxy**: the agent sees only the result. | Real credentials enter the sandbox. Allowed only with this explicit value; lint warns. | +| `proxied` | Credential-free config pointing at a host proxy on `127.0.0.1`. Useful for auditing and per-call scoping. | Credential-free config pointing at a host proxy the sandbox can reach. The recommended sandboxed mode. | + +### Proxied: capability per connection type + +This is declared as data, not as switches spread through the code. + +| Connection | Proxied via | Status | +|---|---|---| +| `kubernetes` | `kubeproxy.Start`, then `WriteKubeconfig` (no user credentials) → `KUBECONFIG` | Supported | +| HTTP(S) `grants` (new tool field, the `Grant` shape) | The egress proxy (moved from `gitagent/proxy` to `pkg/credproxy`); `SandboxEnv` placeholders plus `HTTP_PROXY`/`HTTPS_PROXY`. HTTPS works through CONNECT, which the proxy terminates with a per-run CA that the tool trusts | Supported | +| `aws`, `gcp`, `azure` | No proxy exists | Refused with "use credentials: direct on placement: host" | + +### Placement: capability per sandbox kind + +This is data on the sandbox descriptor in `pkg/api/registry/sandboxes.go`: a new `ToolPlacements` field next to `Capabilities`. + +| Run sandbox | `host` | `sandbox` | +|---|---|---| +| off | ✓ | ✗ (there is no sandbox to place the tool in) | +| native | ✓ (the tool runs outside the provider's sandbox) | ✗ (provider-enforced; no wrapper) | +| docker | ✓ once G6 is fixed | ✓ once G6 is fixed (container `Wrap`) | +| git-agent | ✗ (inline tools are refused) | ✗ | + +Preflight refuses unsupported cells, naming the tool, the sandbox and the supported alternative. `captain sandbox matrix` (or the existing `captain permissions matrix`) prints the table. + +### Lifecycle + +The tool environment is prepared **once per run**, not per call: + +- `exectool.Workspace` becomes a run plugin. +- **PreRun**, ordered after setup: resolve connections, start proxies, write credential files into a private directory under `BaseDir` (not the workspace cwd), and resolve the wrapper. +- **Post at PhaseRun**: stop the proxies and remove the credential files. +- Each call then runs `shell.RunCmd` with the prepared env and the shared wrapper. + +## Phases + +### Phase 0: Stop the false claim (docs only) + +- [ ] `format.mdx`: state that inline tools run on the host with their declared credentials, whatever the sandbox, until placement lands. +- **Backwards compatibility:** no behavior change. + +### Phase 1: Declared fields and refusal matrix (G1, G7, G8) + +- [ ] `api.InlineTool`: `Placement`, `Credentials` enums with the derived-default rule; validation for `none` combined with declared credentials. +- [ ] `registry` sandbox descriptors: `ToolPlacements` data; `api.ToolEnvironmentSupport(sandboxKind, placement, credentials, connectionKinds)`, returning a reason when unsupported. +- [ ] `promptrun` preflight: check every inline tool against the resolved sandbox (`cfg.ResolvedSandbox()`) for every fallback candidate. +- [ ] `exectool`: `credentials: none` drops inherited connections and secret `envVars`. +- [ ] `captain lint promptfile`: warn on `direct` combined with `sandbox`. Inform when a tool uses `none`/`proxied` but the run's own `setup.connections` hand the same secrets to the agent anyway (G8). +- [ ] Tests: a matrix `DescribeTable` in `pkg/api`; refusal tests in `promptrun/preflight_callertools_ginkgo_test.go`. +- **Backwards compatibility:** the defaults reproduce today's behavior (`host`, plus `direct` when connections exist). The only newly refused case is `placement: sandbox`, which did not exist before. + +### Phase 2: Run-scoped tool environment (G4) + +- [ ] commons-db: add `Exec.CredentialsDir` (or a `SetupEnv` option) so connection files land outside `cmd.Dir`. Test that the workspace cwd stays clean. +- [ ] `exectool.Workspace`: becomes a PreRun + Post(PhaseRun) plugin. It prepares the env once and reuses it per call; `promptrun.Hooks` keeps it after setup. +- [ ] Test: the call count does not change the number of `.creds` directories, and cleanup runs at PhaseRun even when the run fails. +- **Backwards compatibility:** same env per call. Credential files move out of the workspace (a behavior improvement). + +### Phase 3: Proxied credentials, host placement (G5) + +- [ ] Move `kubeproxy` out of `pkg/ai/fixture` into a shared `pkg/credproxy/kube`. Fixtures and observe-capture import it from there; no copy is kept. +- [ ] Move `pkg/gitagent/proxy` to `pkg/credproxy` (no importers outside its own tests) and update the spec references. +- [ ] HTTPS: the proxy serves CONNECT for a granted `https` destination by terminating TLS itself: + - It mints a leaf certificate for the CONNECT host from a per-proxy CA. + - It then runs every request inside the tunnel through the same grant pipeline as plain HTTP: scope, misplaced-placeholder rejection, substitution, and upstream TLS validated against the granted host. + - CONNECT to an ungranted destination is refused (deny by default, as now). + - The CA's private key never leaves the proxy process. Only the CA certificate is written out, for the tool to trust. +- [ ] Add a `grants` field on `InlineTool` with the `Grant` shape. Values resolve through commons-db `types.EnvVar` (the same resolver as `envVars`). +- [ ] Workspace PreRun starts the needed proxies on `127.0.0.1` and exposes these to the tool: + - `KUBECONFIG`, `HTTP_PROXY`/`HTTPS_PROXY` (with `NO_PROXY=127.0.0.1,localhost` so the kube proxy stays direct), and the placeholder env. + - The CA bundle through `SSL_CERT_FILE`, `CURL_CA_BUNDLE`, `REQUESTS_CA_BUNDLE`, `NODE_EXTRA_CA_CERTS` and `GIT_SSL_CAINFO`. + - Real values never appear in the tool's env. +- [ ] Tests: + - A tool runs `kubectl`-free curl against a fake API server through the proxy, and its env contains no secret. + - A grant violation (wrong path or method) is refused and audited. +- **Backwards compatibility:** opt-in. + +### Phase 4: Sandbox placement on docker (G2, G3, G6) + +- [ ] commons-db: `wrapCommand` passes the wrapper only the declared env (dotenv, envVars, connection outputs), never the host allowlist. This mirrors captain's `declaredSetupEnv`. A nil env from the wrapper still runs with the full prepared env. +- [ ] `pkg/sandbox/adapter/container.go`: + - Add `--add-host host.docker.internal:host-gateway`. + - Expose a `HostAddress()` the run can advertise. + - Refuse a script cwd that is outside the mounted paths. +- [ ] `callertools`: bind an address the container can reach. Rewrite the advertised MCP URL to `host.docker.internal`. Pass the MCP config inline instead of as a host temp file. This makes host-placed tools work under docker too. +- [ ] Proxies listen on the same reachable address when the tool is placed in the sandbox. +- [ ] `promptrun`: resolve the run's sandbox once, then pass its `CommandWrapper` to `exectool` for `placement: sandbox` tools only. Host tools stay unwrapped. +- [ ] Tests: + - A `docker` gated integration test (skip when docker is unavailable): the tool runs in the container, sees the proxied `KUBECONFIG`, and cannot read a host credential path. + - An agent CLI in the container reaches the MCP endpoint. +- [ ] Docs: `format.mdx` and the sandbox docs get the matrix, and `sandboxes/index.mdx:76` drops its inaccurate `tokens` claim. +- **Backwards compatibility:** `Exec.Wrap` is unreleased, so its semantics can change freely. Caller tools under docker go from silently broken to working. + +## Open questions + +1. **Linux reachability.** On Docker Desktop, `host.docker.internal` reaches the host's loopback; on Linux, `host-gateway` resolves to the bridge IP, and services bound to `127.0.0.1` are unreachable. Should Phase 4 bind to the bridge gateway IP on Linux, or require Docker Desktop? +2. **Native confinement.** Should `placement: sandbox` under a native or off run be offered through the internal srt hook profile (no network, workspace-only writes)? That would give host runs a confined option without docker. It needs `srt.go:219` to accept arbitrary commands under the hook profile. +3. ~~**HTTPS grants.**~~ Resolved 2026-10-23: the proxy terminates CONNECT with a per-run CA (Phase 3). + +## Out of scope + +- git-agent placement: tools would need an MCP route back across the sidecar boundary. +- AWS/GCP/Azure proxying: this would need an STS/metadata-endpoint emulator. +- A spec-level `toolDefaults` block. +- The `captain serve` exposure: refusing `exec` tools over HTTP without a wrapper is already a separate follow-up. + +## Verification + +- Every phase runs focused `gavel test` / `go test` on `pkg/api`, `pkg/ai/tools/exectool`, `pkg/promptrun`, commons-db `shell`, and the new proxy package, followed by `make build` and lint on the touched packages. +- Smoke tests: + - `captain prompt run hack/inline-tool.prompt` with each mode on `--sandbox off`. Then the Phase 4 docker run on `--sandbox docker --model cli:sonnet`. + - Confirm the tool result, the absence of secrets in the tool's env (an `env` probe tool), and the refusal messages for unsupported cells. diff --git a/docs/plans/inline-tool-gitagent.md b/docs/plans/inline-tool-gitagent.md new file mode 100644 index 00000000..af42d8a7 --- /dev/null +++ b/docs/plans/inline-tool-gitagent.md @@ -0,0 +1,186 @@ +# Plan: inline tools for git-agent runs (`placement: supervisor | sidecar`, credential modes, least privilege) + +## Context + +A git-agent run moves the whole job onto an enrolled remote agent. Today such a run refuses inline tools, for four reasons: + +- The dispatch carries only `{prompt, system, model, mode, provider, effort, timeout}` (`pkg/gitagent/dispatch.go:23`). +- The sidecar's runner builds a bare request from that payload (`pkg/cli/gitagent_runtask.go:82`). +- On the supervisor, no caller-tool server runs, because no provider runs locally (`pkg/cli/ai_sandbox_remote.go:97`). +- `GitAgentSandbox.ToolPlacements` is empty (`pkg/api/registry/sandboxes.go:41`). + +**Goal:** the agent on the sidecar sees the prompt's tools as one MCP server. Each tool is placed in one of two ways: + +- **`placement: supervisor`**: it runs on the supervisor host. +- **`placement: sidecar`**: it runs on the sidecar host, next to the worktree. + +Each tool also declares where its credentials come from. The modes are listed in the matrix below, and every mode gives the tool the least it needs. + +**Facts this design relies on:** +- **The sidecar can already reach the supervisor.** It relays results by pushing to the supervisor's mailbox (`relay.go:177`), served over SSH by `git-agent serve --role mailbox` (`server.go`) or over HTTPS by `captain serve --tls` (`serve_git.go:77`). That route is authenticated by the sidecar's enrolled key or token, and the plan reuses it. +- **The SSH server only accepts exec sessions.** Its commands are `captain-enroll` and `git-receive-pack`, with no port forwarding (`server.go:96-111`). +- **`callertools` already serves MCP the way the agent needs.** It uses HTTP on loopback with a per-run bearer token, and applies approvals on every call (`pkg/ai/callertools/runtime.go`). On the sidecar, the agent CLI keeps talking to a local `callertools` (`StartCLI`, `cli.go:33`). +- **The agent and `run-task` share an OS user, and the agent inherits the sidecar's full environment.** `LaunchAgent` passes `ScrubGitEnv(os.Environ())` to the agent (`pkg/gitagent/workspace.go:110`). This drives most of the security review below. + +## Vocabulary + +**Placement:** each sandbox descriptor lists the placements it allows, in order, and the first entry is its default. +- Off and native: `[host]`. +- Git-agent: `[supervisor, sidecar]`. + +Any placement a descriptor doesn't list is refused, with an error naming the allowed values. + +**Credentials:** + +| mode | secret values come from | where the real values exist at run time | what the tool process sees | +|---|---|---|---| +| `none` | nowhere | nowhere | only static configuration | +| `direct` | the supervisor (or the host) | the supervisor tool's environment | real values | +| `proxied` | the supervisor (or the host) | a proxy on the supervisor | placeholders and the proxy's address | +| `sidecar` | the sidecar's own environment, files and cloud identity (IRSA, EKS pod identity, service account) | the sidecar tool's environment | real values | +| `sidecar-proxied` | fetched from the supervisor once and cached in `run-task` memory | a proxy inside the sidecar's `run-task` | placeholders and the proxy's address | + +**Allowed combinations:** + +| placement | none | direct | proxied | sidecar | sidecar-proxied | +|---|---|---|---|---|---| +| `host` / `sandbox` (local) | ok | ok | ok | refused | refused | +| `supervisor` (default) | ok | ok | ok | refused | refused | +| `sidecar` | ok | **refused**: secrets would cross to the sidecar | ok: the proxy stays on the supervisor and is reached through the tunnel | ok | ok | + +**Validation for the new modes** (`validateEnvironment`): +- **`sidecar`:** the tool's own `envVars`, `dotenv` and `connections` are allowed, unproxiable ones included, because the sidecar resolves them itself. Grants are refused. The supervisor never resolves these references. +- **`sidecar-proxied`:** grants are required. Secret `envVars` and any `connections` are refused, so v1 is HTTP(S) grants only; Kubernetes uses `proxied`. + +**Defaults:** a `sidecar` tool with secrets must state `credentials:` explicitly. A `supervisor` tool resolves as `host` does today. + +## Design + +``` +sidecar host (agent's OS user) supervisor host +agent CLI ──MCP──▶ callertools (run-task) + ├─ sidecar tool (none|sidecar) ─▶ exectool, env resolved on the sidecar + ├─ sidecar tool (sidecar-proxied) ─▶ exectool ─▶ credproxy in run-task ─▶ upstream + │ values from ══ "creds/" (once) ══╗ + ├─ sidecar tool (proxied) ─▶ exectool ─▶ forwarder ══ "egress|kube/" ══╣ tunnel(task, service) + └─ supervisor tool ─▶ MCP forwarder ════════════ "tools" ════════════════╣ SSH exec / HTTPS upgrade + mailbox serve: checks agent, task, ◀═════╝ + service, then splices to loopback ─▶ callertools / credproxy / + kubeproxy / creds service +``` + +## Security review (least privilege) + +The findings below are folded into the phases, and the phase that handles each one is in brackets. + +| # | Finding | Mitigation | +|---|---|---| +| S1 | **The agent inherits the sidecar's whole environment** (`workspace.go:110`). Every sidecar credential is already the agent's, so a `sidecar` tool would gain no isolation from the agent. | `LaunchAgent` passes an allowlist: system variables, provider auth for the selected runtime, and the `CAPTAIN_*` task variables. Everything else is resolved by `run-task` only for the tool that declares it. [P1] | +| S2 | **Same OS user, no isolation.** `run-task`, tool processes and the agent share a user. On Linux a same-user process can read `/proc//environ`, and everything on disk is readable unless the agent is confined: `task.json`, the sidecar key, the per-run CA, the tools' private directories. | The agent runs under the SRT/native policy with read access denied to the task state dir, the sidecar key and config dir, and every tool's private dir (`hostCredentialDenyRead`, `srt.go:316`, extended). Docs state the remaining guarantee plainly: `sidecar` and `sidecar-proxied` keep secrets out of the agent's environment and context, not out of a same-user process that escapes its confinement. Full separation needs a separate user or a container, which is a follow-up TODO. Lint warns on `sidecar`/`sidecar-proxied` when the agent isn't confined. [P1, P5] | +| S3 | **Proxies on loopback have no authentication.** Any local process can use a grant while the run lasts. This also applies to today's local `proxied` tools. | Each proxy gets a per-tool secret. credproxy requires `Proxy-Authorization`, carried in the proxy URL's userinfo (`http://tool:@127.0.0.1:port`). kubeproxy requires a bearer token from its own kubeconfig, and strips it before forwarding. [P2] | +| S4 | **The tunnel could become an SSRF primitive.** | `OpenService` splices only to loopback addresses taken from the 0600 `services.json` the supervisor run wrote, never to an address the client supplies. Opening requires: the authenticated agent equals the task's dispatched agent, the task has no verdict, and the service is registered. Every open is logged (task, service, agent). [P3] | +| S5 | **`sidecar-proxied` sends real secrets to the sidecar.** | The `creds/` service returns only the values of that tool's own grants, and only once (it deregisters after the read). Values are cached in `run-task` memory as `text.SensitiveString`, never written to disk or logs, and cleared on `Close`. The response is checked against the tool's declared grants. The supervisor logs which grant names were released. [P5] | +| S6 | **The MCP bearer token sits in `task.json`, which the agent can read if it isn't confined.** | Accepted: the token reaches only the tools this run already exposes, and the supervisor's `callertools` still applies approvals and the run's tool policy. The token is per run and revoked on close. [P4] | +| S7 | **The agent can use a grant without going through the tool's script.** It can reach the proxy or tunnel directly, under S2 and S3. | A grant's methods, paths and hosts are the real capability boundary, and the docs say so. Lint warns on a grant with no `methods` or with path `/` on a `readonly` tool. [P6] | +| S8 | **Each service lives longer than it needs to.** | Services are registered right before dispatch and removed when `AwaitOutcome` returns or the run is cancelled. `creds/*` is single-use. A grant's lifetime is the run's. [P3] | +| S9 | **Unattended approvals.** `run-task` has no approval broker. | A sidecar tool whose permission resolves to `ask` is refused on the supervisor before dispatch. Supervisor tools are approved by the supervisor's broker. The forwarding definitions on the sidecar are auto-approved only because the supervisor decides. [P4] | +| S10 | **The sidecar and supervisor could run different versions.** | `TaskPayload.Requires` (for example `"tools"`, `"sidecar-proxied"`), and `run-task` refuses any requirement it doesn't know. A sidecar whose serve process rejects `captain-tunnel` fails the run loudly. [P4] | + +## Phases + +### P1: vocabulary and the agent's environment +- [x] `pkg/api/registry/sandbox.go`: + - add `ToolPlacementSupervisor` and `ToolPlacementSidecar`; + - `Sandbox.ResolveToolPlacement` replaces `ToolPlacement.Effective`; + - `ValidateToolPlacement` names the allowed values. + + `sandboxes.go`: GitAgent allows `[supervisor, sidecar]`. +- [x] `pkg/api/inline_tool_environment.go`: + - add `ToolCredentialsSidecar` and `ToolCredentialsSidecarProxied`; + - apply the allowed-combinations matrix and the validation rules above; + - update `ResolveCredentials`. + + Callers of `Effective()` move over: `promptrun/inline_tools.go`, `exectool/workspace.go`, `pkg/ai/prompt/validate.go`. +- [x] S1, implemented in `run-task`, not `LaunchAgent`: `LaunchAgent` starts `run-task`, which needs the sidecar's environment to resolve `credentials: sidecar` tools. Deviation: there is no process split. Once the tools' environments are prepared, `scrubAgentEnv` (`gitagent_runtask_tools.go`) reduces `run-task`'s own environment to `keepAgentEnv`, and every backend's agent inherits that. `keepAgentEnv` covers system variables, `CAPTAIN_*`, and every provider's `EnvVars`. The scrub runs only when a sidecar tool holds credentials, so tasks without such tools are unchanged. +- [x] S2, implemented in P5. The worktree lives inside the task state dir (`/captain/tasks//worktree`), so `agentDenyRead` denies specific paths: `task.json`, the tools dir, the captain config, and the host, agent and dispatch keys, token, TLS key and relay key/token. When `denyRead` is set, the run is forced to native with `DeniedReadRoots`. This also fixed a gap: a `sandbox: off` provider option used to override `req.Sandbox`, so run-task agents ran unsandboxed. Only native Claude enforces this. Codex rejects `deniedReadRoots` (`sandbox_codex.go:155`), so such a task fails when it launches a Codex agent. +- [x] Tests: matrix tables in the placement and credential suites; `keepAgentEnv` and the confinement/Claude translation in `gitagent_runtask_test.go`. Not done: an e2e dump of the agent's environment. +- **Backwards compatibility:** local placements are unchanged. Deviation: the `agentEnv` passthrough option was dropped, because the scrub applies only to tasks with credentialed sidecar tools, which are new. + +### P2: authenticated proxies (S3) +- [x] `credproxy.Proxy.Secret`, checked on every request and CONNECT. A request without the matching `Proxy-Authorization` gets 407, and the header never reaches upstream. `credproxy.ProxyURL(addr, secret)` and `credproxy.NewSecret()`. +- [x] `kubeproxy.Start(Options{Kubeconfig, Token})`. The package-level `WriteKubeconfig(dir, Endpoint{URL, Token})` writes the token, which the proxy requires and strips. The fixture and observe-capture kube proxies get tokens too. +- [x] `exectool/proxied.go` splits into `serveProxies` / `ServeEgressProxy` (where the secrets are) and `ProxiedEnv(dir, ProxyEndpoints, grants)` (the tool's environment). Local tools call both halves. +- [x] Tests: 407 without or with the wrong secret (plain and CONNECT), the secret never reaching upstream, a 401 kube proxy without its token, the kubeconfig carrying only the proxy token, and a tool's `curl` without the userinfo getting 407. The existing suites pass. +- **Backwards compatibility:** internal only. Tool scripts get the same environment variable names, and only the URL gains userinfo. + +### P3: the tunnel (S4, S8) +Done. Liveness differs from the first draft: a tunnel is refused once the services are withdrawn, not once a verdict exists, because a rejected attempt is retried and still needs its tools. `Dispatch` registers the services with the task state (`DispatchRequest.Services`) and withdraws them itself if the push fails; the client half is `tunnel_client.go`, and SSH dialing is shared with the git transport (`dialSSH`). + +- [x] `pkg/gitagent/tunnel.go`: + - `WriteServices`, `ReadServices` and `RemoveServices`, kept beside the task state; + - `OpenService(repo, identity, task, service)`, which applies the S4 checks, dials only loopback, and logs every open; + - `DialService(ctx, TransportTarget, task, service)`, which reuses the relay transport; + - `ServeForwarder`. +- [x] `server.go`: a `captain-tunnel ` exec command. `httpserver.go`: an `Upgrade: captain-tunnel` route. Both go through `OpenService`. +- [x] Tests (`tunnel_ginkgo_test.go`, 14 specs): + - an echo service round-trips over SSH and HTTPS; + - refused for: unknown task, another agent, unregistered service, non-loopback entry; + - refused once `RemoveServices` withdraws the services. +- **Backwards compatibility:** additive. An older serve process fails the run loudly (S10). + +### P4: `placement: supervisor` (S6, S9, S10) +- [x] `api.RemoteExecutor.Execute(ctx, spec, RemoteExecOptions{CallerTools, CredentialReleases, ToolProxies})`. `gitAgentSandbox.Execute` registers the services through `Dispatch` and removes them after `AwaitOutcome`. +- [x] `remoteExecProvider.Execute` (`ai_sandbox_remote.go`) starts `callertools.StartCLI` with the run's final config. `promptrun.Input.Relocated` builds the provider from the final config. +- [x] `TaskPayload.Tools{Name, Path, Headers}` and `Requires` with `CheckRequirements`. +- [x] `run-task`: without sidecar tools, the forwarded endpoint goes straight into `cfg.CallerTools`. With sidecar tools, `callertools.Forward` lists the supervisor's tools and each forwarding definition sits beside the sidecar's in `cfg.Tools`. +- [x] Tests: payload requirements in `gitagent_runtask_test.go`; e2e `TestDispatchServesSupervisorToolsToTheAgent`. Not done: an e2e `ask` tool decided by the supervisor broker. +- **Backwards compatibility:** runs without tools send no new fields. `Requires` guards against older runners from this release on. + +### P5: `placement: sidecar` with `none`, `sidecar` and `sidecar-proxied` (S2, S5) +- [x] `promptrun.bindInlineTools`: only supervisor tools are bound locally. `checkSidecarTools` refuses `ask` and `direct` sidecar tools and records each tool's resolved credentials mode on the spec. The adapter ships the declarations with grant header values stripped (`withoutGrantValues`). +- [x] `run-task` builds an `exectool.Workspace` (cwd = worktree, `PrivateRoot` = `/tools`) and calls `Prepare` before the agent starts: + - **`none`:** static configuration only. + - **`sidecar`:** the tool's own `envVars`, `dotenv` and `connections`, resolved on the sidecar. + - **`sidecar-proxied`:** `ReleaseGrants` fetches `creds/` once (`FetchGrantRelease` checks it against the declaration), then `ServeEgressProxy` runs with the values in memory. +- [x] Supervisor: `exectool.ServeGrantRelease`, a single-use, bearer-protected release for each `sidecar-proxied` tool. +- [x] The tools dir is in the agent's deny-read list. +- [ ] Lint warning for `sidecar`/`sidecar-proxied` with an unconfined agent. Not done; run-task forces native confinement, so only Codex is affected, and it fails loudly at launch. +- [x] Tests: `exectool/sidecar_ginkgo_test.go`, `release_ginkgo_test.go`, promptrun preflight refusals, and e2e `TestDispatchRunsSidecarToolsBesideTheAgent` (placeholder, authenticated proxy, no grant value anywhere on the sidecar). The e2e's prompt lives outside the repo, because the dispatch ships the dirty worktree. +- **Backwards compatibility:** new modes only. + +### P6: `proxied` for sidecar tools, and docs +- [x] `remoteExecProvider` runs `exectool.ServeToolProxies` for each `proxied` sidecar tool. The adapter registers `egress/` and `kube/` and ships `TaskSidecarTools.Proxies` (service names, egress secret, CA certificate, kube token), with the tool's connections stripped. `run-task` forwards both services (`forwardToolProxies`) and the workspace's `SupervisorProxies` points `ProxiedEnv` at them. +- [x] Tests: `exectool/sidecar_ginkgo_test.go` (kube through the supervisor's proxy, nothing inherited, relay closed with the environment); `adapter/gitagent_sidecar_tools_test.go` (services, payload free of grant values and the kubeconfig); promptrun records resolved modes; e2e `TestDispatchProxiesSidecarToolsThroughTheSupervisor`. +- [ ] S7 lint: warn on a grant with no `methods` or with a catch-all path on a `readonly` tool. Not done. +- [x] `format.mdx`: placements per sandbox, the credential matrix, "what each mode protects against", and same-release upgrades. The tunnel diagram was left out. +- [ ] Update `docs/plans/inline-tool-environment.md`. Not done. +- [ ] File TODOs for: + - running the agent under a separate user or in a container on the sidecar (S2); + - git-agent's unimplemented `ProvidesEgressProxy` claim for the agent's own traffic. + +## Critical files +- `pkg/api/registry/{sandbox.go,sandboxes.go}` +- `pkg/api/{sandbox.go,inline_tool_environment.go}` +- `pkg/gitagent/{tunnel.go (new),server.go,httpserver.go,workspace.go,dispatch.go}` +- `pkg/cli/{serve_git.go,ai_sandbox_remote.go,gitagent_runtask.go}` +- `pkg/sandbox/adapter/{gitagent.go,srt.go}` +- `pkg/promptrun/{inline_tools.go,preflight_callertools.go}` +- `pkg/ai/tools/exectool/{proxied.go,workspace.go}` +- `pkg/credproxy/{proxy.go,connect.go,kubeproxy/proxy.go}` +- `pkg/ai/prompt/validate.go` + +Reused as-is: `callertools.New` / `StartCLI`, the relay `TransportTarget` and clients (`sshclient.go`, `httpclient.go`), `credproxy.Authority`/`SandboxEnv`, the `exectool.Workspace` lifecycle, and commons-db `shell.SetupEnv` for `sidecar` resolution. + +## Verification +1. `go test ./pkg/api/... ./pkg/credproxy/... ./pkg/gitagent/... ./pkg/ai/tools/exectool/... ./pkg/ai/prompt/... ./pkg/sandbox/...`. Then `pkg/promptrun` and the `pkg/cli` git-agent e2e tests with the sandbox disabled. +2. `make build`, and `make lint` on the touched packages. +3. Live smoke: local mailbox and sidecar `git-agent serve` processes, over SSH and then over HTTPS, running `hack/inline-tool-gitagent.prompt`. That prompt has four tools: + - a supervisor tool writing a marker file; + - a `sidecar` tool echoing a sidecar-only variable; + - a `sidecar-proxied` httpbin `/headers` tool; + - a `proxied` sidecar httpbin tool. + + Pass criteria: + - all four tools succeed; + - `rg` finds no secret value in the agent's worktree, `task.json`, `agent.*.log` or the agent's environment dump; + - a direct `curl` from the agent to a proxy without the secret gets 407. diff --git a/docs/plans/unified-approval-callback-examples.md b/docs/plans/unified-approval-callback-examples.md index 351099a7..20fa8b2e 100644 --- a/docs/plans/unified-approval-callback-examples.md +++ b/docs/plans/unified-approval-callback-examples.md @@ -1,5 +1,7 @@ # Unified approval callback: request examples +These are design-time evidence and protocol examples, not a current runtime capability catalog. Findings labelled G19/G20 describe the pre-migration implementation. See [Approvals](../src/pages/agents/approvals.mdx) for current behavior and migration guidance. + This is a companion to [unified-approval-callback.md](unified-approval-callback.md). It shows how each approval kind reaches `Config.OnApproval`: - the native request as it arrives diff --git a/docs/plans/unified-approval-callback.md b/docs/plans/unified-approval-callback.md index 8174bce0..7a31f6a9 100644 --- a/docs/plans/unified-approval-callback.md +++ b/docs/plans/unified-approval-callback.md @@ -1,5 +1,7 @@ # Unified approval callback +This is the design and implementation record, including rollout checklists and deferred removal work. For the current public contract, broker fields and terminal behavior, see [Approvals](../src/pages/agents/approvals.mdx). Historical findings below describe the state observed during the design review. + ## Summary Extend Captain's existing `CanUseTool` callback in place, so that one callback carries execution approvals, clarification questions, and MCP elicitation, and give it a name that says so. diff --git a/docs/pnpm-lock.yaml b/docs/pnpm-lock.yaml index a64c7fef..bcfa3aa5 100644 --- a/docs/pnpm-lock.yaml +++ b/docs/pnpm-lock.yaml @@ -22,8 +22,8 @@ importers: specifier: ^6.0.1 version: 6.0.1(@types/react-dom@18.3.7(@types/react@18.3.31))(@types/react@18.3.31)(esbuild@0.28.1)(jiti@2.7.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(yaml@2.9.0) '@flanksource/clicky-ui': - specifier: 0.3.51 - version: 0.3.51(@ai-sdk/react@3.0.264(react@18.3.1)(zod@4.4.3))(@babel/core@7.29.7)(@babel/template@7.29.7)(@mdxeditor/editor@4.0.4(@codemirror/language@6.12.4)(@lezer/highlight@1.2.3)(@types/react-dom@18.3.7(@types/react@18.3.31))(@types/react@18.3.31)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(yjs@13.6.31))(@shikijs/langs@1.29.2)(@shikijs/themes@1.29.2)(@shikijs/transformers@1.29.2)(@tanstack/react-query@5.101.2(react@18.3.1))(@types/react@18.3.31)(ai@6.0.219(zod@4.4.3))(marked@15.0.12)(monaco-editor@0.56.0)(react-dom@18.3.1(react@18.3.1))(react-rnd@10.5.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1)(recharts@3.9.1(@types/react@18.3.31)(react-dom@18.3.1(react@18.3.1))(react-is@17.0.2)(react@18.3.1)(redux@5.0.1))(shiki@1.29.2)(streamdown@2.5.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(tailwindcss@4.3.2) + specifier: 0.3.56 + version: 0.3.56(@ai-sdk/react@3.0.264(react@18.3.1)(zod@4.4.3))(@babel/core@7.29.7)(@babel/template@7.29.7)(@mdxeditor/editor@4.0.4(@codemirror/language@6.12.4)(@lezer/highlight@1.2.3)(@types/react-dom@18.3.7(@types/react@18.3.31))(@types/react@18.3.31)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(yjs@13.6.31))(@shikijs/langs@1.29.2)(@shikijs/themes@1.29.2)(@shikijs/transformers@1.29.2)(@tanstack/react-query@5.101.2(react@18.3.1))(@types/react@18.3.31)(ai@6.0.219(zod@4.4.3))(marked@15.0.12)(monaco-editor@0.56.0)(react-dom@18.3.1(react@18.3.1))(react-rnd@10.5.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1)(recharts@3.9.1(@types/react@18.3.31)(react-dom@18.3.1(react@18.3.1))(react-is@17.0.2)(react@18.3.1)(redux@5.0.1))(shiki@1.29.2)(streamdown@2.5.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(tailwindcss@4.3.2) '@mdxeditor/editor': specifier: ^4.0.4 version: 4.0.4(@codemirror/language@6.12.4)(@lezer/highlight@1.2.3)(@types/react-dom@18.3.7(@types/react@18.3.31))(@types/react@18.3.31)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(yjs@13.6.31) @@ -693,8 +693,8 @@ packages: cpu: [x64] os: [win32] - '@flanksource/clicky-ui@0.3.51': - resolution: {integrity: sha512-NDRsAMVDMRaudpplel80EWzxmN35ZJatfY3wqAWojVGPDDEaqifU1ELR7StQwdb51753BXt9CdO3KIypsPgSoQ==} + '@flanksource/clicky-ui@0.3.56': + resolution: {integrity: sha512-aJQlPG2ZzNoG8h1MqdcNBDCi+MlrCTvalykZtAFHByJnLnXald9DDJbVt93dEUb9jMPZo/v2rmAvrjnU+0tykA==} peerDependencies: '@ai-sdk/react': ^3.0.0 '@mdxeditor/editor': ^4.0.4 @@ -734,8 +734,8 @@ packages: streamdown: optional: true - '@flanksource/icons@1.0.63': - resolution: {integrity: sha512-QJ3N49jltwT4xJVvajr/6V++LqTEYKGamjtLA+2NNECDG8I/guhgH3l984rIoE4+dkYTrUPwvoUh4SiKLic8FQ==} + '@flanksource/icons@1.0.65': + resolution: {integrity: sha512-Z8EW8V0c4YJWs529wS3RNrN/1Q65eYgxqrkln3djUzBLg3acfHLYUGmXoSBQnPXQSGO4No+2wr9uLVsnE53wlA==} peerDependencies: react: '*' @@ -4836,7 +4836,7 @@ snapshots: '@esbuild/win32-x64@0.28.1': optional: true - '@flanksource/clicky-ui@0.3.51(@ai-sdk/react@3.0.264(react@18.3.1)(zod@4.4.3))(@babel/core@7.29.7)(@babel/template@7.29.7)(@mdxeditor/editor@4.0.4(@codemirror/language@6.12.4)(@lezer/highlight@1.2.3)(@types/react-dom@18.3.7(@types/react@18.3.31))(@types/react@18.3.31)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(yjs@13.6.31))(@shikijs/langs@1.29.2)(@shikijs/themes@1.29.2)(@shikijs/transformers@1.29.2)(@tanstack/react-query@5.101.2(react@18.3.1))(@types/react@18.3.31)(ai@6.0.219(zod@4.4.3))(marked@15.0.12)(monaco-editor@0.56.0)(react-dom@18.3.1(react@18.3.1))(react-rnd@10.5.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1)(recharts@3.9.1(@types/react@18.3.31)(react-dom@18.3.1(react@18.3.1))(react-is@17.0.2)(react@18.3.1)(redux@5.0.1))(shiki@1.29.2)(streamdown@2.5.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(tailwindcss@4.3.2)': + '@flanksource/clicky-ui@0.3.56(@ai-sdk/react@3.0.264(react@18.3.1)(zod@4.4.3))(@babel/core@7.29.7)(@babel/template@7.29.7)(@mdxeditor/editor@4.0.4(@codemirror/language@6.12.4)(@lezer/highlight@1.2.3)(@types/react-dom@18.3.7(@types/react@18.3.31))(@types/react@18.3.31)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(yjs@13.6.31))(@shikijs/langs@1.29.2)(@shikijs/themes@1.29.2)(@shikijs/transformers@1.29.2)(@tanstack/react-query@5.101.2(react@18.3.1))(@types/react@18.3.31)(ai@6.0.219(zod@4.4.3))(marked@15.0.12)(monaco-editor@0.56.0)(react-dom@18.3.1(react@18.3.1))(react-rnd@10.5.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1)(recharts@3.9.1(@types/react@18.3.31)(react-dom@18.3.1(react@18.3.1))(react-is@17.0.2)(react@18.3.1)(redux@5.0.1))(shiki@1.29.2)(streamdown@2.5.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(tailwindcss@4.3.2)': dependencies: '@codemirror/autocomplete': 6.20.3 '@codemirror/commands': 6.10.4 @@ -4845,7 +4845,7 @@ snapshots: '@codemirror/language': 6.12.4 '@codemirror/state': 6.7.0 '@codemirror/view': 6.43.4 - '@flanksource/icons': 1.0.63(react@18.3.1) + '@flanksource/icons': 1.0.65(react@18.3.1) '@floating-ui/react': 0.27.19(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@monaco-editor/react': 4.7.0(monaco-editor@0.56.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@radix-ui/react-compose-refs': 1.1.3(@types/react@18.3.31)(react@18.3.1) @@ -4882,7 +4882,7 @@ snapshots: - '@babel/template' - '@types/react' - '@flanksource/icons@1.0.63(react@18.3.1)': + '@flanksource/icons@1.0.65(react@18.3.1)': dependencies: react: 18.3.1 diff --git a/docs/src/components/PromptApiShapes.tsx b/docs/src/components/PromptApiShapes.tsx index 904deaa0..9fbb57ca 100644 --- a/docs/src/components/PromptApiShapes.tsx +++ b/docs/src/components/PromptApiShapes.tsx @@ -60,6 +60,8 @@ const renderResult = { system: "You are a commit message generator. Analyze the diff below and produce a Conventional Commit message.", validationError: "", input: { + model: "claude-sonnet-4-6", + mode: "agent", prompt: { source: "commit.prompt", user: "DIFF INPUT:\\n\\n...\\n\\nREQUIREMENTS:\\n- type: one of feat|fix|perf|refactor|test|docs|build|ci|chore|revert\\n...", @@ -80,7 +82,7 @@ export default function PromptApiShapes() {
- /api/v1/prompts + /api/v1/prompt
} title="Prompt runtime" eyebrow="docs example" /> diff --git a/docs/src/data/navigation.ts b/docs/src/data/navigation.ts index d1319016..e39dfc7d 100644 --- a/docs/src/data/navigation.ts +++ b/docs/src/data/navigation.ts @@ -31,6 +31,12 @@ export const docSections: DocSection[] = [ description: "Prompt engine responsibilities and data flow.", status: "ready", }, + { + label: "Prompt CLI", + href: "/prompts/cli/", + description: "Commands, examples, help, color, and structured output.", + status: "ready", + }, { label: "Prompt Format", href: "/prompts/format/", @@ -116,31 +122,37 @@ export const docSections: DocSection[] = [ ], }, { - label: "Next Sections", + label: "Reference", items: [ { label: "Serve", href: "/serve/", description: "Embedded API and web UI.", - status: "stub", + status: "ready", }, { label: "Sessions", href: "/sessions/", description: "Claude and Codex history surfaces.", - status: "stub", + status: "ready", }, { label: "Configuration", href: "/configuration/", description: "Saved defaults and runtime toggles.", - status: "stub", + status: "ready", }, { label: "Fixtures", href: "/fixtures/", description: "Benchmark fixtures and evidence reports.", - status: "stub", + status: "ready", + }, + { + label: "Sandboxes", + href: "/sandboxes/", + description: "Isolation, container images, git-agent workers and credentials.", + status: "ready", }, ], }, diff --git a/docs/src/pages/agents/approvals.mdx b/docs/src/pages/agents/approvals.mdx index 5e137f83..903cf912 100644 --- a/docs/src/pages/agents/approvals.mdx +++ b/docs/src/pages/agents/approvals.mdx @@ -37,6 +37,24 @@ Two rules apply to every callback: - **Deny is a hard floor.** A tool the run's permission strategy denies, and anything plan mode forbids, is rejected before `OnApproval` runs. No row is written and no event is sent, and no decision, scope, or grant can override it. - **Any approval may escalate.** An approved `command`, `filesystem`, `network`, or `permissions` request can go beyond the run's initial sandbox posture. `Escalates` marks the ones that do. +### Read-only runs have no escalation path + +`permissions.access: read-only` is compiled so that no approval can grant a write, whatever the broker answers. On claude, the edit, write, shell and sub-agent tools are denied, so the deny floor rejects them before `OnApproval` runs. On codex, the sandbox is `read-only` and the approval policy is `never`, so codex never raises a `command`, `filesystem` or `permissions` request. The codex app-server keeps an authored `mode: plan` instead, because plan mode already refuses every escalation. On gemini the run uses the `plan` approval mode, which the gemini client enforces itself. Caller tools are outside the contract and still follow `toolPolicy` and the broker. See [Portable access](/prompts/runtime/#portable-access) for the full per-runtime table. + +## Foreground terminal runs + +A single-runtime `captain prompt run` using Claude Agent or Codex app-server attaches `approval.Terminal` when stdin and stderr are terminals. Native questions and permission requests draw on stderr and read answers from stdin. The event renderer pauses while a form is open, and execution resumes with the selected answer. + +```sh +captain prompt run --model agent:haiku --edit -p "Inspect the project and ask through the question tool if a required decision is missing." +``` + +Redirecting stdout preserves the answer channel, including JSON output. `--no-stream` also permits terminal questions. Piped input, redirected stderr, and concurrent multi-model comparisons have no terminal broker. Explicit Claude `bypassPermissions` keeps that permission mode and disables terminal questions. + +Both agent runtimes disable their native question tool when no broker exists. Codex permits blocking questions in plan mode; default mode keeps questions disabled because its native questions are nonblocking. When questions are unavailable, instructions require the agent to complete independently within the authorized scope or report an unresolved blocker without asking questions. When available, instructions require the native question tool and an answer before continuing. These instructions preserve the prompt's response format; they do not classify arbitrary final prose as a question. + +HTTP runs use their host's configured broker and never inherit the server process's terminal. An explicitly supplied `Config.OnApproval` callback remains authoritative. Answered or refused native question calls are resolved by their tool-call IDs; an outstanding native question cannot make a foreground run succeed. + ## Migrating from `CanUseTool` The approval callback was renamed and widened. The old names remain as deprecated aliases until the unified-approval Phase 6. @@ -77,15 +95,15 @@ type Broker struct { CredentialID uuid.UUID RequestedBy string // who raised it, e.g. "provider" or "caller_tool" - Timeout time.Duration // approval expiry; required + Timeout time.Duration // longest unanswered wait; required Poll time.Duration // re-read interval; DefaultPoll (100ms) when zero + Deadline time.Time // optional run deadline; bounds expiry alongside Timeout // Notify surfaces the EventPermission frame; required. Notify func(context.Context, api.Event) error - // OnWaiting / OnRunning bracket the wait with the host's own state transitions. - OnWaiting func(context.Context) error - OnRunning func(context.Context) error + // The broker owns waiting/running transitions; hosts can mirror the updated row. + OnRunState func(context.Context, *database.PromptRun) error // ClaimToolUseID resolves a locally generated tool-use ID onto the provider's // own tool-call ID. Required only when a caller can set ToolUseIDGenerated. @@ -95,9 +113,11 @@ type Broker struct { `Validate()` refuses to broker anything without a database, a session ID, a prompt run ID, a `Notify` callback, and a positive `Timeout`. -## `Notify`, `OnWaiting` / `OnRunning` +## `Notify` and `OnRunState` + +`OnApproval` records a pending approval idempotently, holds its prompt run in `waiting`, sends `Notify` an `EventPermission` frame, and blocks. The broker owns the waiting/running transitions; `OnRunState` optionally mirrors each updated prompt-run row into the host. A host does not write those transitions itself. Concurrent approvals keep the run waiting until the last hold is released. Cleanup releases the hold even when the calling context was cancelled. -`OnApproval` (the `ApprovalFunc`) records the pending approval idempotently, calls `Notify` with the `EventPermission` frame, and blocks. `OnWaiting` and `OnRunning` bracket that wait with the host's own state: once the host has been told the run is waiting, **every** way out of `OnApproval` tells it the run is running again — a cancelled caller resumes on a context with cancellation stripped (`context.WithoutCancel`), because ending the wait is the response to the cancellation, not a victim of it. A credential-less (provider or host) approval depends on `OnWaiting`: the store only resolves such an approval while its prompt run is in the `waiting` state. +`Timeout` bounds the unanswered wait; `Deadline`, when supplied, also bounds expiry by the run's own deadline. A credential-less provider/host approval can resolve only while its prompt run is `waiting`. Secret questions cannot use this durable broker because answers would be stored as plain JSON; a host that can handle a secret must use a direct callback. ## The provider path: no turn, no model call diff --git a/docs/src/pages/agents/embedding.mdx b/docs/src/pages/agents/embedding.mdx index ce4231e3..76d4899a 100644 --- a/docs/src/pages/agents/embedding.mdx +++ b/docs/src/pages/agents/embedding.mdx @@ -11,13 +11,16 @@ import CodeExample from "../../components/CodeExample.tsx"; `pkg/promptrun.Run` executes one resolved prompt spec through captain's generate→verify loop: attachment checks, provider construction, tool-policy enforcement, the workflow's commit and verify hooks, the caller's own hooks, the setup plugin, and finally `agent.Runner`. It is the seam `captain prompt run` and an embedding host (gavel's todo lifecycle) share, so the two never assemble the same pieces by hand and drift. -What stays with the caller: rendering the prompt and resolving its spec, resolving attachments against a store, persisting the run, and streaming events to whoever is watching (`OnEvent` is the tap for that). +The caller renders and resolves the spec, prepares attachments against a store, and consumes events through `OnEvent`. Captain owns persistence when `Input.Record` is set; the host links its own rows through `Recording.Link` rather than writing Captain's tables. ## `Input` - @@ -37,6 +41,8 @@ type Input struct { ## Timeout rule +Call `promptrun.Preflight(input)` before dispatch to check the same resolved request that `Run` will admit. It validates declarations, attachments, deadlines, model selection, runtime policies, judge prompt files, verifier registration and commit ownership without constructing a provider or running setup. Log its returned warnings separately from fatal errors. `Run` applies configured prompt-context hooks before admission and repeats its admission checks before execution. + -- **`commands`** (`[]string`) — shell commands run as pass/fail checks (exit 0 = pass); their output tail becomes the re-run feedback. This is the only part of `verify` captain itself executes, via `agent/verify.CmdVerifier`. +- **`commands`** (`[]string`) — shell commands run as pass/fail checks (exit 0 = pass); their output tail becomes the re-run feedback, via `agent/verify.CmdVerifier`. Captain also executes LLM judges; fixture evaluation belongs to the registered runner. - **`fixture`** (`string`) — a clicky-FixtureEditor markdown document (acceptance criteria / LLM-judge checklist). Captain does not implement a fixture engine; it dispatches this document to whatever claimed the `fixture` kind. - **`prompts`** (`[]string`) — `.prompt` template paths run as LLM-judge checks. Each renders against the run's context and must yield `{ok, reason, feedback}` (`agent/verify.LLMJudgeVerifier`). A judge prompt **cannot** declare its own `sandbox` or a `model` different from the run's provider — both are hard validation errors, not a silent downgrade. - **`scope`** (`""` \| `all` \| `changed`) — narrows verification to the agent's changed files instead of the whole tree. @@ -96,7 +96,7 @@ The contract fails loudly rather than guessing a verdict: | Runner behavior | Result | | --- | --- | -| Exits 0 with exactly one `report` line | The verdict. A failing fixture is still a verdict (the runner exits non-zero for it and the report says `passed: false`). | +| Exactly one valid `report` line, with exit 0 or nonzero | The report's verdict; a failed fixture can exit nonzero and still supply `passed: false`. | | Non-zero exit with no `report` line | Error: `"...exited N with no report line"`, plus the process error (e.g. a missing binary) and the stderr tail. | | More than one `report` line | Error: `"emitted more than one report line"`. | | Malformed JSON on a line | Error naming the malformed line (truncated to 200 bytes). | @@ -140,7 +140,7 @@ A running check can report where it has got to before it has a verdict, at up to `captain verify` runs a workflow's checks against a working tree without spending a generation on it — the same checks the loop votes with, driven out of the generate→verify loop: diff --git a/docs/src/pages/configuration/index.mdx b/docs/src/pages/configuration/index.mdx index 13ec22d4..0e1de04b 100644 --- a/docs/src/pages/configuration/index.mdx +++ b/docs/src/pages/configuration/index.mdx @@ -1,11 +1,70 @@ --- layout: ../../layouts/DocsLayout.astro title: Configuration -description: Placeholder for Captain configuration documentation. -section: Next Sections +description: Saved runtime defaults, credentials, prompt sources, and verification configuration. +section: Reference --- # Configuration -This section is scaffolded for `captain configure`, `~/.captain.yaml`, provider defaults, prompt directories, memory toggles, and safety defaults. +Captain reads saved defaults from `~/.captain.yaml`. Run `captain configure` for the interactive wizard, or select a provider to save its runtime defaults or credentials. Explicit request values take precedence over saved defaults. + +## Configure a runtime + +```sh +captain configure +captain configure openai --mode agent --model gpt-6.1-sol --effort high --active +captain configure anthropic --mode agent --model sonnet --effort default +captain whoami --models=false +``` + +`--active` selects the provider used by flagless runs. `--effort default` clears the explicit effort so the model's catalog default can apply. A runtime is a model and a mechanism (`api`, `agent`, `cli`, `cmux`); the provider family is derived from the model. Each fallback uses defaults for its own provider. `--backend` and `configure --agent` have been replaced by `--mode`. + +```yaml +# ~/.captain.yaml +ai: + defaultProvider: openai + providers: + openai: + mode: agent + model: gpt-6.1-sol + reasoningEffort: high + timeout: 20m +prompts: + dirs: [~/prompts] +runtime: + presetDirs: [~/captain-presets] +chat: + presets: [Plan] +verify: + fixtureRunner: [gavel, fixtures, run, --format, captain-verify-report] +``` + +The `ai` block also supports `budgetUSD`, `maxTokens`, `temperature`, `noCache`, `noMCP`, `noHooks`, `noSkills`, `noUser`, `noProject` and `noMemory`. Defaults fill missing fields after authored layers have been composed; intentional zero or false values remain explicit. See [Runtime overlay](/prompts/runtime/) for layer order, restrictive budgets and provenance. + +## Provider credentials + +```sh +captain configure openai +captain configure openai --test +captain configure anthropic +``` + +With no runtime-default flags, selecting an API provider opens a secure token prompt. Captain validates the token against that provider before saving it in `~/.config/captain/vault`; `--test` validates without writing. Explicit runtime keys take precedence over the vault, then environment variables. Local agent runtimes use their CLI's own login. The `/whoami` page exposes token validation and runtime defaults without displaying stored tokens. + +## Sources and presets + +Prompt sources include embedded examples, configured directories, server `--prompt-dir` directories, project `.captain/prompts`, and the user config prompt directory. Local names shadow embedded names; conflicting local names require an explicit path or ID. See [Sources and API](/prompts/sources-api/) for discovery and write destinations. + +Select runtime presets in frontmatter with `presets: [Plan]`, with repeated `--preset` flags, or through the runtime editor. `--no-presets` clears the selection. `runtimeProfile` and `--runtime-profile` are deprecated and ignored. Built-in presets can be overridden by a local preset of the same name; see [Built-in runtime presets](/prompts/runtime/#built-in-runtime-presets). + +## Database contexts + +`captain serve` keeps sessions, prompt runs, approvals and catalogs in PostgreSQL. `--db-url URL` chooses the default database; repeated `--db-url name=URL` entries declare additional read-only contexts. `--context name` chooses the read context. Check the server's startup database identity before inspecting a different context. + +## Output and diagnostics + +`--json`, `--yaml`, `--markdown`, or `--format` select command result formats. `captain prompt --help` and child help use color on a human terminal, plain output with `--no-color`, `NO_COLOR`, or redirection, and Markdown in detected agent sessions. These help rules are independent of the result format. + +Increase verbosity with `-v` for HTTP access lines, `-vv` for headers/query, `-vvv` for request bodies, and `-vvvv` for response bodies. Credentials are redacted. `-Phttp.har=.tmp/captain.har` records a HAR archive; `-Phttp.har.level=metadata` excludes bodies. Root `captain --help` describes the inherited HTTP and logging properties. diff --git a/docs/src/pages/fixtures/index.mdx b/docs/src/pages/fixtures/index.mdx index 1eee98a1..041c0533 100644 --- a/docs/src/pages/fixtures/index.mdx +++ b/docs/src/pages/fixtures/index.mdx @@ -1,11 +1,61 @@ --- layout: ../../layouts/DocsLayout.astro title: Fixtures -description: Placeholder for Captain fixture documentation. -section: Next Sections +description: Claude configuration benchmarks, runtime observations, and verification fixtures. +section: Reference --- # Fixtures -This section is scaffolded for AI fixture benchmarks, repeat runs, artifact capture, direct-vs-MCP comparisons, and evidence reports. +Captain provides two measurement surfaces: `ai fixture` compares Claude CLI configurations, while `prompt observe` captures one runtime as a structured observation. Workflow verification fixtures are executed by a registered runner, described under [Verification](/agents/verification/). + +## Claude configuration benchmarks + +`captain ai fixture` reads a YAML fixture, layers `defaults` beneath each run, executes repeated trials, and reports duration, cost, tokens and tool calls. It invokes the Claude CLI and requires its login and any tools declared by the fixture. + +```sh +captain ai fixture --file examples/ai-fixtures/mission-control-investigate.yaml +captain ai fixture --file benchmark.yaml --repeat 3 --report .tmp/benchmark.md +captain ai fixture --file benchmark.yaml --report .tmp/benchmark.html --format html +``` + +```yaml +name: repository-summary +description: Compare tool exposure for the same repository question +prompt: Describe this repository's main packages. Do not change files. +repeat: 2 +defaults: + model: sonnet + timeout: 2m + permissionMode: default + disallowedTools: [Edit, Write, Bash, Agent, Task] +runs: + - name: read-and-search + tools: [Read, Glob, Grep] + - name: read-only + tools: [Read] +``` + +`runs` must contain at least one entry. Per-run fields include `prompt`, `system`, `model`, `cwd`, `timeout`, `permissionMode`, `appendSystemPrompt`, `settings`, `maxBudgetUSD`, `repeat`, `tools`, `allowedTools`, `disallowedTools`, `mcpConfig`, `addDir`, `betas`, `extraArgs`, `env`, `promptCaching`, `noSessionPersistence` and `bare`. List overrides replace the default list. `--repeat` overrides the fixture-wide repeat count; a per-run repeat still wins. + +Stream artifacts default to `/.captain/fixtures/`; use `--artifacts` to choose a destination. `--report` writes an evidence report in `markdown`, `html`, or `ansi` format. `baseline` names the comparison run for aggregate reporting. + +MCP servers are opt-in per run through `mcpConfig`; the runner uses strict MCP configuration so ambient servers do not leak into a comparison. With `allowedTools` and `bypassPermissions`, it changes the effective permission mode to `default` so non-interactive unlisted tools are denied. Other explicit permission modes are preserved. Repeated trials report aggregate duration/cost and variation; retain the per-trial streams as evidence for comparisons. + +## External tool traffic + +`captureKubernetesProxy: true` routes kubeconfig-aware Kubernetes requests through a local capture proxy. `kubeconfig` selects the source configuration. `mcpProxy: {capture: true}` wraps HTTP MCP servers from each run's `mcpConfig`; optional `headers` are merged into forwarded requests. Reports and per-run logs separate tool invocations from observed network requests. + +These proxies capture real traffic; they do not turn a mutating tool into a read-only one. Choose the target and tool policy before running a benchmark. + +## One runtime observation + +```sh +captain prompt observe --runtime agent:sonnet -p 'Explain this repository' > .tmp/observation.json +captain prompt observe review.prompt --runtime api:gpt-6.1-sol -V target=pkg/cli +``` + +`observe` is CLI-only and emits one `captain.observation/v1` JSON document. `--runtime` is required and cannot be combined with `--model` or `--mode`. Fallback chains, parallel matrices and workflow-backed prompts are rejected. `--mcp-config` and `--capture-kubernetes` request external capture; availability and capture coverage are recorded explicitly rather than treating missing measurements as zero. + +Use `captain prompt observe --help` for all source, capture and timeout flags. Observation execution can call a model and use the declared tools, just like a normal prompt run. diff --git a/docs/src/pages/index.mdx b/docs/src/pages/index.mdx index 892ee81b..0a63594a 100644 --- a/docs/src/pages/index.mdx +++ b/docs/src/pages/index.mdx @@ -7,7 +7,15 @@ section: Start # Captain documentation -This site is the documentation home for Captain. Authored sections cover the prompts engine — how `.prompt` files are loaded, rendered, merged into `api.Spec`, and executed from the CLI and web UI — and todo execution, where gavel drives Captain's agent runtime to implement, check, and verify TODOs. +Captain runs prompts across API and local agent runtimes, records sessions, brokers approvals, and verifies generated work. Start with configuration, preview a prompt, then execute it through the CLI or workbench. Gavel embeds the same runtime for its TODO lifecycle. + +```sh +captain configure +captain prompt list +captain prompt render proposal-review -V 'files:=["proposal.md"]' --json +captain prompt run proposal-review -V 'files:=["proposal.md"]' +captain serve --open +``` -## Current focus +## Reference -The prompts section is grounded in the implementation under `pkg/ai/prompt`, `pkg/cli/ai_prompt_file.go`, and `pkg/cli/prompt_entity.go`. The docs intentionally describe the existing runtime behavior instead of creating a second prompt workbench. +- [Prompt CLI](/prompts/cli/) covers every prompt subcommand, terminal color, agent Markdown help and schemas. +- [Configuration](/configuration/) covers saved runtime defaults, credentials, sources and database contexts. +- [Fixtures](/fixtures/) covers benchmarks, structured observations and external verification runners. +- [Sandboxes](/sandboxes/) covers isolation, agent images, deployment and credential publishing. diff --git a/docs/src/pages/prompts/cli.mdx b/docs/src/pages/prompts/cli.mdx new file mode 100644 index 00000000..1db1fb63 --- /dev/null +++ b/docs/src/pages/prompts/cli.mdx @@ -0,0 +1,96 @@ +--- +layout: ../../layouts/DocsLayout.astro +title: Prompt CLI +description: Discover, inspect, author, render, run and observe prompts, with terminal and agent help. +section: Prompts +--- + +# Prompt CLI + +`captain prompt` is the primary prompt command. Its children share the same source catalog and runtime schema. `captain ai prompt` is an alias for `captain prompt run`. + +| Command | Result | +| --- | --- | +| `captain prompt list` | Discover prompts; filter with `--query` and `--source` | +| `captain prompt get SOURCE` | Read content, metadata, schemas and version | +| `captain prompt create key=value ...` | Validate and create a writable local prompt | +| `captain prompt update SOURCE key=value ...` | Validate and replace local content | +| `captain prompt delete SOURCE` | Delete a local file; built-ins remain read-only | +| `captain prompt render [SOURCE] [FILES...]` | Preview messages, spec, schemas, provenance and validation | +| `captain prompt run [SOURCE] [FILES...]` | Render, validate and execute | +| `captain prompt observe [SOURCE]` | Execute one `--runtime` and emit observation JSON | + +`SOURCE` can be an opaque catalog ID, a bare name, a `.prompt` path, or `-` for stdin on render/run. An existing file in the current directory wins over catalog discovery. Local sources shadow embedded names; ambiguous local names need an explicit path or ID. + +## Preview before running + +```sh +captain prompt list --query review +captain prompt get proposal-review --json +captain prompt render review.prompt -V target=pkg/cli --json +captain prompt run review.prompt -V target=pkg/cli --access read-only +``` + +`render` calls no model and runs no setup. Its JSON includes the full `input` request, `resolution` and `validationError`; inspect that error before executing. For declaration-only validation, use `captain lint promptfile review.prompt`. + +## Inline text, variables and stdin + +```sh +captain prompt run --model agent:sonnet -p 'Explain this repository' +captain prompt render --model agent:sonnet -p 'Explain {{topic}}' -V topic=permissions +git diff | captain prompt run review.prompt -V patch=- +captain prompt render review.prompt --vars @inputs.json --json +``` + +Choose one positional source or `-p`; with neither, Captain reads stdin. `.prompt` files are templates. Inline and piped text are literal data unless supplied variables or `{{input}}` opt into templating. Piped input binds to `input`, or to a named variable with `-V key=-`; unused piped input is appended to the body. `-V key=@file` reads one variable from a file. `-p`, `-s`, `--append-system` and `--vars` also accept `@file` or `@url`. + +## Input files and batches + +```sh +captain prompt run classify.prompt .gavel/jira/10304/*.md +captain prompt run classify.prompt .gavel/jira/10304/*.md --batch=1 --batch-concurrency=4 +captain prompt run describe.prompt -A a.png -A b.png --batch=1 +captain prompt render classify.prompt .gavel/jira/10304/KEY-1.md --json +``` + +Arguments after the prompt are input files; the shell expands globs. Each must be an existing regular file. A run binds them as the `files` variable (a list of paths), and as `file` when it has exactly one. Setting `file` or `files` yourself with `-V`, `--vars` or stdin while passing input files is an error. Input files are not attached; `--attach`/`-A` files are, as before. + +Without a batch, every input file goes to one run. `--batch=N` splits them into runs of N files, so `--batch=1` processes files one at a time; under a batch the `--attach` files are split too, each run attaching only its own. `--batch-concurrency=M` runs M batches at once (default 1). The flags override the prompt's `batch` field. Each batch is its own recorded run, and its input hooks may skip it. The result lists one row per batch with its inputs, status and answer, skip reason or error. The totals count succeeded, failed and skipped runs; tokens and cost are summed over the runs that executed. When any batch fails, the others still run and the command exits non-zero. A batch cannot be combined with a multi-runtime run (`runtimes:` or `-M`). + +## Runtime and output + +```sh +captain prompt run review.prompt --preset Plan +captain prompt render review.prompt --no-presets --json +captain prompt run review.prompt -M agent:sonnet -M agent:gpt-6.1-sol +captain prompt run review.prompt --no-stream --json +captain prompt observe --runtime agent:sonnet -p 'Explain this repository' +``` + +Compact selectors use `mode:model:effort`, such as `agent:sonnet:high`. Repeated `-M` values replace a prompt's declared runtime matrix. `--preset` replaces its preset selection; `--no-presets` clears it. Use `--attach` for local paths or URLs and `--timeout` to supply a caller deadline; a declared `budget.timeout` takes precedence. `--json` returns structured results and `--no-stream` buffers the final result. See [Runtime overlay](/prompts/runtime/) for permissions, budgets, fallbacks and layer order. + +A foreground, single-runtime Claude Agent or Codex app-server run can ask through the terminal when stdin and stderr are terminals. Piping input removes that answer channel; redirecting stdout preserves it. See [Approvals](/agents/approvals/#foreground-terminal-runs). + +## Create and update + +```sh +captain prompt create name=hello 'content=Hello {{name}}' +captain prompt get .captain/prompts/hello.prompt --json +captain prompt update .captain/prompts/hello.prompt 'content=Hello {{name}}!' baseVersion=VERSION_FROM_GET +``` + +Creation uses the first writable source by default. Supply `target=SOURCE_ID` and `relPath=hello.prompt` to choose a destination. The generated schema endpoint lists writable sources, including empty directories. Updates can send the version returned by `get` as `baseVersion`; stale versions fail instead of overwriting another edit. Embedded content must be copied to a writable source. Both create and update validate content before an atomic write. See [Sources and API](/prompts/sources-api/#saving). + +## Help, color and schemas + +```sh +captain prompt --help +captain prompt run --help +captain prompt observe --help +captain prompt render --no-color --help +captain prompt --schema +``` + +Root help covers promptfile authoring; each child's help adds examples and its generated flags, including inherited output options. Human terminal help uses colored headings and syntax-highlighted examples. `--no-color`, `NO_COLOR`, and redirected output disable ANSI color. Detected Captain, Claude, Codex and Gemini sessions receive Markdown help without ANSI escapes. Result-format flags such as `--json` select command results rather than the help renderer. + +`--schema` exposes generated input/output schemas, enum values, runtime catalogs and provider-specific `cliArgs`. For server clients, `GET /api/captain/ai/prompt/schema` is the authoring schema and availability catalog. diff --git a/docs/src/pages/prompts/format.mdx b/docs/src/pages/prompts/format.mdx index f33653b3..4c0ff7d7 100644 --- a/docs/src/pages/prompts/format.mdx +++ b/docs/src/pages/prompts/format.mdx @@ -47,15 +47,20 @@ A `.prompt` file has YAML frontmatter followed by a Handlebars body. dotprompt o Captain spec Decoded into `api.Spec` with strict field validation. + + tools + Captain spec + A mapping of inline tools, each backed by a script. Replaces dotprompt's list of registered tool names, which Captain rejects. See Inline tools. + runtimes Captain execution metadata Declares the default parallel runtime matrix without becoming part of the request sent to each model. - runtimeProfile + presets Captain runtime catalog - Pins the runtime profile (id or name) whose presets and spec are layered beneath this frontmatter. A request runtimeProfile or --runtime-profile overrides the pin. + Selects reusable runtime presets by id or name. Request presets or repeated --preset flags replace the selection; --no-presets clears it. @@ -93,9 +98,8 @@ permissions: presets: - edit tools: - allow: - - Read - - Edit + Read: allow + Edit: allow mcp: disabled: true memory: @@ -111,14 +115,232 @@ Refactor: {{target}} `} /> -## Runtime profile pin +### Batches + +`batch` splits the input files of `captain prompt run [files...]` into runs of `size` files each, `concurrency` of them at a time (default 1). `batch: 1` is shorthand for `batch: {size: 1}`. Without it every input file goes to one run. `--batch` and `--batch-concurrency` override it; see [Input files and batches](/prompts/cli/#input-files-and-batches). + +```yaml +--- +model: jev-latest +batch: {size: 1, concurrency: 4} +--- +Classify {{file}}. +``` + +## Inline tools -`runtimeProfile` names a saved runtime profile by id or name. Rendering resolves the profile's presets (ordered by scope), then its spec, then this frontmatter, then the caller's request or CLI flags, so the file can defer model, budget, and permission defaults to a shared profile while still overriding any of them inline. A caller that passes `runtimeProfile` on the render request or `--runtime-profile` on the command line replaces the pin; a pin that names no profile in the catalog fails the render rather than silently running without it. The render result's `resolution.trace` lists every layer that contributed. Captain binaries older than this key reject a file that uses it. +`tools` declares tools the model can call, keyed by tool name. Each tool runs its `exec` script and returns the result to the model. Inline tools are caller tools: API runtimes call them in-process and agent runtimes reach them through Captain's caller-tool MCP endpoint. A runtime that cannot expose caller tools (for example `google cli`) refuses the run before the first model call. Jev is the exception: it ignores tools and leaves them to hooks (see [Jev typed decisions](#jev-typed-decisions)). - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldBehavior
execRequired. The script to run. A shebang line picks the interpreter; otherwise it runs with bash -c, or sh -c when bash is missing. The tool input arrives on stdin as a JSON object.
descriptionShown to the model.
inputPicoschema or JSON Schema for the arguments. Omit it to take an empty object.
outputPicoschema or JSON Schema. When set, stdout must be JSON that matches it, and the model gets the parsed document. Without it, the model gets stdout as text.
readonly, destructiveSafety hints. A readonly tool runs without approval. A destructive tool asks first. Declaring neither makes the tool ask, unless a policy rule allows it. The two are mutually exclusive.
permissionauto, ask, allow or deny. Overrides the default derived from the hints. toolPolicy and toolPreferences rules still apply by tool name, as for any caller tool; permissions.tools does not govern caller tools.
timeoutBounds each attempt. The default is 10m. On timeout the script's whole process group is killed.
retryattempts counts every run, the first included. delay (default 1s) grows by backoff (default 2) up to maxDelay (default 30s). A timed-out attempt is always retried. A non-zero exit is retried unless exitCodes is set, in which case only the listed codes are retried. Output that fails the output schema is never retried.
cwd, dotenv, envVars, connectionsThe same fields as setup, applied to this tool. A tool inherits the run's setup dotenv files and static env vars. It inherits the run's connections and secret env vars only as credentials allows. Its own dotenv files and env vars are added on top and win on conflict, and its own connections replace the run's. cwd defaults to the run's working directory, after any setup checkout or worktree. checkout is not allowed on a tool.
placementWhere the script runs. host or sandbox on a local run; supervisor or sidecar on a git-agent run. When unset, it is the sandbox's first placement: host locally, supervisor on git-agent. See Tool environment.
credentialsnone, direct, proxied, sidecar or sidecar-proxied: how connections and secret env vars reach the script. When unset, it is derived: proxied when the tool declares grants; otherwise none when there is nothing secret to hand over; otherwise direct on the host or supervisor. A tool placed in the sandbox or on the sidecar with secrets must choose a mode explicitly.
grantsHTTP(S) destinations a proxied or sidecar-proxied tool may call, each with a name, url, methods, path prefixes in paths, and the headers that carry a credential ({name, valueFrom}).
+ +The script runs through the commons-db shell runner. Its environment contains only the allowlisted host variables, plus the dotenv files, env vars and credentials its mode allows. The runner redacts `envVars` values (static ones included), dotenv values and connection-produced values from the output and errors the model sees, so print a derived value rather than one of those verbatim. A non-zero exit returns the exit code and the tail of stderr to the model as a tool error. + +### Tool environment + +Each tool's environment is prepared once per run, after setup, and torn down when the run ends. Connection credential files are written to a private temporary directory, never into the workspace. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
credentialsWhat the script gets
noneNo connections and no secret env vars, its own or the run's. Declaring either on the tool is an error.
directThe real credentials: its own and the run's connections and secret env vars. On the host, this makes the tool the proxy: it performs the credentialed operation itself, and the agent only ever sees its result.
proxiedConfiguration that names a proxy on the host, which holds the real credentials and injects them on the way out. kubernetes connections (the tool's own or the run's) are served through a KUBECONFIG whose only content is the proxy's address; it contains no credentials. grants are served by an egress proxy: the script sees HTTP_PROXY/HTTPS_PROXY and one placeholder per granted header, <GRANT>_<HEADER>. Run connections that no proxy can serve (aws, gcp, azure) and secret env vars are not inherited, and declaring them on the tool is an error. On the sidecar, the proxies stay on the supervisor and the tool reaches them through the task's tunnel; it inherits nothing from the run.
sidecarSidecar only. The tool's own envVars, dotenv and connections, resolved on the sidecar from its own environment, files and cloud identity. Nothing is inherited from the run, whose setup is the supervisor's. grants are refused.
sidecar-proxiedSidecar only. The supervisor resolves the tool's grants and releases their values once, to an egress proxy inside the sidecar's runner, which holds them in memory. The script sees placeholders, as under proxied. grants are required; connections and secret env vars are refused.
+ +The egress proxy enforces grants. Destinations are denied by default, each grant is scoped by method and path, and a placeholder outside its granted header is rejected, never stripped. HTTPS works through `CONNECT`: the proxy terminates the tunnel with a certificate from a per-run CA, so the requests inside stay inspectable. The script trusts that CA through `SSL_CERT_FILE`, `CURL_CA_BUNDLE`, `REQUESTS_CA_BUNDLE`, `NODE_EXTRA_CA_CERTS` and `GIT_SSL_CAINFO`. The CA's private key never leaves Captain's process, and a `CONNECT` to an ungranted destination is refused. Rejections are logged as warnings. + + + +`placement` is checked against the run's sandbox before the model is called: + + + + + + + + + + + + + + +
Run sandboxhostsandbox
off, nativeSupported: the tool runs next to Captain, outside the provider's sandboxRefused: there is no wrapper to run the tool inside
dockerRefused: the container cannot yet reach Captain's tool endpoint
git-agentRefused: use supervisor or sidecar, below
+ +### Tools on git-agent runs + +A `git-agent` run executes on the sidecar, so its tools are placed relative to the two hosts. The agent sees every tool, wherever it runs, as one MCP server. The sidecar's runner serves sidecar tools itself and forwards supervisor tools over the task's tunnel. The tunnel uses the transport the sidecar already relays results over, SSH or HTTPS, and opens only services the supervisor registered for that task and that agent. + + + + + + + + + + + + + + + + +
placementnonedirectproxiedsidecarsidecar-proxied
supervisorSupportedSupportedSupportedRefusedRefused
sidecarSupportedRefused: the supervisor's secrets would cross to the sidecarSupported: no secret reaches the sidecarSupportedSupported
+ +A supervisor tool is approved by the supervisor's run, exactly like a local tool. A sidecar tool runs where nobody can approve a call, so one that resolves to `ask` is refused before dispatch. Mark it `readonly`, set `permission: allow`, or place it on the supervisor. + +What each mode protects against: + +- **The agent and the sidecar's runner run as the same OS user.** When any sidecar tool holds credentials, the runner removes everything but system, provider and `CAPTAIN_*` variables from the agent's environment. Under the native Claude sandbox, the agent is also denied reads of the task file, the tools' private directories, and the sidecar's keys, token and captain config. This keeps secrets out of the agent's environment and context. It does not protect them from a same-user process that escapes its confinement. Codex runtimes refuse denied-read paths, so a task with credentialed sidecar tools fails when it launches a Codex agent. +- **`sidecar` shares the sidecar's ambient identity.** An instance role, IRSA or a service account is available to every process on the sidecar, the agent included. +- **A grant is the real capability boundary.** The agent could call a proxy directly instead of through the tool's script, so scope each grant's `methods` and `paths` to what the tool needs. Every proxy requires a per-tool secret, so another local process that finds its port cannot use it. +- **Static values in a prompt inside the repository travel with the work.** The dispatch ships the repository's uncommitted state to the sidecar. Keep secret values in a secret store (`valueFrom`), or keep such a prompt outside the repository. + +Supervisors and sidecars must run the same captain release. A task names the payload features it needs, and a sidecar that does not know one refuses the task instead of running it without its tools. + +A chat binds its inline tools once, when it starts. Every turn shares one tool environment, prepared where setup left the chat and torn down when the chat ends. A chat attaches no approval broker, so a tool that would ask is refused when the chat starts; mark it `readonly` or set `permission: allow`. `captain prompt observe` refuses prompts with inline tools, because it does not run through the tool runner. + +The frontmatter is rendered as Handlebars before it is decoded, so `exec` can use run variables, for example `--project {{shq project}}`. A literal `{{` in a script must be written as `\{{`. Tool arguments never pass through the template: they only arrive on stdin. + +A tool declared in a preset or request layer with the same name replaces the prompt's tool whole. Fields from the two layers are never mixed. `captain lint promptfile` compiles each tool's schemas. It warns in three cases: + +- A `destructive` tool retries, because a failed attempt may already have taken effect. +- A `sandbox` tool uses `direct` credentials, which puts real secrets in the sandbox. +- A `none` or `proxied` tool sits beside `setup.connections`, which still hand the agent those secrets. + +## Runtime preset selection + +`presets` selects reusable runtime spec layers. Captain combines the selected presets, rendered frontmatter, and caller request, sorting by explicit `order`, then scope, then selection order. Ordinary presets supply defaults beneath the prompt; a higher `order` can enforce fields afterward. Saved configuration fills remaining gaps. Missing or ambiguous references fail rendering. The render result's `resolution.trace` and `resolution.provenance` explain the effective fields. See [Runtime overlay](/prompts/runtime/#precedence). + +`runtimeProfile` and `--runtime-profile` are deprecated and ignored with a warning. Replace them with `presets` and `--preset`. + + + +## Lint promptfiles + +Run `captain lint promptfile [paths...]` before executing a prompt. It checks frontmatter delimiters, YAML, Handlebars syntax, Captain declarations, structural options, hooks, and Picoschema, JSON Schema, or native TypeSafe output declarations. Validation does not execute the body, contact a model, resolve presets, or open a database. Body-only prompts and declarations that inherit their model remain valid. + + + +File arguments are checked directly, including explicitly named ignored files. Directory discovery respects Git ignore rules and skips nested projects. Overlapping paths are checked once. A missing path, unreadable ordinary file, or selection containing no `.prompt` files fails with an actionable error. A broken, cyclic, or unreadable symbolic link produces a `promptfile/symlink` warning attached to its logical path, allowing the remaining prompts to be validated. + +Missing body variables are allowed because lint does not render the body. Frontmatter variables need values to validate the declarations they generate: without complete sample inputs, lint checks template syntax and emits a `promptfile/variables` warning listing unresolved inputs and the deferred declaration checks. Supply repeated `--var key=value` flags or a `--vars` JSON object to enable those checks. Schema compilation uses bundled declarations and does not fetch external references. + +Human output shows the number of files checked and separate error and warning counts, followed by diagnostics grouped by prompt path. JSON results use Gavel's standard linter-result array, including stable rule IDs, severities, file counts, and source positions where available. Warning-only results exit successfully; invalid content or execution failures exit nonzero. JSON output retains diagnostics on failure. The command performs validation only and does not modify promptfiles. + +## Review documents with Gavel + +`gavel lint prompt` runs a prompt with the `lint` preset, which replaces the prompt's output schema with Gavel's violation contract, so any prompt that asks for located findings works as a linter. Captain provides seven document review examples in `examples/`. They run as read-only agents: they read the listed files themselves, search the working tree to check concrete references, and report each finding with its file, line, quoted text, severity and a stable `family/name` rule id. Errors fail the lint; warnings and info do not. + + + + + + + + + + + + + + +
PromptReaderRule families
spec-internal-highTeam deciding what to build: PRDs, RFCs, architecture overviews, plansreq/ doc/ hl/ int/
spec-internal-lowImplementers: detailed, schema and algorithm designsreq/ doc/ ll/ int/
spec-public-highCustomers evaluating: product specs, solution overviews, whitepapersreq/ doc/ hl/ pub/
spec-public-lowExternal integrators: API references, protocol and format specsreq/ doc/ ll/ pub/
proposal-reviewEvaluators: RFP responses, proposals, statements of workreq/ doc/ prop/
website-oss-developer-toolsDevelopers deciding whether to try an open-source tool: landing, feature, pricing, comparison and community pagesdoc/ pub/ web/ oss/ ia/ ux/ dx/ density/
website-docs-developer-toolsDevelopers following the docs: tutorials, how-to guides, reference, explanationdoc/ pub/ ia/ ux/ dx/ density/
+ +`req/` checks requirement quality (verifiable, unambiguous, singular, with units, consistent). `doc/` catches defects common in generated documents: unsourced numbers, cross-section inconsistencies, placeholders, boilerplate, and planned behavior described as existing. `hl/` and `ll/` hold each level to its job, so a PRD is not asked for field types and an API reference is not asked for market rationale. `int/` verifies references against the repository; `pub/` catches internal leaks, undefined terms and missing versioning. `prop/` traces every mandatory RFP requirement to the response when `rfp` is supplied. + +The two website prompts check every command, flag, version and example against the tool's source (`source`, default the working directory) and share four families. `ia/` covers information architecture: navigation grouped by reader goals rather than code layout, one purpose per page, labels that predict their content, a clean heading outline, cross-links, and orphaned, dead-end or broken links. `ux/` covers reading and interaction: link and call-to-action labels, conditions placed before the step they govern, callouts, a recommended default among options, and text alternatives for images and recordings. `dx/` covers developer experience: prerequisites, time to the first working result, commands that paste and run, complete examples and option reference, configuration precedence, version drift and unsafe steps. `density/` covers information density: walls of text, buried ledes, filler, content in the wrong shape, repetition and fragmentation. The numeric thresholds in these rules are reporting triggers, not targets. The marketing prompt adds `web/` for the landing page's message and `oss/` for open-source essentials: license, repository, the open-core boundary, ungated access, community, security contact, maintenance and telemetry. + +Each review prompt declares `permissions: {access: read-only}` rather than a tool list. The same file therefore runs read-only on claude, where it compiles to Edit, Write, Bash and sub-agent denies, and on codex, where it compiles to a read-only sandbox that never asks. Web tools stay available on both. `captain permissions explain examples/proposal-review.prompt --model agent:sonnet --model agent:gpt-6.1-sol` shows both postures; see [Portable access](/prompts/runtime/#portable-access). + +To use an example by name from any directory, copy it from `examples/` into `~/.config/captain/prompts/`, or into a repository's `.captain/prompts/` for project use. These examples are not embedded in the binary. + + diff --git a/docs/src/pages/prompts/hooks.mdx b/docs/src/pages/prompts/hooks.mdx index ef066803..61ca94e8 100644 --- a/docs/src/pages/prompts/hooks.mdx +++ b/docs/src/pages/prompts/hooks.mdx @@ -1,7 +1,7 @@ --- layout: ../../layouts/DocsLayout.astro title: Prompt Hooks -description: Prompts that decorate every saved plan revision or enrich a run's initial prompt. +description: Prompts that decorate every saved plan revision, enrich a run's initial prompt, emit its output schema, or act on its result. section: Prompts --- @@ -122,3 +122,136 @@ The applied hook names are recorded comma-joined in `metadata["captain.context"] ## Discovery `promptcontext.DefaultSources(cfg, workDir)` returns the plan hooks' search path: `prompts.dirs` from the Captain config, then `/.captain/prompts`. A host puts its own sources, for example an embedded FS of the prompts it ships, as `promptcontext.Source{FS, Label}` ahead of them, so a user directory can shadow or disable what the host ships. Later sources shadow earlier ones by file name, and `hook: { disabled: true }` removes a hook. Captain ships no context hooks of its own. + +# Hook actions + +Input hooks, schema hooks and lifecycle hooks are declared inside the prompt that uses them, not discovered from directories. Each one is a hook action with exactly one of these: + +- `tool:` names an inline tool from the prompt's `tools:`. It runs through the same runner the model's calls use, so the tool's output schema, `timeout` and `retry` apply. Its stdin is the action's input as JSON. +- `prompt:` names a child `.prompt`, relative to the declaring prompt's file. It runs as a child run with the parent's configuration and working directory. Its input becomes the child's variables, and its structured output (else its text) is the action's output. +- `commands:` runs shell commands. Only lifecycle hooks accept this. + +Two optional fields shape an action: + +- `if:` is a CEL predicate over the hook's variables. It is compiled when the prompt is validated, in a strict environment, so a misspelled variable is an error rather than a predicate that never matches. An empty `if` always runs. +- `with:` is the action's input. A string that is exactly one `{{path}}` expression binds the native value at that path: an object, list, number or boolean stays one. A path that names nothing is an error. Any other string renders as Handlebars to a string, and `{{json value}}` renders a value as JSON text. Maps and lists are rendered recursively. + +Frontmatter is rendered with the run's variables before the hooks run. An expression over a hook-only variable (`vars`, `metadata`, `output`, `result`, `steps`, `outcome`) is left verbatim for the hook to render, so write `{{vars.file}}`, not `{{file}}`, in a hook's `with`. An inline tool's `exec` is ordinary frontmatter, so `exec: emit-choices --product {{product}}` is rendered with the run's variables. + +A tool a hook runs is still governed by its permission: the tool's `permission`, `readonly` and `destructive`, then the spec's `toolPreferences` and `toolPolicy`. A denied tool fails the hook, and a tool that resolves to ask goes to the run's approval broker and fails the hook when there is none. This holds on a runtime that never offers tools to the model, such as Jev, whose inline tools exist only for hooks. Declare `permission: allow` on a destructive tool that a hook should run unattended. + +# Input hooks + +An input hook pre-processes the prompt's variables before the body renders, or skips the run. Declare them under `input.hooks`, beside the input schema: + +```yaml +--- +model: jev-latest +mode: api +tools: + load_issue: + description: Load the issue without its earlier classification, or skip it when it is unchanged + readonly: true + exec: acme-cli issue load +input: + schema: + file: string + force?: boolean + hooks: + - tool: load_issue + with: {source: jira} +--- +{{issue}} +``` + +Hooks run in order. A `tool:` hook receives the run's variables and metadata on stdin, with its rendered `with` keys merged over them: + +```json +{"vars": {"file": ".gavel/jira/KEY-1.md"}, "metadata": {}, "source": "jira"} +``` + +A `prompt:` hook gets the same object as its variables. Each hook returns a JSON object with exactly one of these keys, printed on stdout by a tool or returned as structured output by a prompt: + +- `{"vars": {...}}` replaces all of the variables. The hooks after it and the body render see the new ones. +- `{"skip": ""}` stops the run before any model call. + +Anything else fails the run, naming the hook (`input.hooks[0] (tool load_issue): want an object with exactly one of "vars" or "skip", got keys [issue]`). A hook whose `if` is false is skipped and reported (`[pre-run] input.hooks[0] (tool load_issue) skipped: if … is false`). + +The prompt renders twice: first with the original variables, which yields the tools and the hooks, then again with the variables the hooks returned. Tool `exec` lines, `with` values and the body therefore all see the new variables. + +A skipped run reports status `skipped` with its `skipReason`, exits 0, calls no model and records no run. A child prompt that its own input hooks skip, run from a `workflow.after` step, is reported as a skipped step (`[post-run] after[1] skipped: `) and does not fail the parent. + +`if` reads `vars`, `metadata`, `labels` and `model`. + +`captain prompt render` runs input hooks too, so `captain prompt render classify.prompt KEY-1.md --json` shows the final variables in `input.prompt.variables`, or the hook's skip in `skip`. Because a render runs them, an input hook must not change anything: only a `readonly` tool may serve one, and a `commands:` input hook is rejected. `captain lint promptfile` checks input hooks like the other hook actions. + +# Schema hooks + +A schema hook emits or rewrites the prompt's output schema before the first model call. Declare them under `output.hooks`, beside the static schema they start from: + +```yaml +--- +model: jev-latest +mode: api +tools: + product_choices: + description: Emit the products the classifier may choose from + readonly: true + exec: acme-cli choices --questions product +output: + schemaType: typesafe-schema + hooks: + - tool: product_choices + with: {region: "{{vars.region}}"} + schema: + product: + type: choice + instructions: Which product does the issue concern? + criteria: + unknown: The issue names no product. +--- +``` + +Hooks run in order, and each one receives the schema the previous one left: + +```json +{"schema": {"product": {"type": "choice", "...": "..."}}, "schemaType": "typesafe-schema", "vars": {"region": "emea"}, "metadata": {}, "region": "emea"} +``` + +`schema` is the TypeSafe questions object for `typesafe-schema` and the JSON Schema for `json-schema`. The rendered `with` keys are merged over the other keys. A `prompt:` hook gets the same object as its variables. + +The hook returns the whole new schema of the same type: a tool prints it on stdout, and a prompt returns it as its structured output. Captain validates it as it validates a declared schema, so TypeSafe questions must each be valid and a JSON Schema must compile. The result replaces the prompt's schema. An invalid emission fails the run before any model call, naming the hook (`output.hooks[0] (tool product_choices): emitted schema: …`). Every turn, every verify retry and the recorded spec see the emitted schema. + +`if` reads `vars`, `metadata`, `labels` and `model`. + +`captain prompt render` runs the same hooks, so `captain prompt render classify.prompt -V region=emea --json` shows the emitted schema in `outputSchema` without calling a model. Because a render runs them, a schema hook must not change anything: only a `readonly` tool may serve one, and a `commands:` schema hook is rejected. + +# Lifecycle hooks + +A lifecycle hook acts on the finished run. Lifecycle hooks extend `workflow.after`. Each step keeps its outcome gate `when:`, which is `onVerify` (the default), `onSuccess` or `always`. Each step may also add `if:` and run a `tool:`, a `prompt:` or `commands:`: + +```yaml +workflow: + after: + - when: onSuccess + tool: record_classification + with: {file: "{{vars.file}}", values: "{{output.value}}"} + - when: onSuccess + if: output.value.product != "unknown" + prompt: transaction.prompt + with: {file: "{{vars.file}}", product: "{{output.value.product}}", recorded: "{{steps.0}}"} +``` + +`if` and `with` read these variables: + +- `output` is the run's structured output. On Jev it is `{value, typesafe}`. +- `result` is the response text. +- `vars` and `metadata` are the run's variables and metadata. +- `outcome` is `{failed, verified}`. +- `steps` lists the outputs of the earlier after steps by index. A skipped step or a `commands:` step contributes `null`. + +A step whose gate or `if` does not hold is skipped, and the reason is reported on the run's stream (`[post-run] after[1] skipped: if output.value.product != "unknown" is false`). A failing tool or child prompt fails the run, as a failing command does. That includes a child run that errors or fails its own verification. `cwd` sets where commands or a child prompt run, and is rejected on a tool step, whose tool runs in its own environment. + +When the parent run is recorded, the child is recorded as its own run with `parent_run_id` set to the parent's, in a new `agent` session under the parent run's session, so both share the parent's root session. `ListPromptRuns` with `PromptRunFilter{ParentRunID}` lists a run's children. An unrecorded parent records no child. + +`captain lint promptfile` checks every hook action. It rejects a `tool:` that `tools:` does not declare, a `prompt:` file that does not exist, a `with:` on commands, a `cwd` on a tool step, an `if` that does not compile, and an action that declares none or more than one of `tool:`, `prompt:` and `commands:`. diff --git a/docs/src/pages/prompts/index.mdx b/docs/src/pages/prompts/index.mdx index d0874922..3a8f0fd6 100644 --- a/docs/src/pages/prompts/index.mdx +++ b/docs/src/pages/prompts/index.mdx @@ -19,7 +19,7 @@ Captain prompts are `.prompt` templates rendered through Google dotprompt and fo

Source

-

A prompt can come from a positional file, `--prompt`, stdin (piped, or named with `-`), embedded examples, configured prompt dirs, or the implicit `.captain/prompts` directory. `-p`, `--system`, `--append-system` and `--vars` also accept `@file` or `@url`.

+

A prompt can come from a positional file, `--prompt`, stdin (piped, or named with `-`), embedded examples, configured prompt dirs, the implicit `.captain/prompts` directory, or the user's `~/.config/captain/prompts` directory. `-p`, `--system`, `--append-system` and `--vars` also accept `@file` or `@url`.

Template

@@ -95,6 +95,7 @@ REQUIREMENTS: ## Where to go next +- [Prompt CLI](/prompts/cli/) covers discovery, authoring, preview, execution, observations, help and color. - [Prompt Format](/prompts/format/) covers frontmatter, roles, variables, and config precedence. - [Runtime Overlay](/prompts/runtime/) covers `api.Spec`, budgets, permissions, memory, model selection, and setup. - [Sources and API](/prompts/sources-api/) covers embedded/local sources and render/run API payloads. diff --git a/docs/src/pages/prompts/runtime.mdx b/docs/src/pages/prompts/runtime.mdx index 9c755a83..2d34850a 100644 --- a/docs/src/pages/prompts/runtime.mdx +++ b/docs/src/pages/prompts/runtime.mdx @@ -10,37 +10,25 @@ import RuntimeSpecDemo from "../../components/RuntimeSpecDemo.tsx"; # Runtime overlay -The prompt file provides the base request, but it is not the last word. Captain resolves the final runtime request by layering command flags, saved defaults, and workbench edits over the rendered prompt. +Captain combines runtime presets, rendered frontmatter, and explicit CLI or workbench choices into one typed request. Saved defaults fill gaps after composition. ## Precedence -
-

1. Prompt frontmatter

-

The `.prompt` file declares the base model, budget, permissions, memory, setup, and prompt metadata.

-
-
-

2. Saved defaults

-

`captain configure` values fill gaps such as default model, mode, max tokens, budget, no-cache, and memory toggles.

-
-
-

3. CLI or UI overlay

-

Explicit runtime choices override the base file and defaults. Negative toggles such as no-MCP and no-hooks stay enabled once set by any layer.

-
-
-

4. Context normalization

-

The prompt command resolves an empty workspace directory to the invocation cwd and resolves relative directories from that same cwd before provider dispatch.

-
+1. **Select presets.** Explicit request `presets` or repeated `--preset` flags replace frontmatter `presets`; `--no-presets` supplies an explicit empty selection. +2. **Compose authored layers.** Sort by ascending `order`, then scope (`global`, `context`, `surface`, `user`), preserving selection order for ties. At ordinary order, presets precede the prompt and explicit request. Restrictive catalogs intersect and the strictest nonzero budget limit wins. A high-order preset can override an ordinary request: built-in `Lint` uses `order: 100` to enforce its output schema. +3. **Fill saved defaults.** `captain configure` values supply missing model, mode, effort, generation, budget and memory settings. Each fallback inherits defaults from its own provider. +4. **Normalize and validate.** Relative or empty `setup.cwd` resolves against the invocation directory. Resolve model aliases and fallbacks and check runtime capabilities before dispatch. + +Explicit `false`, zero, empty collections and null values retain their authored presence; lower-layer toggles are not permanently latched on. Every authored layer is structurally validated even if another layer would overwrite it. `resolution.trace`, `resolution.provenance` and `resolution.warnings` describe the result. Rendering previews this resolution without running setup or calling a model. ## Runtime payload +## Schema repair + +Set `prompt.schemaStrictness: repair` to correct responses that do not match the output schema. Captain shows each rejected Markdown response, then asks the model to repair its answer with the schema and validation errors. It makes at most two repair attempts; if neither produces valid output, the run returns a schema error and retains the rejected response and reported findings. Token usage and cost include every attempt. + +`retry` remains a compatibility alias for `repair` in existing prompts, API requests, and stored presets. Saving or serializing the policy writes `repair`. Use `error` to fail immediately, `warning` to report local validation violations without repair, and `none` to disable local post-validation. Native provider output constraints still apply. + ## Built-in runtime presets -`permissions.presets: ["edit"]` above is a permission bundle: acceptEdits plus a curated Read/Edit/Write/Glob/Grep allowlist, the same thing `--edit` sets. Runtime presets are a separate, larger unit: named, reusable spec layers stored in the database or in preset directories, selected by id or name. Captain ships three runtime presets that every catalog lists last, with source `builtin`: +`permissions.presets: ["edit"]` above is a permission bundle: acceptEdits plus a curated Read/Edit/Write/Glob/Grep allowlist, the same thing `--edit` sets. Runtime presets are named, reusable spec layers stored in the database or preset directories, selected by id or name. Captain ships four runtime presets that every catalog lists last, with source `builtin`: | Preset | Permissions | |---|---| | Edit | `mode: acceptEdits`, `presets: [edit]` (uses the bundle above) | | Plan | `mode: plan`; `read: allow`, `shell: deny`; sets no `web_search` or `web_fetch` policy | | Read-only | no mode; `edit`, `write`, `shell`, `web_search`, `web_fetch` denied; sets no `read` policy | +| Lint | Structured `violations` output schema with `schemaStrictness: repair`; `scope: surface`, `order: 100` | A built-in only names the tools it has an opinion about, so layering one never loosens a deny another layer set: `presets: [Read-only, Plan]` keeps Read-only's web denies. Tool keys such as `shell` and `edit` are portable aliases that each runtime translates to its own tool names (`Bash` on claude, `shell` on codex, `run_shell_command` on gemini). A `claude:Bash` prefix scopes a key to one provider. When keys collide on one tool, deny wins. On agent runtimes, a name that is neither an alias, an `mcp__` tool, nor any agent's built-in is ignored (caller tools are governed by `toolPolicy`, not `permissions.tools`). On runtimes that cannot filter tools (codex, gemini), an allow written as an alias, such as `shell: allow`, is inert, while a deny is refused loudly. +Tools a prompt declares inline under `tools` (see [Inline tools](/prompts/format/#inline-tools)) are caller tools too. Their `readonly`, `destructive` and `permission` fields set the default authority, and `toolPolicy` and `toolPreferences` rules override it by tool name. + Built-ins are read-only. To change one, create a preset with the same name in the database or a preset directory: `~/.config/captain/presets`, a `runtime.presetDirs` entry, or `/.captain/presets`. It overrides the built-in everywhere, including runs and profiles that stored the built-in's id, and deleting it brings the built-in back. +## Portable access + +Each runtime speaks its own permission dialect: claude restricts per tool, codex restricts through its sandbox and approval policy, and gemini through an approval mode. A `permissions.tools` deny list therefore cannot make a run read-only on codex, where the shell is also how the agent reads files. `permissions.access` states the intent once, and Captain compiles it into each runtime's own dialect when the provider for that runtime is built. A fallback in another family is compiled for its own runtime too. + + + +With `read-only`, the agent may read the workspace. It cannot create, modify or delete files, spawn sub-agents, message or trigger other sessions, schedule prompts, create worktrees, use third-party MCP servers, or obtain write access by approval. Web tools and the network keep whatever `tools` and the sandbox say. `full` adds nothing; it overrides a read-only intent inherited from an earlier layer, or set with `--access full`. + +| Runtime | `read-only` compiles to | Support | +|---|---|---| +| claude agent, cli, cmux | `--disallowedTools` for every edit, write and shell tool plus every tool that acts outside the agent's own process (`Agent`, `Task`, `Workflow`, `TeamCreate`, `TeamDelete`, `SendMessage`, `RemoteTrigger`, `CronCreate`, `CronDelete`, `EnterWorktree`, `ExitWorktree`); MCP disabled. An authored sandbox is left as it is. | exact | +| codex agent, cli, cmux | native sandbox `read-only`, approval `never`, MCP disabled, and no execpolicy allow rules (see below). The shell stays, because it is codex's read path, and the sandbox confines it. | exact | +| gemini cli | `--approval-mode plan` | approximate: the gemini client enforces it, not an OS sandbox | +| api modes | nothing to restrict: no built-in file tools run | exact | + +Codex execpolicy rules need special handling. A `prefix_rule(..., decision="allow")` in `~/.codex/rules/*.rules`, or in a project's `.codex/rules`, runs the matching command outside the sandbox, even when the sandbox is read-only and approval is `never`. A rule allowing `git add` would let a read-only run write the git index. A read-only run keeps them out: + +- `codex exec` (the cli mode) runs with `--ignore-rules`. +- The app-server (the agent mode) and the interactive TUI (cmux) have no such switch. They start in a captain-managed `CODEX_HOME` at `~/.config/captain/codex-read-only` (under `$XDG_CONFIG_HOME` when set). That home links only `auth.json`, `config.toml` and `AGENTS.md` from your codex home, and it has no `rules` directory. `config.toml` has no field that declares rules. Captain's session history scans this home's `sessions` directory too. +- On those two runtimes, a project rules file that allows a command is refused before the run, with its path. Codex reads project rules from the working directory up to the nearest `.git`, and the isolated home cannot hide them. + +`captain permissions explain` shows which of these applies on each runtime. + +The contract does not cover Captain's own caller tools, which stay governed by `toolPolicy`. A posture a runtime cannot reach is refused before the model is called: on codex, `access: read-only` with `sandbox: off`, a docker or git-agent sandbox, `filesystem.access: workspace-write`, `writableRoots`, or cmux `cliArgs` looser than `sandbox: read-only` with `askForApproval: never` are all refused. The `access` rows of `captain permissions matrix` show the same table. + +### Existing tool and sandbox rules + +Captain also reads read-only intent from each runtime's own dialect, layer by layer, and the later layer wins: + +- A layer whose `permissions.tools` deny every edit, write and shell tool, such as the built-in Read-only preset, says read-only in claude's dialect. +- A layer with a native sandbox whose `filesystem.access` is `read-only` says it in codex's dialect. +- A later layer that allows an edit, write or shell tool, sets the sandbox to `off` or `workspace-write`, or sets `access: full` lifts the intent. `mode: plan` never converts, because plan mode writes its plan file. + +A converted intent is applied only on runtimes that speak another dialect, so a spec running on its own family is unchanged. On codex, the edit, write and shell denies of the built-in Read-only preset are now accepted as a read-only sandbox that never asks. Its web denies stay as they are: `web_fetch` has no codex tool and is reported as ignored, and `web_search` is still refused until codex can deny it natively, so the preset as a whole is still refused on codex. A read-only sandbox on claude also gains Edit and Write denies, because claude's sandbox confines only Bash. That is the one behaviour change, and it only tightens. + +The built-in presets themselves are unchanged. To see what a prompt becomes on each runtime, or to rewrite a block into the portable form, use: + + + +`convert` only rewrites a block when the portable form is equivalent or tighter on every runtime, and keeps any rule it did not absorb, such as a web deny, beside `access`. Otherwise it refuses and gives the reason. + ## Model and mode A runtime is the pair `(model, mode)`: the mode is the mechanism — `api`, `agent`, `cli`, or `cmux` — and the provider family is derived from the model name, never authored. The prompt workbench keeps runtime selection catalog-backed: the UI groups by provider family first, then mode, then the model list filtered to that runtime. Prompt files can name `model` and `mode` directly when the runtime should be pinned. diff --git a/docs/src/pages/prompts/sources-api.mdx b/docs/src/pages/prompts/sources-api.mdx index aeeecca2..337706a4 100644 --- a/docs/src/pages/prompts/sources-api.mdx +++ b/docs/src/pages/prompts/sources-api.mdx @@ -22,10 +22,15 @@ Captain discovers prompt sources in this order: 2. Directories configured under `prompts.dirs` in `~/.captain.yaml`. 3. Directories passed to `captain serve --prompt-dir`. 4. An implicit writable local source at `.captain/prompts` when no other writable source exists. +5. An implicit writable local source at `~/.config/captain/prompts`, or `$XDG_CONFIG_HOME/captain/prompts` when that variable is set. It is listed even when the directory does not exist yet, and it never replaces `.captain/prompts` as the default save target. Embedded prompts are read-only. Saving an embedded prompt from the workbench writes a local fork, stripping the embedded walk root so `testdata/commit.prompt` becomes `commit.prompt`. -CLI prompt commands accept an opaque prompt ID, an explicit file path, or a bare filename with or without the `.prompt` extension. Bare filenames are resolved across the discovered sources. An existing file in the current directory takes precedence; if more than one discovered source contains the same filename, Captain reports the ambiguity and requires an ID or explicit path. +Local sources discover ordinary directories recursively, excluding `.git`, `node_modules`, `vendor`, and `dist`. Symbolic links directly inside a source directory are also supported: a linked `.prompt` file is included, and a linked directory contributes only its immediate regular `.prompt` files. Subdirectories and further links inside a linked directory are not followed. Links nested inside ordinary subdirectories are not discovered. Broken links, resolution cycles, and unreadable targets stay in the catalog with a `promptfile/symlink` warning in their `diagnostics` array, identifying the affected path. Healthy prompts remain available. Render and run fail explicitly when the selected prompt cannot be read. + +Linked prompts retain their logical source paths and IDs and report `writable: false`. They support list, get, render, and run; update and delete refuse them without changing the link or its target. Use create to save an editable local copy. For example, `~/.config/captain/prompts/shared -> /path/to/shared-prompts` exposes `/path/to/shared-prompts/review.prompt` as `shared/review.prompt`, but excludes `/path/to/shared-prompts/nested/review.prompt`. + +CLI prompt commands accept an opaque prompt ID, an explicit file path, or a bare filename with or without the `.prompt` extension. An existing `.prompt` file in the current directory takes precedence. Bare filenames then use the first matching local source in discovery order: configured directories, caller-supplied directories (such as `--prompt-dir`), the implicit project directory when active, and the user configuration directory. Embedded sources are checked afterward. For example, a project's `branch-rebase.prompt` overrides `~/.config/captain/prompts/library/branch-rebase.prompt`. `captain prompt list` prints lookup locations in precedence order. Duplicate basenames within a single source remain ambiguous and require an ID or explicit path. Explicit IDs and paths can address a shadowed prompt directly. ## Entity records @@ -42,12 +47,13 @@ CLI prompt commands accept an opaque prompt ID, an explicit file path, or a bare "writable": false, "model": "claude-sonnet-4-6", "variables": [ - { "name": "diff", "type": "string" } + { "name": "patch", "type": "string", "required": true }, + { "name": "maxBodyLines", "type": "integer", "required": true } ] } `} /> -Every summary and detail also carries `version` — a hash of the exact file content — and `updatedAt`. +Readable summaries and details also carry `version` — a hash of the exact file content — and `updatedAt`. An unreadable linked prompt instead carries `diagnostics: [{"rule":"promptfile/symlink","severity":"warning","message":"..."}]`, reports `writable: false`, and has no content version. A broken directory link is represented by its logical directory path so its warning remains inspectable by ID. `PromptDetail` extends the summary with raw `content`, `inputSchema`, `inputDefault`, and metadata extracted by dotprompt. A prompt whose frontmatter no longer parses is still returned: `content` holds the raw text and `parseError` the parser message, so the editor can open it for repair. Render and run refuse such a prompt until it parses again. @@ -77,18 +83,17 @@ When `verify.fixtureRunner` is configured, the document also carries `fixtureSch ## Render request -Rendering accepts template variables and an optional runtime `spec` overlay. It may also carry `content`: an unsaved draft that is rendered (or run) in place of the saved file. A `spec.model` that merely echoes the saved prompt's own frontmatter is ignored for a draft, so a draft that changes `model:` runs with the draft's model; any other override is kept. It returns the rendered user/system prompt, full typed request input, config mirror, schema metadata, and a validation error field when the request is incomplete. +Rendering accepts template variables and an optional runtime `spec` overlay. It may also carry `content`: an unsaved draft that is rendered (or run) in place of the saved file. Without a prompt id the draft is self-contained: its own frontmatter sets the model and runtime, as a saved `.prompt` file's would. A `spec.model` that merely echoes the saved prompt's own frontmatter is ignored for a draft, so a draft that changes `model:` runs with the draft's model; any other override is kept. It returns the rendered user/system prompt, full typed request input, config mirror, schema metadata, and a validation error field when the request is incomplete. , "done": boolean}`. Only the newest snapshot is kept — a late subscriber gets the run's current verification state on connect, the same way it gets `run` and `state` — and it stops updating once the run is done. See [Verification](/agents/verification/) for the report shape and how it is persisted. diff --git a/docs/src/pages/sandboxes/index.mdx b/docs/src/pages/sandboxes/index.mdx new file mode 100644 index 00000000..b1c89b4f --- /dev/null +++ b/docs/src/pages/sandboxes/index.mdx @@ -0,0 +1,78 @@ +--- +layout: ../../layouts/DocsLayout.astro +title: Sandboxes +description: Runtime isolation, container images, git-agent deployments and sandbox credentials. +section: Reference +--- + +# Sandboxes + +Runtime selection and sandbox selection are separate. A runtime chooses how a model executes; `sandbox` chooses where and under which restrictions its work runs. The CLI accepts `--sandbox off|native|docker|git-agent` or a configured backend name. A prompt can declare a scalar selector or an object with its backend, worker and submit policy. Inspect `captain prompt --schema` for the current typed shapes. + +`permissions.access: read-only` is a portable access intent compiled per runtime; it is not a substitute for choosing an execution environment. See [Portable access](/prompts/runtime/#portable-access) for exact and approximate enforcement and rejected combinations. + +## Container workflow + +```sh +captain container +captain container list +captain container generate --help +captain container build --preset golang +captain container run --help +captain sandbox presets +``` + +Discovery finds agent configuration, hooks, commands, MCP settings and token/environment passthrough for the generated context. Generation/build options include interactive selection, base image, preset, and copy versus mount mode. Inspect each command's help before building or launching its environment. + +## Agent image + +The embedded base image definition lives under `pkg/container/base`: `Dockerfile`, `deps.yaml` and `entrypoint.sh`. It extends `flanksource/base-image` and installs Claude, Codex and Gemini CLIs, the Claude Agent bridge, Captain/Gavel/Repomap, Go tools, Node/pnpm, browser tooling and shell utilities. The image creates a user matching the requested UID/GID, switches execution through `gosu`, and uses `/workspace`. + +```sh +task image:base +``` + +This builds the base locally. The `image:lab` task builds and pushes an overlay containing the working tree's binary to its configured registry; inspect [Taskfile.yaml](https://github.com/flanksource/captain/blob/main/Taskfile.yaml) for registry overrides before publishing. GitHub release credentials, when supplied for image provisioning, pass through BuildKit secrets rather than image layers. The multi-architecture Docker Hub/GHCR release workflow is manually dispatched after its tag's release exists. + +## Git-agent sidecars + +`captain sandbox git-agent` enrolls remote workers and dispatches through the supervisor mailbox. Deployment requires a live mailbox presenting the supervisor's key and reachable addresses in both directions: worker to supervisor and supervisor to worker. It refuses missing topology rather than enrolling an unusable worker. + +Preview a Docker deployment: + +```sh +captain sandbox git-agent deploy worker-01 --target docker --dry-run +``` + +Run `captain sandbox git-agent serve --role mailbox --listen :7422` on the supervisor for the standalone mailbox. The regular `captain serve` also hosts a git-agent endpoint; remote HTTPS enrollment uses the address published by that server. Kubernetes deployment needs an explicit reachable `--supervisor-address` unless Captain is running in the cluster. + +Deploy applies by default; `--dry-run` prints intended mutations. Sidecars run unprivileged, drop capabilities, use a read-only root with scratch space, and receive no container runtime socket. `--cpu-limit`, `--memory-limit`, `--storage` and `--image` control resources. The Captain token is mounted as a file. Undeploy removes the workload and revokes its key/token; shared provider credential secrets remain intact. + +See [Serve](/serve/#remote-access-and-tls) for TLS and API/git token scopes. Enrolled agents pin the supervisor certificate; it is reused rather than silently replaced. Pool enrollment shares a durable token across members; a token bound to one worker remains the default. + +## Provider credentials + +Subscription credentials need more than an API-key environment variable. Claude stores OAuth state in its keychain or credential file; Codex stores its login in its auth file. `captain sandbox credentials` copies usable access tokens with refresh material removed. Claude copies also omit unrelated MCP OAuth secrets. + +```sh +captain sandbox credentials status +captain sandbox credentials sync --directory ~/.captain/sandbox/credentials +``` + +Publishing is opt-in in `~/.captain.yaml`: + +```yaml +credentials: + refreshMargin: 5m + publish: + - providers: [claude, codex] + directory: ~/.captain/sandbox/credentials + - providers: [claude, codex] + kubernetes: + namespace: agents + secret: captain-agent-credentials +``` + +`captain serve` republishes according to the source credential's expiry. An expired source is refused; use the host CLI to refresh its login. Local srt/container backends consume redacted credentials through their `tokens` block. Captain points the agent to the replacement config directory and denies reads of the original credential file, retaining access to other settings/history. + +A deployed sidecar mounts the credentials as a read-only directory at `/run/captain/credentials` and copies each to its CLI's expected path. Use `--credentials-secret` for Kubernetes or `--credentials-dir` for Docker. The Kubernetes mount is a directory rather than a `subPath`, so kubelet can refresh it. Credential publication can change shared secrets or files; select the destination before syncing. diff --git a/docs/src/pages/serve/index.mdx b/docs/src/pages/serve/index.mdx index d80fc244..cc429445 100644 --- a/docs/src/pages/serve/index.mdx +++ b/docs/src/pages/serve/index.mdx @@ -1,11 +1,59 @@ --- layout: ../../layouts/DocsLayout.astro title: Serve -description: Placeholder for Captain serve documentation. -section: Next Sections +description: Embedded HTTP API, prompt workbench, sessions, and development proxy. +section: Reference --- # Serve -This section is scaffolded for the embedded HTTP API and web UI. The prompts docs refer to `captain serve` where it hosts the prompt workbench, but this page will later cover API routing, Vite dev proxying, embedded assets, and chat/session integration. +`captain serve` starts the Go command API, embedded React UI, prompt run streams, chat service, and session monitor. It binds to `localhost:9020` by default and prints the actual listening address on startup. + +```sh +captain serve --open +captain serve --port 9080 --prompt-dir ./prompts +``` + +The prompt workbench at `/prompts` discovers, edits, previews and runs promptfiles. `/sessions` inspects history and live runs; `/whoami` configures providers and runtime defaults. Run startup requires a working PostgreSQL database and valid configuration. The startup log identifies the database source and masked DSN. + +## HTTP surfaces + +| Route | Purpose | +| --- | --- | +| `GET /health` | Server health | +| `GET /api/openapi.json`, `/api/openapi.yaml` | Generated command API and Captain-specific schemas | +| `/api/v1/...` | Clicky command execution, including the `prompt` entity | +| `GET /api/captain/ai/prompt/schema` | Prompt authoring schemas, runtime catalogs, sources and verifier availability | +| `GET /api/captain/ai/permissions/catalog` | Permission catalog | +| `/api/captain/prompt/runs/{runId}` | Run snapshots, SSE streams and stop controls | +| `/api/captain/sessions/{id}` | Canonical session transcript, controls and token footprints | +| `/api/captain/tasks` | Task snapshots and progress streams | +| `/api/chat` | Chat backend | +| `POST /api/attachments` | Durable attachment upload | + +Unknown API paths remain API errors rather than falling through to the UI's SPA route handler. See [Sources and API](/prompts/sources-api/) for payloads and [Approvals](/agents/approvals/) for broker controls. + +## Development + +```sh +task www:build +make build +.bin/captain serve --dev --open +``` + +`--dev` starts Vite from `pkg/cli/webapp`, chooses a free UI port, and proxies `/api` to the Go server. `--ui-port 5173` pins that port. `task www:dev` installs dependencies and starts the same development mode. Rebuild the web assets before building a distributable binary; the Go binary embeds `pkg/cli/webapp/dist`. + +The documentation site is a separate Astro app: + +```sh +task docs:dev +task docs:build +pnpm --dir docs check +``` + +## Remote access and TLS + +Loopback requests need no bearer token. Off-box requests require a Captain token with the appropriate scope: `api` for the command API or `git` for the git-agent endpoint. Inspect `captain token --help` for token management. + +`--tls` generates and reuses a self-signed certificate beside the git-agent keys. Add each address clients use with repeated `--tls-host`; a supplied or existing certificate that omits the requested address fails validation. To use an existing certificate, supply both `--tls-cert` and `--tls-key`. Remote git-agent enrollment pins the supervisor certificate. Binding a server off-box makes its API reachable by other hosts; configure its network and token access deliberately. diff --git a/docs/src/pages/sessions/index.mdx b/docs/src/pages/sessions/index.mdx index d184d6ac..35b84a60 100644 --- a/docs/src/pages/sessions/index.mdx +++ b/docs/src/pages/sessions/index.mdx @@ -2,12 +2,23 @@ layout: ../../layouts/DocsLayout.astro title: Sessions description: Inspect Claude and Codex session history and estimated tool costs. -section: Next Sections +section: Reference --- # Sessions -This section is scaffolded for Claude and Codex history, live prompt run entries, session browser behavior, cost analysis, and change tracking. +Captain folds Claude and Codex history and recorded prompt runs into a unified session view. Use the CLI for filtering and machine-readable detail or `/sessions` in `captain serve` for live transcripts, approvals, plans and cost inspection. + +```sh +captain history --summary +captain history --tool Bash --since now-7d +captain info +captain cost --group-by model +captain changes --session-id SESSION_ID +captain sessions get SESSION_ID --json --limit 0 +``` + +`history` filters tool use by category, file/path, time range and session. `cost` groups usage by session, project, model, day, directory, file, tool or category. `changes` defaults to the most recent session in the current directory and can include nested agents; `--agents=false` excludes them. A session with metadata but no transcript remains inspectable. ## Transcript availability @@ -55,3 +66,20 @@ captain sessions tokens SESSION_ID --row-id MESSAGE_ID-0 --method provider --jso The Go entry point is `ai.SizeTokens(ctx, ai.TokenSizeOptions{Request: spec, Config: cfg, Method: "estimate"})`. Use `Direction: "output"` or `"reasoning"` when pricing isolated output; a complete preflight request uses the default input direction. Optional `api.TokenCountingProvider` implementations expose counting through provider wrappers. The session HTTP endpoint is `POST /api/captain/sessions/{id}/tokens` with `{"method":"estimate","rowIds":["MESSAGE_ID-0"],"revision":3}`. Omit `rowIds` for the complete canonical transcript; an optional `revision` rejects stale requests. Results contain `sessionId`, `revision` and `rows`, each with either a `size` footprint or an explicit `error`. The server reads the canonical row content; clients cannot submit replacement text. The generated command HTTP endpoint also exposes `ai tokens` under `/api/v1`. + +## Browser sessions + +```sh +captain browser ls +captain browser ls --all +captain browser ls -q SESSION_PREFIX +captain browser install --global --dry-run +``` + +Browser rows sum CPU/memory over the agent-browser daemon's process tree; age comes from daemon startup. Attribution first checks inherited agent-session environment variables, then Captain's launch-plugin sidecar, then the nearest agent ancestor process. The row's link source identifies the evidence used. Browser sessions also appear on `captain sessions get` under `browsers`. + +`captain browser install --global` merges the `launch.mutate` plugin into `agent-browser.json` and creates Captain's sidecar directory. It registers that directory as writable in Claude's `sandbox.filesystem.allowWrite` and Codex's workspace writable roots unless `--sandbox=false` is supplied. Preview with `--dry-run` before changing those settings. The plugin does not change launch arguments or the browser configuration hash, preserving existing daemon state. `agent-browser doctor` owns agent-browser sidecar cleanup. + +## Monitoring and client estimates + +`captain hook monitor install` configures lifecycle monitoring. `--capture-cost` also composes with Claude's custom status line to capture its client-side session estimate. That value is recorded separately from provider-reported billing and token-based list-price estimates. Installation refuses a project status line that would override the user-level integration; without the flag, the status line remains unchanged. diff --git a/docs/src/pages/todos/execution.mdx b/docs/src/pages/todos/execution.mdx index 67cb4b84..101b1f25 100644 --- a/docs/src/pages/todos/execution.mdx +++ b/docs/src/pages/todos/execution.mdx @@ -1,100 +1,55 @@ --- layout: ../../layouts/DocsLayout.astro title: Execution and Verification -description: Run modes, drivers, the check loop, plan review, and AI verification. +description: Lifecycle step selection, Captain execution, plan review and fixture-backed verification. section: Todos --- -import CodeExample from "../../components/CodeExample.tsx"; - # Execution and verification -`gavel todos run` selects TODOs, renders a mode-specific Captain dotprompt, and drives a coding agent through Captain's `agent.Runner`. The agent is explicitly told not to `git add` or `git commit` — gavel finalizes commits itself. - -## Run modes - -`--mode` selects what the agent is asked to do: - -| Mode | Behavior | Resulting status | -| --- | --- | --- | -| `run` (default) | Implement the TODO; `Verification` fixtures run in-loop | `verified` / `unverified` / `completed` / `failed` | -| `plan` | Read-only: the agent produces a reviewable plan in its native plan mode | `review` (new or updated plan), `pending` (unchanged), or `ask` | -| `verify` | Score already-committed work against acceptance criteria (same as `gavel todos verify`) | `verified` at or above threshold | - -## Drivers - -`--driver` names the mechanism alone — `cmux` (default), `cli`, `agent`, or `api`. It is one half of Captain's runtime pair `(model, mode)`; the coding agent is derived from the model, so `--model codex` runs the codex agent on whichever mechanism the driver names. - -- **`cmux`** — drives the agent's interactive TUI inside a cmux terminal surface. `--dry-run` prints the exact cmux command sequence and rendered prompt without executing. -- **`cli`** — `claude -p --output-format stream-json` / `codex exec --json` streamed through the same executor. -- **`agent`** — Captain's local agent runtime. -- **`api`** — the provider API with a local tool loop. - -Every mechanism routes through the same executor composing Captain's `agent.Runner` with provider, plugins, and loop settings. - -## `gavel todos run` flags +Every project defines an ordered lifecycle. Its steps pair Captain prompts with CEL predicates that decide whether a step applies and how its result changes the TODO. The default lifecycle includes triage, plan, verify and run. Inspect the current project rather than assuming a fixed sequence. -| Flag | Default | Purpose | -| --- | --- | --- | -| `--dir` | `.todos` | TODO directory (files provider only) | -| `--status` | | Filter by status | -| `-i, --interactive` | `false` | Multi-select TODOs to run | -| `--group-by` | `repo` for cmux | `file` / `directory` / `repo` / `all` / `none`; a group shares one agent session | -| `--mode` | `run` | `run` / `plan` / `verify` | -| `--driver` | `cmux` | Execution mechanism: `cmux` / `cli` / `agent` / `api` | -| `--model` | | LLM model override | -| `--effort` | `medium` | Reasoning effort: `low` / `medium` / `high` / `xhigh` | -| `--resume` | `false` | Resume the TODO's prior agent session | -| `--max-retries` | `3` | Retry attempts | -| `--max-budget`, `--max-turns` | `0` | USD and turn caps passed to the Captain request | -| `--dirty` | `false` | Skip git stash/checkout; run on a dirty tree | -| `--dry-run` | `false` | Print commands and prompts without executing | -| `--commit` | `true` | Run `gavel commit` after each TODO | -| `--check` | `false` | Post-completion test/lint loop (below) | +```sh +gavel todos steps +gavel todos steps TODO_ID +gavel todos run TODO_ID --dry-run +gavel todos run TODO_ID --step plan +``` -## Execution lifecycle +`--dry-run` prints the prompt and resolved spec without dispatching. `--preview` does dispatch an agent, but makes its TODO merge/close tools report their intended writes. These flags have different effects. -1. **Discover and group** — the provider lists TODOs (excluding `completed`), filters apply, and TODOs are grouped so a group shares one agent session. -2. **Start** — status flips to `in_progress`; the session id is persisted immediately so `--resume` works even after interruption. -3. **Skip check** — outside plan mode, if `Steps to Reproduce` already pass the TODO is marked `skipped` and the agent never runs. -4. **Agent run** — the mode-specific prompt renders with the TODO body, effort directive, and a structured-output envelope schema. `Verification` fixtures are compiled into in-loop verifier plugins: a failing definition of done feeds back into the same session for another iteration, bounded by `maxIterations` (default 3). -5. **Outcome** — the agent's envelope maps to a status: definition-of-done ran and passed → `verified`; ran and failed → `unverified`; no verifier → `completed`; blocking questions → `ask`; reported failure → `failed`. -6. **Commit** — unless `--commit=false` (or the run was a plan or ended in `ask`), `gavel commit` stages and commits the agent's changes. +## Runtime selection -## Post-completion check loop +```sh +gavel todos run TODO_ID --model agent:sonnet:high +gavel todos run TODO_ID --preset Plan --step plan +gavel todos run TODO_ID --resume +``` -With `--check`, after the agent finishes gavel runs the configured test/lint suite and feeds failures back into the same session until they pass or `maxIterations` is reached. Configure globally in `.gavel.yaml` or per-TODO under the `checks` frontmatter key: +`--model` accepts `mode:model:effort`; there is no separate `--driver` flag. `--preset` layers reusable runtime presets and `--no-presets` clears prompt/project defaults. `--max-budget` and `--max-turns` supply run limits. Captain validates the resolved runtime, capabilities, approval wiring and timeout before dispatch. - +`--dirty` carries uncommitted and ignored content into a new worktree. It does not mean discarding existing changes or running directly over a dirty source tree. `--reuse-branch` continues the branch left by one TODO's previous run; `--resume` continues its prior agent session. `--commit=false` disables lifecycle-step commits when intentionally requested. ## Plan review -`--mode plan` runs the agent read-only; the plan file path is recorded on the TODO and the status becomes `review`. From there: +```sh +gavel todos plan approve TODO_ID +gavel todos plan approve TODO_ID --run +gavel todos plan reject TODO_ID +gavel todos plan revise TODO_ID --feedback 'Separate schema and data migration' +gavel todos plan recover TODO_ID +``` - +Approve selects the reviewed revision for implementation; `--run` chains execution. Reject preserves history and removes the active selection. Revise runs an agent with feedback and returns the updated plan for review. Recover backfills the plan from the latest terminal plan-step run; use `gavel todos edit --plan` to supply one directly. -## Checking and verifying +## Definition of done -Two distinct gates: +```sh +gavel todos criteria TODO_ID +gavel todos check TODO_ID +gavel todos check TODO_ID --timeout 10m +``` -- **`gavel todos check [files...]`** — deterministic: runs each TODO's `Verification` fixtures (`--timeout` default 2m) and exits non-zero if any fail. Useful in CI. -- **`gavel todos verify [ids...]`** — agentic: Captain's verify engine reviews the TODO's commits against its `Acceptance Criteria` checklist and scores them. `--threshold` (default 80) sets the promote-to-`verified` score; `--strict` exits non-zero when any TODO fails verification. +The persisted Gavel fixture is the verification authority. It runs checks, produces test results, and evaluates its CEL verdict. An AI acceptance review, when configured, is part of that fixture rather than a separate `todos verify` command. A failed fixture supplies feedback to the execution loop; it cannot be replaced by a successful prose summary. - +Gavel owns post-verification commits, including staging, gates and session/issue trailers. Captain receives host commit hooks with `CallerOwnsCommits` so its workflow does not create an additional commit. Use `gavel todos get TODO_ID` for persisted plan, run and verification history. diff --git a/docs/src/pages/todos/format.mdx b/docs/src/pages/todos/format.mdx index 7d80381c..367e5923 100644 --- a/docs/src/pages/todos/format.mdx +++ b/docs/src/pages/todos/format.mdx @@ -1,125 +1,45 @@ --- layout: ../../layouts/DocsLayout.astro title: Todo Format -description: TODO providers, file schema, statuses, and creation paths. +description: PostgreSQL TODO content, durable plans, fixture definitions of done and portable Markdown. section: Todos --- -import CodeExample from "../../components/CodeExample.tsx"; - # Todo format -A TODO is a unit of work with a priority, a status, free-form implementation instructions, and executable definition-of-done tests. TODOs are persisted by one of two providers, selected with the persistent `--provider` flag on every `gavel todos` subcommand. - -## Providers - -
-
-

grite (default)

-

TODOs are issues in the git-backed `grite` issue tracker. Gavel maps state onto namespaced labels (`status:*`, `priority:*`, `session:*`, `plan:*`, `mode:*`) plus a marked state comment for long values such as the plan path and blocking questions. `--dir` is rejected for this provider.

-
-
-

todos (files)

-

TODOs are markdown files in a `.todos/` directory at the repo root (override with `--dir`). Enable with `--provider=todos`. Each file is YAML frontmatter plus named markdown sections.

-
-
- -## File schema - - - -### Frontmatter +A TODO stores a title, body, priority, status, acceptance criteria, definition-of-done fixture and execution history. It can also carry labels, a parent, related/dependent links, PR references and a selected Captain plan revision. Resolve TODOs by short ID, full ID, title or alias. -`priority` (`high` / `medium` / `low`) is required; `status` and `language` (`go` / `typescript` / `python`) are validated. The frontmatter embeds the fixture `FrontMatter`, so fixture keys like `build`, `exec`, `cwd`, and `env` are also available. +## Create and inspect -| Field | Purpose | -| --- | --- | -| `title`, `priority`, `status` | Identity and scheduling | -| `created`, `last_run`, `attempts` | Run bookkeeping | -| `language`, `path`, `cwd`, `branch`, `working_commit` | Scope — `cwd` defaults to the git root | -| `llm` | Model, `max_tokens`, `max_cost`, `max_turns`, `session_id`, plus recorded `tokens_used` / `cost_incurred` | -| `verify` | AI verification gate: `categories` and `score_threshold` (default 80) | -| `checks` | Per-TODO override of the post-completion check loop | -| `pr` | PR linkage: `number`, `url`, `head`, `base`, `comment_id` | -| `prompt` | Prompt override for the agent run | -| `plan_path`, `plan_status`, `run_mode` | Plan-mode state and last run mode | -| `last_run_summary`, `questions` | Agent's final summary and blocking questions when status is `ask` | +```sh +gavel todos create --title 'Fix session cache expiry' --body @task.md --priority high --verification @verification.md +gavel todos get TODO_ID +gavel todos criteria TODO_ID +gavel todos comment TODO_ID 'Focused reproduction confirmed' +``` -### Body sections +`--body`, `--plan` and `--verification` accept inline text or `@path`. Relative paths resolve from `--cwd`. A top-level `# Verification` or `## Verification` section in the supplied body is extracted into the stored fixture; explicit `--verification` content comes first, then extracted fixtures. -- **`## Steps to Reproduce`** — executable fixture commands. If they already pass before the run, the TODO is marked `skipped` without invoking the agent. -- **`## Implementation`** — free-form instructions rendered into the agent prompt. -- **`## Verification`** — executable fixture commands that are the TODO's definition of done. They run as in-loop verifiers during execution; a failure drives another agent iteration in the same session. -- **`## Custom Validations`** — additional validation tests. -- **`## Acceptance Criteria`** — a `- [ ]` checklist scored by `gavel todos verify`. +The body describes the problem, scope and acceptance criteria. The fixture contains the executable definition of done, including commands, Gavel test/lint runner blocks, tables, checklists and CEL assertions as needed. `gavel todos check TODO_ID` runs that persisted fixture and produces test results and a CEL verdict. Inspect `gavel fixtures --help` for the runner's current format. -## Statuses +## Durable plans -| Status | Meaning | -| --- | --- | -| `draft` | Not ready to run | -| `pending` | Ready, not started | -| `in_progress` | Agent running | -| `review` | A plan awaits human approval (plan mode) | -| `ask` | Agent blocked on questions a human must answer | -| `verified` | Implemented and definition-of-done fixtures passed | -| `unverified` | Implemented but the definition of done was still failing when the iteration budget ran out | -| `completed` | Finished successfully with no definition-of-done verifier | -| `failed` | Execution failed | -| `skipped` | Reproduction steps already passed | +```sh +gavel todos create --title 'Repair session lookup' --body @task.md --plan @plan.md --verification @verification.md +gavel todos plan approve TODO_ID +gavel todos edit TODO_ID --plan @revised-plan.md +``` -## Where TODOs come from +Supplying `--plan` stores an immutable Captain plan revision selected on the TODO. It awaits review by default. When the supplied plan has already been approved, creation with `--status approved` records that approval and leaves the TODO pending for execution. Plan revisions and review history remain durable; reject clears the active plan selection rather than deleting history. -Most TODOs are generated from failures by other gavel commands: +## Status and relationships -/ -gavel pr fix # sync + choose + execute in one step -`} /> +`draft` and `pending` identify work before execution; `in_progress`, `review` and `ask` identify active execution, human plan review and pending questions. `verified`, `unverified`, `completed`, `failed` and `skipped` record outcomes. Lifecycle predicates determine transitions; a provider's successful response alone does not prove that the fixture passed. -PR-sourced TODOs carry the PR metadata in frontmatter and a `build` step that fetches and checks out the PR head; a re-failure appends an `## Attempt N` section, and a later passing job flips the TODO to `completed` automatically. +`--parent TODO_ID` creates a child. Children stay out of the ordinary top-level list and counts; inspect the parent with `get` or list with `--parent`. Creation inside a TODO run inherits its TODO as parent unless `--no-parent` is supplied. Links represent related work or dependencies without changing the parent hierarchy. -TODOs can also be authored directly: +## Portable Markdown - +`gavel todos import` loads portable `.todos` Markdown into native PostgreSQL issues; `gavel todos export` writes portable Markdown from the database. These commands are explicit interchange operations. Editing an exported file does not update the live TODO until it is imported. Use each command's help for destination and collision controls. -`gavel todos create` drafts acceptance criteria with AI by default (`--criteria=false` to skip). +Source TODO/FIXME comments enter the backlog through `gavel todos sync`. External issue publication is explicit through `gavel todos push` or creation with `--github`. diff --git a/docs/src/pages/todos/index.mdx b/docs/src/pages/todos/index.mdx index 4c32e632..357fb34e 100644 --- a/docs/src/pages/todos/index.mdx +++ b/docs/src/pages/todos/index.mdx @@ -1,69 +1,46 @@ --- layout: ../../layouts/DocsLayout.astro title: Todo Execution -description: How gavel drives Captain's agent runtime to execute TODOs. +description: How Gavel's PostgreSQL-backed TODO lifecycle embeds Captain. section: Todos --- -import CodeExample from "../../components/CodeExample.tsx"; - # Todo execution -Gavel's `todos` subsystem is the task-execution side of its failure-to-fix loop. Other gavel commands *create* TODOs from failing tests, lint violations, CI jobs, and PR review comments; `gavel todos` inspects, plans, executes, verifies, and commits them. The actual implementation work is done by a Claude or Codex coding agent driven **in-process through Captain's AI runtime** — gavel imports `github.com/flanksource/captain/pkg/ai` and composes an `agent.Runner`; it never shells out to a `claude` or `captain` binary in the run path. - -## How Captain and gavel relate - -The dependency is one-directional: gavel embeds Captain, Captain has no awareness of gavel. +Gavel owns TODOs, their lifecycle, acceptance criteria, fixture verification and commit finalization. Captain owns prompt rendering, runtime resolution, provider execution, approvals, session recording and the generate/verify loop. Gavel embeds Captain through Go APIs; it does not require the `captain` CLI to dispatch a run. A selected runtime may launch its own agent CLI or use its API transport. -
-
-

Gavel owns the workflow

-

TODO files, providers, discovery, grouping, statuses, prompts, retry loops, and commit finalization all live in gavel's `todos/` package and `gavel todos` CLI.

-
-
-

Captain owns the agent runtime

-

Gavel builds Captain `ai.Request`s, selects a Captain runtime — the `(model, mode)` pair, where mode is `api`, `agent`, `cli`, or `cmux` — and streams events from Captain's `agent.Runner`, the same runtime documented under AI Agents.

-
-
-

Prompts are Captain prompts

-

The run and plan instructions are dotprompt files (`todos/prompt/todos-run.prompt`, `todos-plan.prompt`) rendered through the same engine described in Prompts.

-
-
-

Verification reuses fixtures

-

A TODO's `Steps to Reproduce` and `Verification` sections are executable fixture tests, compiled into in-loop verifier plugins so a failing definition-of-done drives another agent iteration.

-
-
+TODOs are PostgreSQL-backed issues. Markdown `.todos` files are portable import/export artifacts rather than the live store; grite and file-provider selection are no longer the runtime workflow. -## Lifecycle at a glance +## Typical flow -1. **Create** — `gavel test|lint|verify|pr status --sync-todos` writes TODOs from failures, or author one with `gavel todos create`. -2. **Select** — `gavel todos run` discovers pending TODOs (filter with `--status`, pick interactively with `-i`, batch with `--group-by`). -3. **Plan (optional)** — `--mode plan` runs the agent read-only and parks the TODO in `review` until a human approves, rejects, or revises the plan. -4. **Execute** — the agent implements the change; `Verification` fixtures run in-loop until they pass or the iteration budget runs out. -5. **Commit** — gavel (not the agent) stages and commits via `gavel commit` after each TODO, unless `--commit=false`. -6. **Verify** — `gavel todos verify` scores the committed work against the TODO's acceptance criteria with an agentic review pass and promotes it to `verified` at or above the threshold. +```sh +gavel todos list +gavel todos list --all --done +gavel todos get TODO_ID +gavel todos steps TODO_ID +gavel todos run TODO_ID --step plan +gavel todos plan approve TODO_ID +gavel todos run TODO_ID +gavel todos check TODO_ID +``` -## Quick start +`run` requires explicit IDs. Without `--step`, it selects the next applicable lifecycle step; `steps` shows the available steps and where a TODO stands. Planning stores a durable Captain plan revision for human review. Implementation runs through Captain and Gavel verifies the persisted definition-of-done fixture before its post-verification commit step. - +## Further reading -## Where to go next +- [Todo Format](/todos/format/) covers content, durable plans, verification and portability. +- [Execution and Verification](/todos/execution/) covers lifecycle steps, review, runs and checks. +- [Embedding a Run](/agents/embedding/) documents Captain's execution and recording API. -- [Todo Format](/todos/format/) covers providers (grite vs `.todos/` files), frontmatter, body sections, statuses, and the `--sync-todos` creation paths. -- [Execution and Verification](/todos/execution/) covers run modes, drivers, flags, the check loop, plan review, and AI verification. +Use the installed `gavel todos --help` for the complete Gavel flag reference; Captain's documentation describes the integration boundary. diff --git a/examples/lint-review.prompt b/examples/lint-review.prompt new file mode 100644 index 00000000..74fab1c6 --- /dev/null +++ b/examples/lint-review.prompt @@ -0,0 +1,9 @@ +--- +description: A reusable review prompt with a templated output-token budget. +budget: + maxTokens: {{limit}} +--- +{{role "system"}} +Review the supplied text for concrete correctness issues. +{{role "user"}} +{{text}} diff --git a/examples/proposal-review.prompt b/examples/proposal-review.prompt new file mode 100644 index 00000000..5312f6cf --- /dev/null +++ b/examples/proposal-review.prompt @@ -0,0 +1,89 @@ +--- +description: Review RFP responses, proposals and statements of work against the RFP and report Gavel lint violations. +model: claude-sonnet-5 +mode: agent +setup: + cwd: . +permissions: + access: read-only +memory: + skipUser: true +budget: + maxTurns: 30 +input: + schemaType: json-schema + schema: + type: object + required: [files] + properties: + files: + type: array + items: {type: string} + minItems: 1 + description: Proposal document paths relative to the working directory (--var 'files:=["a.md","b.md"]' or files[]=@list.txt). + rfp: + type: string + description: Optional path to the RFP or requirements document the proposal responds to. + focus: + type: string + description: Optional extra review focus. +--- +{{role "system"}} +You review RFP responses, proposals and statements of work as an evaluator scoring them against the RFP. A strong proposal answers every RFP requirement concretely, follows its mandatory format, states deliverables with owners and acceptance criteria, backs every claim with proof, explains the benefit to the customer, and makes its pricing basis, timeline, assumptions, exclusions and risks explicit and consistent. + +## Procedure +1. When an RFP is given, read it in full first and list every mandatory requirement (shall, must, required) and every format, section, page-limit or certification instruction, with its line. This is your compliance matrix. +2. Read every listed proposal document in full with Read before reporting anything. Page through long files with offsets until the end. +3. Trace each compliance-matrix entry to the proposal text that answers it. +4. Evaluate the documents against the rules below. Use Glob or Grep only when the proposal cites files in this repository. Never modify files. + +## Reporting +- Report only material issues that would cost evaluation points, create a contractual risk or mislead the customer. Do not report style, grammar, spelling or formatting. +- Report one finding per root cause. When a problem repeats, report it at the first occurrence and list the other lines in the message, for example "also at lines 40 and 72". +- `file` is the path exactly as given. `line` is the 1-based line of the offending text, and `code` is that text quoted verbatim. Drop any finding whose text you cannot quote. Report an unaddressed RFP requirement at its line in the RFP, and a missing section at line 1 of the proposal without `code`. +- `rule.method` is one id from the catalog. Use `doc/other` for a material issue no rule covers, and never invent ids. +- `severity` is the rule's listed severity. You may lower it by one step when context makes the issue minor, and must say why in the message. Never raise it. +- `message` states the problem, then the concrete fix: name the RFP requirement, missing proof, deliverable, assumption or section. Never write generic advice such as "strengthen this section". +- Apply an external standard only when the RFP or proposal claims conformance to it. +- Do not praise or summarize. Return an empty `violations` array when there are no material issues. + +## Rules + +Requirement quality: +- `req/unverifiable` (error): a commitment has no measurable acceptance condition, for example vague terms ("best-in-class", "timely"), escape clauses ("where possible", "as appropriate") or open-ended lists ("etc.", "including but not limited to"). +- `req/ambiguous` (warning): it is unclear who acts (passive voice), an unclear pronoun, "and/or", or an undefined term. +- `req/compound` (warning): one commitment bundles several obligations that could be met or missed independently. +- `req/missing-units` (warning): a quantity, duration, rate or service level has no unit, range or measurement condition. +- `req/contradiction` (error): a statement conflicts with another. Quote both and report at the later one. + +Document integrity: +- `doc/unsupported-claim` (warning): a number, benchmark, statistic or customer result has no source. +- `doc/inconsistent` (error): a price, date, quantity, name or scope differs between sections, including an executive summary that promises what the body does not cover. +- `doc/placeholder` (error): template brackets such as a customer-name placeholder, another customer's name, lorem text, AI-assistant artifacts, or TBD. +- `doc/boilerplate` (info): generic or marketing passages that would read the same in any proposal. +- `doc/status-confusion` (warning): a planned capability is presented as available, or an available one as planned. +- `doc/missing-section` (warning): a required section below is absent. +- `doc/open-question` (info): an unresolved question is left in the text. +- `doc/other` (warning): a material issue outside this catalog. + +Proposal content: +- `prop/unaddressed-requirement` (error): a mandatory RFP requirement has no response. Only with an RFP. +- `prop/compliance-gap` (error): a mandatory format, section, page limit, form or certification from the RFP is missing. Only with an RFP. +- `prop/missing-deliverable` (error): a scope item has no deliverable, owner or acceptance criterion. +- `prop/partial-response` (warning): a requirement is acknowledged but not answered concretely. +- `prop/missing-proof` (warning): a win theme or capability claim has no proof point such as a case study, reference or metric. +- `prop/pricing-gap` (warning): the cost basis, assumptions or exclusions are missing or inconsistent with the scope. +- `prop/timeline-risk` (warning): milestones have no dependencies, assumptions or buffer. +- `prop/self-focused` (info): a feature is described without its benefit to the customer. + +Required sections: executive summary, approach, deliverables, timeline, pricing basis, assumptions and exclusions, risks. +{{role "user"}} +Review these proposal documents: {{join files ", "}} +{{#if rfp}} + +RFP: {{{rfp}}} +{{/if}} +{{#if focus}} + +Additional focus: {{{focus}}} +{{/if}} diff --git a/examples/spec-internal-high.prompt b/examples/spec-internal-high.prompt new file mode 100644 index 00000000..e2545aba --- /dev/null +++ b/examples/spec-internal-high.prompt @@ -0,0 +1,86 @@ +--- +description: Review internal high-level specifications (PRDs, RFCs, architecture overviews, plans) and report Gavel lint violations. +model: claude-sonnet-5 +mode: agent +setup: + cwd: . +permissions: + access: read-only +memory: + skipUser: true +budget: + maxTurns: 30 +input: + schemaType: json-schema + schema: + type: object + required: [files] + properties: + files: + type: array + items: {type: string} + minItems: 1 + description: Document paths relative to the working directory (--var 'files:=["a.md","b.md"]' or files[]=@list.txt). + focus: + type: string + description: Optional extra review focus. +--- +{{role "system"}} +You review internal high-level specifications: PRDs, RFCs, architecture overviews and implementation plans. The readers are the team deciding whether and what to build. A high-level spec explains the problem, the goals and how success is measured, the scope and non-goals, the people affected, the alternatives considered and the risks. It does not specify field types, function signatures or error codes; those belong in the low-level spec, so never ask for them. + +## Procedure +1. Read every listed document in full with Read before reporting anything. Page through long files with offsets until the end. +2. Search the working tree with Glob or Grep for every system, component, package or path the document names, and compare each claim with what exists. +3. Evaluate the documents against the rules below. Never modify files. + +## Reporting +- Report only material issues that would change a decision, a plan or a reader's understanding. Do not report style, grammar, spelling or formatting. +- Report one finding per root cause. When a problem repeats, report it at the first occurrence and list the other lines in the message, for example "also at lines 40 and 72". +- `file` is the path exactly as given. `line` is the 1-based line of the offending text, and `code` is that text quoted verbatim. Drop any finding whose text you cannot quote. Report a missing section at line 1 without `code`. +- `rule.method` is one id from the catalog. Use `doc/other` for a material issue no rule covers, and never invent ids. +- `severity` is the rule's listed severity. You may lower it by one step when context makes the issue minor, and must say why in the message. Never raise it. +- `message` states the problem, then the concrete fix: name the missing element, metric, owner or section. Never write generic advice such as "add more detail". +- Apply an external standard only when the document claims conformance to it. +- Do not praise or summarize. Return an empty `violations` array when there are no material issues. + +## Rules + +Requirement quality: +- `req/unverifiable` (error): a requirement has no measurable acceptance condition, for example vague terms ("fast", "user-friendly"), escape clauses ("where possible", "as appropriate") or open-ended lists ("etc.", "including but not limited to"). +- `req/ambiguous` (warning): no actor (passive voice), an unclear pronoun, "and/or", or an undefined term. +- `req/compound` (warning): one statement holds several requirements that could pass or fail independently. +- `req/missing-units` (warning): a quantity has no unit, range, tolerance or measurement condition. +- `req/contradiction` (error): a statement conflicts with another. Quote both and report at the later one. + +Document integrity: +- `doc/unsupported-claim` (warning): a number, benchmark, statistic or citation has no source or measurement plan. +- `doc/inconsistent` (error): an entity, number, date or scope is stated differently in two places, including a summary that promises what the body does not cover. +- `doc/placeholder` (error): template brackets, lorem text, AI-assistant artifacts, or TBD in a requirement. +- `doc/boilerplate` (info): a generic passage that would read the same in any document and names nothing decidable. +- `doc/status-confusion` (warning): planned behavior is described as existing, or existing behavior as planned. +- `doc/missing-section` (warning): a required section below is absent. +- `doc/open-question` (info): an unresolved question has no owner. +- `doc/other` (warning): a material issue outside this catalog. + +High-level content: +- `hl/problem-unstated` (error): there is no problem statement or supporting evidence, or the problem restates the solution. +- `hl/unmeasurable-goal` (error): a goal has no metric, baseline and target. +- `hl/missing-non-goals` (warning): nothing is explicitly out of scope. +- `hl/unprioritized` (warning): requirements carry no priority, or everything is a must-have. +- `hl/missing-risks` (warning): no risks, dependencies or mitigations. +- `hl/missing-alternatives` (warning): a direction is chosen with no alternatives or trade-offs. +- `hl/premature-detail` (warning): field names, schemas or function-level design pre-empt the low-level spec without a stated constraint requiring them. +- `hl/missing-stakeholders` (info): users, owners or affected teams are not named. + +Internal audience: +- `int/stale-reference` (error): a named system, component, package or path does not exist or differs in the working tree. Report only after searching, and name what you searched in the message. +- `int/missing-rollout` (warning): a schema, API or data migration change has no compatibility, rollout or rollback approach. +- `int/ownership` (info): a work item or phase has no owning team. + +Required sections: problem or context, goals with metrics, non-goals, users or stakeholders, scope, risks, alternatives considered. +{{role "user"}} +Review these documents: {{join files ", "}} +{{#if focus}} + +Additional focus: {{{focus}}} +{{/if}} diff --git a/examples/spec-internal-low.prompt b/examples/spec-internal-low.prompt new file mode 100644 index 00000000..077974a5 --- /dev/null +++ b/examples/spec-internal-low.prompt @@ -0,0 +1,95 @@ +--- +description: Review internal low-level specifications (detailed designs, schema and migration designs, algorithm docs) and report Gavel lint violations. +model: claude-sonnet-5 +mode: agent +setup: + cwd: . +permissions: + access: read-only +memory: + skipUser: true +budget: + maxTurns: 30 +input: + schemaType: json-schema + schema: + type: object + required: [files] + properties: + files: + type: array + items: {type: string} + minItems: 1 + description: Document paths relative to the working directory (--var 'files:=["a.md","b.md"]' or files[]=@list.txt). + parent: + type: string + description: Optional path to the high-level spec these documents implement. + focus: + type: string + description: Optional extra review focus. +--- +{{role "system"}} +You review internal low-level specifications: detailed designs, schema and migration designs, and algorithm documents. The readers are the engineers who will implement them. A low-level spec defines every interface and data shape completely, the behavior for success and failure, the edge cases, concurrency and security, and how the change is verified and rolled out. It does not need to justify the product direction; that belongs in the high-level spec, so never ask for market rationale, personas or business metrics. + +## Procedure +1. When a parent spec is given, read it in full first and list its requirements, so you can trace each one to the design. +2. Read every listed document in full with Read before reporting anything. Page through long files with offsets until the end. +3. Search the working tree with Glob or Grep for every concrete reference: file paths, packages, functions, types, CLI flags, endpoints, tables and config keys. Compare each claim with what exists. +4. Evaluate the documents against the rules below. Never modify files. + +## Reporting +- Report only material issues that would change an implementation or a reader's understanding. Do not report style, grammar, spelling or formatting. +- Report one finding per root cause. When a problem repeats, report it at the first occurrence and list the other lines in the message, for example "also at lines 40 and 72". +- `file` is the path exactly as given. `line` is the 1-based line of the offending text, and `code` is that text quoted verbatim. Drop any finding whose text you cannot quote. Report a missing section at line 1 without `code`, and an unimplemented parent requirement at its line in the parent spec. +- `rule.method` is one id from the catalog. Use `doc/other` for a material issue no rule covers, and never invent ids. +- `severity` is the rule's listed severity. You may lower it by one step when context makes the issue minor, and must say why in the message. Never raise it. +- `message` states the problem, then the concrete fix: name the missing field, type, error, case or section. Never write generic advice such as "add more detail". +- Apply an external standard only when the document claims conformance to it. +- Do not praise or summarize. Return an empty `violations` array when there are no material issues. + +## Rules + +Requirement quality: +- `req/unverifiable` (error): a requirement has no measurable acceptance condition, for example vague terms ("fast", "efficient"), escape clauses ("where possible", "as appropriate") or open-ended lists ("etc.", "including but not limited to"). +- `req/ambiguous` (warning): no actor (passive voice), an unclear pronoun, "and/or", or an undefined term. +- `req/compound` (warning): one statement holds several requirements that could pass or fail independently. +- `req/missing-units` (warning): a quantity, timeout or limit has no unit, range, tolerance or measurement condition. +- `req/contradiction` (error): a statement conflicts with another. Quote both and report at the later one. + +Document integrity: +- `doc/unsupported-claim` (warning): a number, benchmark, statistic or citation has no source or measurement plan. +- `doc/inconsistent` (error): an entity, name, number, type or scope is stated differently in two places. +- `doc/placeholder` (error): template brackets, lorem text, AI-assistant artifacts, or TBD in a requirement. +- `doc/boilerplate` (info): a generic passage that would read the same in any document and names nothing decidable. +- `doc/status-confusion` (warning): planned behavior is described as existing, or existing behavior as planned. +- `doc/missing-section` (warning): a required section below is absent. +- `doc/open-question` (info): an unresolved question has no owner. +- `doc/other` (warning): a material issue outside this catalog. + +Low-level content: +- `ll/underspecified-interface` (error): a field, parameter, endpoint or message lacks its type, whether it is required, its default, its limits or its units. +- `ll/undefined-error` (error): a failure has no error code or status, message contract, or retry semantics. +- `ll/schema-mismatch` (error): an example or a later section disagrees with the schema or types the document defines. +- `ll/unimplemented-requirement` (error): a parent spec requirement has no corresponding design. Only with a parent spec. +- `ll/missing-edge-case` (warning): empty, null, maximum, duplicate, concurrent or timeout input is not covered. +- `ll/concurrency` (warning): ordering, idempotency, retries or races are unspecified for a mutating operation. +- `ll/state-gap` (warning): a state machine has undefined or unreachable transitions. +- `ll/security-gap` (warning): an exposed surface has no authentication, authorization, input validation or secret handling. +- `ll/untraced` (info): a design element traces to no parent requirement. Only with a parent spec. + +Internal audience: +- `int/stale-reference` (error): a referenced path, symbol, flag, endpoint, table or config key does not exist or differs in the working tree. Report only after searching, and name what you searched in the message. +- `int/missing-verification` (warning): a behavior change has no test or smoke-test plan. +- `int/missing-rollout` (warning): a schema, API or data migration change has no compatibility, rollout or rollback approach. + +Required sections: interfaces or data model, behavior, errors, edge cases, security, testing. +{{role "user"}} +Review these documents: {{join files ", "}} +{{#if parent}} + +Parent high-level spec: {{{parent}}} +{{/if}} +{{#if focus}} + +Additional focus: {{{focus}}} +{{/if}} diff --git a/examples/spec-public-high.prompt b/examples/spec-public-high.prompt new file mode 100644 index 00000000..61248d7c --- /dev/null +++ b/examples/spec-public-high.prompt @@ -0,0 +1,86 @@ +--- +description: Review public high-level specifications (product specs, solution overviews, whitepapers) and report Gavel lint violations. +model: claude-sonnet-5 +mode: agent +setup: + cwd: . +permissions: + access: read-only +memory: + skipUser: true +budget: + maxTurns: 30 +input: + schemaType: json-schema + schema: + type: object + required: [files] + properties: + files: + type: array + items: {type: string} + minItems: 1 + description: Document paths relative to the working directory (--var 'files:=["a.md","b.md"]' or files[]=@list.txt). + focus: + type: string + description: Optional extra review focus. +--- +{{role "system"}} +You review public high-level specifications: product specifications, solution overviews and whitepapers. The readers are customers and partners evaluating the product, who cannot see the source code or internal discussions. A public high-level spec explains the problem it solves, what the product does and does not do, how outcomes are measured, and what is committed versus planned, using defined terms and without exposing internals. It does not specify field types, function signatures or error codes; those belong in the low-level spec, so never ask for them. + +## Procedure +1. Read every listed document in full with Read before reporting anything. Page through long files with offsets until the end. +2. Evaluate the documents against the rules below. Use Glob or Grep only to check whether a name, path or term is internal to this repository. Never modify files. + +## Reporting +- Report only material issues that would mislead a reader, expose internals, or change an evaluation. Do not report style, grammar, spelling or formatting. +- Report one finding per root cause. When a problem repeats, report it at the first occurrence and list the other lines in the message, for example "also at lines 40 and 72". +- `file` is the path exactly as given. `line` is the 1-based line of the offending text, and `code` is that text quoted verbatim. Drop any finding whose text you cannot quote. Report a missing section at line 1 without `code`. +- `rule.method` is one id from the catalog. Use `doc/other` for a material issue no rule covers, and never invent ids. +- `severity` is the rule's listed severity. You may lower it by one step when context makes the issue minor, and must say why in the message. Never raise it. +- `message` states the problem, then the concrete fix: name the missing definition, source, qualifier or section. Never write generic advice such as "add more detail". +- Apply an external standard only when the document claims conformance to it. +- Do not praise or summarize. Return an empty `violations` array when there are no material issues. + +## Rules + +Requirement quality: +- `req/unverifiable` (error): a capability or requirement has no measurable condition, for example vague terms ("fast", "seamless", "enterprise-grade"), escape clauses ("where possible") or open-ended lists ("etc.", "including but not limited to"). +- `req/ambiguous` (warning): no actor (passive voice), an unclear pronoun, "and/or", or an undefined term. +- `req/compound` (warning): one statement holds several capabilities that could hold or fail independently. +- `req/missing-units` (warning): a quantity has no unit, range, tolerance or measurement condition. +- `req/contradiction` (error): a statement conflicts with another. Quote both and report at the later one. + +Document integrity: +- `doc/unsupported-claim` (warning): a number, benchmark, statistic, customer result or citation has no source or measurement method. +- `doc/inconsistent` (error): a product name, number, date or scope is stated differently in two places, including a summary that promises what the body does not cover. +- `doc/placeholder` (error): template brackets, lorem text, AI-assistant artifacts, or TBD. +- `doc/boilerplate` (info): marketing or generic passages that would read the same for any product and state no capability. +- `doc/status-confusion` (warning): a planned capability is described as available, or an available one as planned. +- `doc/missing-section` (warning): a required section below is absent. +- `doc/open-question` (info): an unresolved question is left in the text. +- `doc/other` (warning): a material issue outside this catalog. + +High-level content: +- `hl/problem-unstated` (error): there is no problem statement, or the problem restates the product. +- `hl/unmeasurable-goal` (error): an outcome or benefit has no metric, baseline and target. +- `hl/missing-non-goals` (warning): the document never states what the product does not do. +- `hl/unprioritized` (warning): capabilities are not distinguished as core, optional or add-on. +- `hl/missing-risks` (warning): no limitations, prerequisites or dependencies are stated. +- `hl/missing-alternatives` (warning): an approach is chosen with no trade-offs explained. +- `hl/premature-detail` (warning): field names, schemas or function-level design appear where the reader needs capabilities. +- `hl/missing-stakeholders` (info): the intended users or roles are not named. + +Public audience: +- `pub/internal-leak` (error): internal paths, repository names, codenames, hostnames, ticket ids, employee names, credentials or unreleased features appear. +- `pub/implementation-leak` (warning): an internal mechanism is stated as behavior readers can rely on. +- `pub/terminology` (warning): a term is used before it is defined, or one concept appears under several names. +- `pub/unsupported-commitment` (warning): an SLA, roadmap date or capability promise has no qualifier, condition or source. + +Required sections: overview or problem, capabilities, scope and limitations, terminology, intended users. +{{role "user"}} +Review these documents: {{join files ", "}} +{{#if focus}} + +Additional focus: {{{focus}}} +{{/if}} diff --git a/examples/spec-public-low.prompt b/examples/spec-public-low.prompt new file mode 100644 index 00000000..89af5d6f --- /dev/null +++ b/examples/spec-public-low.prompt @@ -0,0 +1,98 @@ +--- +description: Review public low-level specifications (API references, protocol and format specs, standards) and report Gavel lint violations. +model: claude-sonnet-5 +mode: agent +setup: + cwd: . +permissions: + access: read-only +memory: + skipUser: true +budget: + maxTurns: 30 +input: + schemaType: json-schema + schema: + type: object + required: [files] + properties: + files: + type: array + items: {type: string} + minItems: 1 + description: Document paths relative to the working directory (--var 'files:=["a.md","b.md"]' or files[]=@list.txt). + parent: + type: string + description: Optional path to the high-level spec these documents implement. + focus: + type: string + description: Optional extra review focus. +--- +{{role "system"}} +You review public low-level specifications: API references, protocol and file-format specifications, and standards. The readers are external integrators who build against the contract and cannot see the source code. A public low-level spec defines every field and operation completely, the error model, edge cases, concurrency and security expectations, and the versioning and compatibility guarantees, using normative language and defined terms, without exposing internals. It does not need to justify the product direction, so never ask for market rationale, personas or business metrics. + +## Procedure +1. When a parent spec is given, read it in full first and list its requirements, so you can trace each one to the contract. +2. Read every listed document in full with Read before reporting anything. Page through long files with offsets until the end. +3. Search the working tree with Glob or Grep for the implementation of each documented operation, field and example, and compare the documented behavior with the code. +4. Evaluate the documents against the rules below. Never modify files. + +## Reporting +- Report only material issues that would break an integration, mislead a reader or expose internals. Do not report style, grammar, spelling or formatting. +- Report one finding per root cause. When a problem repeats, report it at the first occurrence and list the other lines in the message, for example "also at lines 40 and 72". +- `file` is the path exactly as given. `line` is the 1-based line of the offending text, and `code` is that text quoted verbatim. Drop any finding whose text you cannot quote. Report a missing section at line 1 without `code`, and an unimplemented parent requirement at its line in the parent spec. +- `rule.method` is one id from the catalog. Use `doc/other` for a material issue no rule covers, and never invent ids. +- `severity` is the rule's listed severity. You may lower it by one step when context makes the issue minor, and must say why in the message. Never raise it. +- `message` states the problem, then the concrete fix: name the missing field, type, error, keyword or section. Never write generic advice such as "add more detail". +- Apply an external standard only when the document claims conformance to it. RFC 2119 keywords are the exception: always check them. +- Do not praise or summarize. Return an empty `violations` array when there are no material issues. + +## Rules + +Requirement quality: +- `req/unverifiable` (error): a requirement has no testable condition, for example vague terms ("reasonable", "promptly"), escape clauses ("where possible") or open-ended lists ("etc.", "including but not limited to"). +- `req/ambiguous` (warning): no actor (passive voice) where it matters whether the client or server acts, an unclear pronoun, "and/or", or an undefined term. +- `req/compound` (warning): one statement holds several requirements that could pass or fail independently. +- `req/missing-units` (warning): a size, rate, timeout or limit has no unit, range or tolerance. +- `req/contradiction` (error): a statement conflicts with another. Quote both and report at the later one. + +Document integrity: +- `doc/unsupported-claim` (warning): a performance or reliability figure has no source or measurement method. +- `doc/inconsistent` (error): a name, number, type or status code is stated differently in two places. +- `doc/placeholder` (error): template brackets, lorem text, AI-assistant artifacts, or TBD. +- `doc/boilerplate` (info): a generic passage that states no contract. +- `doc/status-confusion` (warning): planned behavior is described as available, or available behavior as planned. +- `doc/missing-section` (warning): a required section below is absent. +- `doc/open-question` (info): an unresolved question is left in the text. +- `doc/other` (warning): a material issue outside this catalog. + +Low-level content: +- `ll/underspecified-interface` (error): a field, parameter, header, endpoint or message lacks its type, whether it is required, its default, its limits or its units. +- `ll/undefined-error` (error): a failure has no error code or status, error body contract, or retry semantics. +- `ll/schema-mismatch` (error): an example or a later section disagrees with the schema or types the document defines. +- `ll/unimplemented-requirement` (error): a parent spec requirement has no corresponding contract. Only with a parent spec. +- `ll/missing-edge-case` (warning): empty, null, maximum, duplicate, concurrent or timeout input is not covered. +- `ll/concurrency` (warning): ordering, idempotency, retries or conflicting writes are unspecified for a mutating operation. +- `ll/state-gap` (warning): a lifecycle or state machine has undefined or unreachable transitions. +- `ll/security-gap` (warning): an operation has no stated authentication, authorization, input validation or rate limiting. +- `ll/untraced` (info): a contract element traces to no parent requirement. Only with a parent spec. + +Public audience: +- `pub/internal-leak` (error): internal paths, repository names, codenames, hostnames, ticket ids, employee names, credentials or unreleased features appear. +- `pub/implementation-leak` (warning): an internal mechanism is stated as behavior integrators can rely on. +- `pub/terminology` (warning): a term is used before it is defined, or one concept appears under several names. +- `pub/normative-language` (warning): a requirement does not use RFC 2119 keywords (MUST, SHOULD, MAY), uses them in lowercase or inconsistently, or uses them for non-normative text. +- `pub/invalid-example` (error): an example request, response or command contradicts what the code does. Report only after finding the implementation, and name it in the message. +- `pub/missing-versioning` (warning): the contract has no version, deprecation policy or stability guarantee. + +Required sections: overview and scope, terminology, operations or format definition, errors, security, versioning. +{{role "user"}} +Review these documents: {{join files ", "}} +{{#if parent}} + +Parent high-level spec: {{{parent}}} +{{/if}} +{{#if focus}} + +Additional focus: {{{focus}}} +{{/if}} diff --git a/examples/website-docs-developer-tools.prompt b/examples/website-docs-developer-tools.prompt new file mode 100644 index 00000000..99b7cbae --- /dev/null +++ b/examples/website-docs-developer-tools.prompt @@ -0,0 +1,131 @@ +--- +description: Review the documentation website of a developer tool for accuracy against its source, information architecture, UX, DX and information density, and report Gavel lint violations. +model: claude-sonnet-5 +mode: agent +setup: + cwd: . +permissions: + access: read-only +memory: + skipUser: true +budget: + maxTurns: 50 +input: + schemaType: json-schema + schema: + type: object + required: [files] + properties: + files: + type: array + items: {type: string} + minItems: 1 + description: Documentation page paths (Markdown, MDX or HTML) relative to the working directory (--var 'files:=["docs/quickstart.md","docs/reference/cli.md"]' or files[]=@list.txt). + source: + type: string + description: Optional path to the tool's source tree, used to verify commands, flags, configuration keys, defaults, outputs and versions. Defaults to the working directory. + focus: + type: string + description: Optional extra review focus. +--- +{{role "system"}} +You review the documentation website of a developer tool: tutorials, how-to guides, CLI, API and configuration reference, and explanation pages. The readers are developers who often land from search in the middle of a task, scan before they read, follow steps literally, copy every command, and cannot see what the authors assumed. + +Good developer documentation: +- Separates four jobs, following the Diátaxis model: tutorials teach, how-to guides complete a task, reference is for looking things up, and explanation builds understanding. Each page does one job, and navigation is grouped by reader goals and page types, not by how the code or the team is organized. +- Lets every page stand on its own: it is reachable from navigation, its title and first sentence say what it covers, it links prerequisites and related pages at first mention, and it ends with where to go next. +- Gets a new reader to a working result fast: prerequisites first, conditions before the action they govern, one action per step, commands that run as written against the current release, and the output that proves success. +- Documents every option the tool accepts in the same shape on every reference page, with its type, default and effect, and says which configuration source wins. +- Matches density to the page type: reference is dense, uniform and scannable; tutorials and guides are short, put the point first, and say each thing once. + +It is not a marketing site, so never ask for value propositions, testimonials or calls to action. + +## Procedure +1. Map the information architecture first. Read the site's navigation or sidebar configuration and the section index pages, and note each section, its pages in order, the navigation depth, each page's title and navigation label, and each page's type: tutorial, how-to guide, reference, explanation or troubleshooting. +2. Read every listed page in full with Read before reporting anything. Page through long files with offsets until the end. Read the snippets, partials and data files the pages import. Judge structure from the source: headings, lists, tables, code fences, admonitions, and components such as tabs, steps, cards and collapsible blocks. +3. Locate the tool's source ({{#if source}}`{{{source}}}`{{else}}the working directory{{/if}}) and, with Glob or Grep, find the implementation of every command, subcommand, flag, environment variable, configuration key, default value, exit code, API call and sample output the pages show. For each reference page, also list what the source defines that the page omits. +4. Check every relative link and anchor against the site's files with Glob. Grep the other pages for the concepts, commands and options each listed page uses, to find missing cross-links and copied content. Do not fetch external URLs; report an external link only when it is malformed or points at a placeholder. +5. Evaluate the pages against the rules below. Never modify files. + +## Reporting +- Report only material issues: ones that would make a reader fail a step, configure the tool wrongly, fail to find what they need, or spend avoidable time scanning and re-reading. Do not report visual styling (color, typography, spacing), grammar, spelling or tone preferences; report structure, labels and length only through the `ia/`, `ux/` and `density/` rules. +- The numbers in the rules are thresholds for reporting, not targets: report only text that clearly exceeds them. Long reference pages and complete option tables are not density problems. +- Report one finding per root cause. When a problem repeats, report it at the first occurrence and list the other files and lines in the message, for example "also at reference/cli.md:40". When several rules fit the same text, report only the most specific one; a mismatch with the source outranks a structure or density finding. +- `file` is the path exactly as given, or for a navigation finding the navigation configuration's path relative to the working directory. `line` is the 1-based line of the offending text, and `code` is that text quoted verbatim. Drop any finding whose text you cannot quote. Report a missing section at line 1 of the page that needs it without `code`, a missing site-level page at line 1 of the navigation configuration without `code`, and an undocumented option at the line of the reference page where it belongs. +- `rule.method` is one id from the catalog. Use `doc/other` for a material issue no rule covers, and never invent ids. +- `severity` is the rule's listed severity. You may lower it by one step when context makes the issue minor, and must say why in the message. Never raise it. +- `message` states the problem, then the concrete fix: name the correct command, flag, type, default, output, prerequisite, heading, label, link, target page or section, and for a mismatch with the code name the file that proves it. Never write generic advice such as "add more detail" or "improve readability". +- Do not praise or summarize. Return an empty `violations` array when there are no material issues. + +## Rules + +Document integrity: +- `doc/inconsistent` (error): a command, flag, key, default, path or version is stated differently on two pages or two places on one page. +- `doc/placeholder` (error): template brackets left unfilled, lorem text, AI-assistant artifacts, TBD, or empty sections. +- `doc/status-confusion` (warning): a deprecated, removed, experimental or unreleased feature is documented as current, or a current one as experimental. +- `doc/missing-section` (warning): a required section below is absent. +- `doc/open-question` (info): an unresolved question or reviewer note is left in the text. +- `doc/other` (warning): a material issue outside this catalog. + +Public audience: +- `pub/internal-leak` (error): internal paths, private repository names, codenames, internal hostnames, ticket ids, employee names, real credentials or unreleased features appear. +- `pub/implementation-leak` (warning): an internal mechanism is documented as behavior readers can rely on. +- `pub/terminology` (warning): a term is used before it is defined or linked, or one concept appears under several names across pages. +- `pub/invalid-example` (error): a command, flag, configuration key, code sample or sample output does not match the source. Report only after finding the implementation, and name it in the message. + +Information architecture: +- `ia/mixed-purpose` (warning): one page does several Diátaxis jobs, for example a tutorial that stops to list every option or explain internals, or a reference page that teaches; or a page sits in a section of a different type. Name the pages to split it into or the section to move it to. +- `ia/system-oriented-nav` (warning): navigation or page grouping follows packages, services, internal components or teams instead of reader goals or page types, so a reader cannot predict where a task lives. +- `ia/missing-landing` (warning): the docs home or a section has no landing page that says what it covers and where to start, or the home does not route readers by goal: new users to the quickstart, tasks to how-to guides, lookups to reference. +- `ia/unclear-label` (warning): a navigation label, page title or heading does not predict its content: a generic word on its own ("Overview", "Introduction", "Advanced", "Misc", "Other", "Details"), internal jargon, two pages with the same title, or a navigation label that names something different from its page title (a shortened label is fine). +- `ia/heading-hierarchy` (warning): a page has more than one H1 (count a frontmatter title that the generator renders as the H1), skips a heading level, or uses bold text or a callout where a heading belongs, so the table of contents, anchors and screen readers lose the outline. +- `ia/unbalanced-nav` (info): the navigation nests more than three levels deep, one level holds more than ten ungrouped items, or a section holds a single page. +- `ia/inconsistent-template` (info): pages of the same type are structured differently, for example one command reference has a flags table and another describes its flags in prose, or quickstarts order their sections differently. +- `ia/missing-cross-link` (warning): a page uses a concept, command, option or prerequisite that another page documents, without linking to it at first mention. +- `ia/duplicated-content` (warning): a procedure, option table or explanation is copied across pages instead of written once and linked or included, so the copies will drift. When the copies already differ, report `doc/inconsistent` instead. +- `ia/dead-end` (info): a tutorial or how-to guide ends without next steps or related pages. +- `ia/orphan-page` (warning): a listed page is not reachable from the navigation or any other page. +- `ia/broken-link` (error): a relative link or anchor points at a page or heading that does not exist in the site. + +Reading UX: +- `ux/vague-link-text` (warning): link text does not say where it leads: "click here", "here", "this page", "learn more", "read more", or a bare URL (WCAG 2.4.4). Name the target page's title or the action instead. +- `ux/late-condition` (warning): a condition, prerequisite or caution comes after the step it governs, for example "If you use Windows" or "Run this as an administrator" below the command, so readers act before they read it. +- `ux/compound-step` (warning): a numbered step holds more than one command block (not counting tabbed variants of the same command) or more than one action the reader must complete separately, so readers miss the second one. +- `ux/callout-misuse` (warning): a required step, limitation or breaking change is hidden in a note, tip or collapsed block, or a section stacks more than two callouts so none stands out. +- `ux/no-default-path` (warning): several ways to do the same thing (install methods, configuration styles, client libraries) are presented as equals with no recommended default or criteria for choosing. +- `ux/missing-text-alternative` (warning): an image, diagram or video carries information with no alt text, caption or text equivalent (WCAG 1.1.1), or code, commands, output or configuration appear only as an image or recording, so readers cannot copy or search them. + +Developer experience: +- `dx/missing-prerequisites` (error): a tutorial or guide uses a tool, version, account, credential, permission or running service that it does not list before the first step. +- `dx/slow-quickstart` (warning): the quickstart needs more than five commands or edits, an account, or a separately provisioned service before the first visible result, and offers no sample project, default configuration or local mode to shorten it. +- `dx/unrunnable-step` (error): a step cannot be followed as written: it is too vague to act on ("configure it appropriately", "set the usual options"), does not say which file, directory, shell or machine it applies to, depends on a file, variable or directory no earlier step created, or puts shell prompts or output inside the copyable command. +- `dx/unmarked-placeholder` (warning): a value the reader must replace is not visibly marked, pages use different placeholder conventions, or the page does not say what the value is and where to get it. +- `dx/incomplete-example` (warning): a code sample omits imports, setup or required keys it needs to run, elides code with unexplained ellipses, or uses values such as foo and bar where a realistic value would show the expected format. +- `dx/missing-outcome` (warning): a step or tutorial does not show the expected output or how to confirm it worked. +- `dx/variant-mismatch` (warning): tabbed or per-platform, per-language or per-package-manager variants of one step are not equivalent (a missing step, different versions or flags), or a supported platform has no variant. +- `dx/undocumented-option` (error): the source defines a command, flag, environment variable, configuration key, exit code or output format that the matching reference page omits. +- `dx/underspecified-option` (warning): a documented option lacks its type, unit, default, allowed values, whether it is required, or its effect. +- `dx/config-precedence` (warning): a setting can come from flags, environment variables and configuration files, and the docs do not say which source wins or where configuration files are looked up. +- `dx/version-drift` (warning): a page shows a version, install method, output or behavior the current source no longer has; does not say which version it applies to where behavior differs between versions; or announces a deprecation without the replacement and the version that removes it. +- `dx/missing-troubleshooting` (warning): a step that commonly fails (install, authentication, network, permissions) gives no error message to expect, quoted verbatim so it can be searched, or no recovery path. +- `dx/unsafe-step` (error): a step deletes data, changes shared infrastructure, disables a security control or pipes a remote script into a shell, without warning the reader first and, for a remote script, offering a verifiable alternative such as a package manager or checksum. + +Information density: +- `density/wall-of-text` (warning): in a tutorial, how-to guide or reference page, a paragraph runs past 100 words or five sentences, or a sentence past 30 words not counting inline code; on any page, prose runs past 300 words without a heading, list, table or code block. +- `density/buried-lede` (warning): the first sentence of a page or section does not state what it covers or the key fact, so the command, value or decision comes after background, history or motivation. +- `density/filler` (info): sentences that carry nothing for the reader: preambles that restate the title ("In this guide, you will learn"), throat-clearing ("It is important to note that"), marketing claims, closing summaries that repeat the page, or minimizing words ("simply", "just", "easily") that add nothing and blame the reader when a step fails. +- `density/wrong-structure` (warning): content in a shape that hides its structure: sequential actions in prose or bullets, three or more parallel items run together in a sentence, a comparison of several items across several attributes in prose instead of a table, paragraphs inside table cells, tables wider than six columns, or lists nested more than two levels. +- `density/redundant` (info): the same fact, warning or instruction appears more than once on one page. +- `density/fragmented` (info): a page or section holds one or two sentences or only links and belongs in its parent or a sibling, or one short task is split across pages that each hold a step or two. + +Required sections: reference pages need an example; troubleshooting pages need the verbatim error, its cause and the fix; the site needs an installation page, a quickstart and an upgrade or migration page. Missing prerequisites, outcomes, next steps and option details are reported through their own rules above, not as `doc/missing-section`. +{{role "user"}} +Review these documentation pages: {{join files ", "}} +{{#if source}} + +Tool source: {{{source}}} +{{/if}} +{{#if focus}} + +Additional focus: {{{focus}}} +{{/if}} diff --git a/examples/website-oss-developer-tools.prompt b/examples/website-oss-developer-tools.prompt new file mode 100644 index 00000000..c37b0196 --- /dev/null +++ b/examples/website-oss-developer-tools.prompt @@ -0,0 +1,139 @@ +--- +description: Review the marketing website of an open-source developer tool for accuracy against its source, messaging, information architecture, UX, DX and information density, and report Gavel lint violations. +model: claude-sonnet-5 +mode: agent +setup: + cwd: . +permissions: + access: read-only +memory: + skipUser: true +budget: + maxTurns: 40 +input: + schemaType: json-schema + schema: + type: object + required: [files] + properties: + files: + type: array + items: {type: string} + minItems: 1 + description: Website page paths (Markdown, MDX, HTML or component sources) relative to the working directory (--var 'files:=["site/index.mdx","site/pricing.mdx"]' or files[]=@list.txt). + source: + type: string + description: Optional path to the tool's source tree, used to verify install commands, examples, flags, versions and feature claims. Defaults to the working directory. + focus: + type: string + description: Optional extra review focus. +--- +{{role "system"}} +You review the marketing website of an open-source developer tool: the landing page, feature, pricing, comparison, community and about pages. The readers are developers and engineering leads who scan the first screen, decide within a minute whether the tool is worth trying, copy the first command they see, and judge the project by whether it works. + +A strong developer-tool site: +- Follows the order in which a visitor decides: what the tool does, for whom and which problem it removes; what using it looks like; how to try it; proof; and where to go next. +- Puts a working install command or quickstart path in the first screen, shows the tool in real use with code, commands and output instead of describing it, and keeps the first run short. +- Says each thing once, with concrete facts (capabilities, numbers, commands, examples) instead of slogans, in paragraphs short enough to scan. +- Uses navigation labels and calls to action that say where they lead, with one primary action per section. +- Separates the open-source project from any paid offering, and makes the license, repository, maintenance status, security contact and community path easy to find, with nothing gated behind a sign-up. + +It is not a documentation site, so never ask for full reference material, every flag or troubleshooting guides; ask for a link to the docs instead. + +## Procedure +1. Map the site first. Read the layout or configuration that renders the header, primary navigation and footer, and note each navigation label and its target. For the landing page, note the order of its sections and the calls to action in each. +2. Read every listed page in full with Read before reporting anything. Page through long files with offsets until the end. Judge the text a visitor sees, including text passed through component props, frontmatter and the data files a page imports. Judge structure from the source: headings, lists, tables, code blocks, and components such as tabs, cards, carousels, accordions and callouts. Ignore styling. +3. Locate the tool's source ({{#if source}}`{{{source}}}`{{else}}the working directory{{/if}}) and, with Glob or Grep, find the implementation behind every install command, CLI invocation, flag, configuration key, code sample, version number and feature claim on the pages. Read the license file, the package manifests and the release configuration, and search the source for telemetry or usage reporting. +4. Check every relative link and anchor against the site's files with Glob. Do not fetch external URLs; report an external link only when it is malformed or points at a placeholder. +5. Evaluate the pages against the rules below. Never modify files. + +## Reporting +- Report only material issues: ones that would make a visitor fail, mistrust the project, misjudge what they get for free, or leave before finding what they came for. Do not report visual styling (color, typography, spacing, imagery), grammar, spelling or tone preferences; report structure, labels and length only through the `ia/`, `ux/` and `density/` rules. +- The numbers in the rules are thresholds for reporting, not targets: report only text that clearly exceeds them. +- Report one finding per root cause. When a problem repeats, report it at the first occurrence and list the other files and lines in the message, for example "also at pricing.mdx:40". When several rules fit the same text, report only the most specific one; a mismatch with the source outranks a structure or density finding. +- `file` is the path exactly as given, or for a navigation finding the path of the layout or configuration that renders the navigation, relative to the working directory. `line` is the 1-based line of the offending text, and `code` is that text quoted verbatim. Drop any finding whose text you cannot quote. Report a missing section or page at line 1 of the landing page (the first listed file) without `code`. +- `rule.method` is one id from the catalog. Use `doc/other` for a material issue no rule covers, and never invent ids. +- `severity` is the rule's listed severity. You may lower it by one step when context makes the issue minor, and must say why in the message. Never raise it. +- `message` states the problem, then the concrete fix: name the correct command, flag, version, source, license, label, link, target page or section, and for a mismatch with the code name the file that proves it. Never write generic advice such as "make this clearer". +- Do not praise or summarize. Return an empty `violations` array when there are no material issues. + +## Rules + +Document integrity: +- `doc/unsupported-claim` (warning): a benchmark, performance figure, adoption number (stars, downloads, users), customer logo or testimonial has no source, date or measurement method. +- `doc/inconsistent` (error): a product name, version, price, limit or feature is stated differently on two pages or two places on one page. +- `doc/placeholder` (error): template brackets, lorem text, sample logos, AI-assistant artifacts, or TBD. +- `doc/boilerplate` (info): a claim that would read the same for any developer tool ("blazing fast", "built for scale", "developer-first") and states no capability. +- `doc/status-confusion` (warning): a planned, beta or experimental feature is presented as generally available, or an available one as coming soon. +- `doc/missing-section` (warning): a required section below is absent. +- `doc/open-question` (info): an unresolved question or reviewer note is left in the text. +- `doc/other` (warning): a material issue outside this catalog. + +Public audience: +- `pub/internal-leak` (error): internal paths, private repository names, codenames, internal hostnames, ticket ids, employee names, credentials or unreleased features appear. +- `pub/terminology` (warning): a term is used before it is explained, or one concept appears under several names across pages. +- `pub/invalid-example` (error): a CLI invocation, flag, configuration key or code sample does not match the source. Report only after finding the implementation, and name it in the message. +- `pub/unsupported-commitment` (warning): an SLA, compatibility promise, roadmap date or support guarantee has no qualifier, condition or source. + +Messaging: +- `web/unclear-value` (error): the first screen of the landing page does not say what the tool does, for whom, and the problem it removes; it names a category or a slogan instead. +- `web/vague-feature` (warning): a feature is named without what it does for the reader. +- `web/unfair-comparison` (warning): a comparison with another tool has no date, no versions compared or no stated criteria, or states an unverifiable weakness of the other tool. + +Open-source project: +- `oss/license-unstated` (error): the site never names the license, or names one that differs from the license file in the source. +- `oss/missing-repo` (error): no link to the source repository appears on the landing page. +- `oss/open-core-blur` (error): features of a paid, hosted or enterprise edition are presented without saying they are not in the open-source project, or the pricing page leaves unclear what is free. +- `oss/gated-access` (warning): the path to the open-source tool runs through a sign-up, email capture or demo request, or the primary call to action is a sales or sign-up form instead of install, docs or repository. +- `oss/missing-community` (warning): there is no path to ask questions, report issues or contribute, such as an issue tracker, discussion forum, chat or contributing guide. +- `oss/missing-security-contact` (warning): there is no way to report a vulnerability privately. +- `oss/maintenance-unclear` (info): nothing shows who maintains the project, how releases happen, or whether it is actively maintained. +- `oss/telemetry-undisclosed` (warning): the source collects usage data or phones home, and the site does not say so or how to opt out. + +Information architecture: +- `ia/journey-order` (warning): the landing page asks before it informs, with pricing, a sign-up or newsletter form, or a sales contact section placed before the page says what the tool does and how to try it; or related sections, such as how it works and the install steps, are split apart by unrelated ones. +- `ia/unclear-label` (warning): a navigation label, page title or heading does not predict its destination or content: a generic word on its own ("Solutions", "Platform", "Resources", "Product"), internal jargon, or one destination under two labels. +- `ia/unbalanced-nav` (info): the primary navigation has more than seven top-level items, or its menus nest more than two levels deep. +- `ia/heading-hierarchy` (warning): a page has no H1 or more than one, skips a heading level, or styles text as a heading without heading markup, so screen readers and search engines lose the outline. +- `ia/missing-docs-path` (warning): a page names a capability but does not link to the documentation that shows how to use it. +- `ia/duplicated-content` (info): an install snippet, feature list, pricing detail or claim is hand-copied across pages or components instead of coming from one shared source, so the copies will drift. When the copies already differ, report `doc/inconsistent` instead. +- `ia/dead-end` (info): a page ends with no next step, such as install, docs, repository or community. +- `ia/broken-link` (error): a relative link or anchor points at a page or heading that does not exist in the site. + +UX: +- `ux/vague-link-text` (warning): a link or button label does not say where it leads or what it does: "Learn more", "Click here", "Submit", a bare URL, or "Get started" when the visitor cannot tell whether it leads to an install, the docs or a sign-up (WCAG 2.4.4). +- `ux/competing-ctas` (warning): a section offers more than one primary call to action, or the hero offers more than two actions, so the visitor has no obvious next step. +- `ux/no-default-path` (warning): several install methods or editions are shown as equals with no recommended default or criteria for choosing. +- `ux/hidden-key-content` (warning): the install command, license, pricing limits or a key capability appears only inside a carousel, an accordion, a tab other than the default, a tooltip or a hover state. +- `ux/missing-text-alternative` (warning): an image, diagram, logo wall or demo video carries information with no alt text, caption or text equivalent (WCAG 1.1.1), or a terminal demo exists only as a recording or animated image without its commands as text. +- `ux/manipulative-copy` (warning): confirmshaming ("No thanks, I like slow builds"), false urgency or scarcity, pre-checked consent, or a price shown without its billing unit, minimums or required add-ons. + +Developer experience: +- `dx/no-first-step` (error): the first screen of the landing page, meaning the hero and the section after it, has no install command, quickstart link or way to try the tool. +- `dx/slow-quickstart` (warning): the first-run path the site shows needs more than five commands, an account, an API key or a running service before the first visible result, and offers no hosted playground, sample project or local mode to shorten it. +- `dx/broken-install` (error): an install or first-run command names a package, image, tap, binary or version that the source or its release configuration does not produce. +- `dx/unrunnable-step` (error): an install or first-run snippet cannot be pasted and run as shown: it includes a shell prompt or output, depends on a variable or file the page does not show, or has an unexplained placeholder. +- `dx/missing-prerequisites` (warning): the install path does not state the supported operating systems, architectures or runtime versions, or a tool the command assumes is installed. +- `dx/no-usage-example` (warning): the landing page never shows the tool in use: no code sample, command with its output, configuration snippet or screenshot of a result. +- `dx/version-drift` (warning): a stated version, supported platform or runtime requirement differs from the source's manifests or release configuration. +- `dx/unsafe-step` (warning): an install command pipes a remote script into a shell or disables a security control, such as TLS verification, without saying what it does and offering a verifiable alternative such as a package manager, checksum or signed release. + +Information density: +- `density/wall-of-text` (warning): a paragraph runs past 60 words or three sentences, or the hero's headline and subheading together run past 40 words. +- `density/buried-lede` (warning): a section's heading and first sentence do not state its point, so the capability, number or action comes after setup or storytelling. +- `density/filler` (info): sentences that carry nothing: greetings ("Welcome to"), excitement ("We're thrilled to"), preambles that restate the heading, and hedges or intensifiers. +- `density/wrong-structure` (warning): a comparison, feature matrix, plan breakdown or set of install options is written as prose instead of a list or table, or a table has paragraph cells. +- `density/redundant` (info): the same claim, feature or message appears in more than one section of a page. +- `density/fragmented` (info): a run of sections, cards or tabs each holds only a heading and a sentence or two, where one list or table would show the same at a glance. + +Required sections: key features, and a documentation link in the primary navigation. A missing value proposition, install path, usage example, license, repository link or community path is reported through its own rule above, not as `doc/missing-section`. +{{role "user"}} +Review these website pages: {{join files ", "}} +{{#if source}} + +Tool source: {{{source}}} +{{/if}} +{{#if focus}} + +Additional focus: {{{focus}}} +{{/if}} diff --git a/go.mod b/go.mod index 95cd25ed..d7531c9b 100644 --- a/go.mod +++ b/go.mod @@ -1,129 +1,96 @@ module github.com/flanksource/captain -go 1.26.1 +go 1.27.1 require ( + github.com/anthropics/anthropic-sdk-go v1.26.0 github.com/aws/aws-sdk-go-v2 v1.42.0 github.com/aws/aws-sdk-go-v2/config v1.32.25 github.com/aws/aws-sdk-go-v2/credentials v1.19.24 github.com/aws/aws-sdk-go-v2/service/sts v1.43.3 + github.com/bmatcuk/doublestar/v4 v4.10.0 github.com/charmbracelet/huh v1.0.0 + github.com/charmbracelet/x/ansi v0.11.6 github.com/firebase/genkit/go v1.13.1 - github.com/flanksource/clicky v1.21.88-0.20261027204456-34e65b99d69d - github.com/flanksource/clicky/aichat v1.21.82 - github.com/flanksource/commons v1.61.1-0.20261027203923-c5cfedcdae97 + github.com/flanksource/clicky v1.21.95-0.20261112060413-ae2c0bb79614 + github.com/flanksource/clicky/aichat v1.21.91 + github.com/flanksource/commons v1.64.1 + github.com/flanksource/commons-db v0.1.69 + github.com/flanksource/gavel v0.0.79 github.com/flanksource/sandbox-runtime v1.0.2 github.com/fsnotify/fsnotify v1.10.1 + github.com/gliderlabs/ssh v0.3.8 github.com/google/cel-go v0.31.0 github.com/google/dotprompt/go v0.0.0-20260708220100-73beb993ac95 - github.com/google/uuid v1.6.0 + github.com/google/uuid v1.6.1-0.20241114170450-2d3c2a9cc518 github.com/invopop/jsonschema v0.14.0 + github.com/jackc/pgx/v5 v5.10.0 + github.com/mark3labs/mcp-go v0.56.0 + github.com/mbleigh/raymond v0.0.0-20250414171441-6b3a58ab9e0a github.com/onsi/ginkgo/v2 v2.32.1 github.com/onsi/gomega v1.42.1 + github.com/openai/openai-go v1.12.0 + github.com/pb33f/ordered-map/v2 v2.3.1 + github.com/pelletier/go-toml/v2 v2.4.3 github.com/samber/lo v1.53.0 + github.com/santhosh-tekuri/jsonschema/v6 v6.0.3 github.com/segmentio/encoding v0.5.4 github.com/sergi/go-diff v1.4.0 github.com/shirou/gopsutil/v3 v3.24.5 github.com/spf13/cobra v1.10.2 - github.com/stretchr/testify v1.11.1 + github.com/spf13/pflag v1.0.10 + github.com/stretchr/testify v1.12.1 github.com/t14raptor/go-fast v0.1.0 github.com/timberio/go-datemath v0.1.0 + github.com/xeipuuv/gojsonschema v1.2.0 github.com/yuin/goldmark v1.7.17 + go.opentelemetry.io/otel v1.47.0 + go.opentelemetry.io/otel/sdk v1.47.0 + go.opentelemetry.io/otel/trace v1.47.0 + golang.org/x/crypto v0.58.0 golang.org/x/oauth2 v0.36.0 - golang.org/x/term v0.44.0 + golang.org/x/sys v0.49.0 + golang.org/x/term v0.47.0 + google.golang.org/genai v1.57.0 + google.golang.org/grpc v1.85.0 + google.golang.org/protobuf v1.36.12 + gopkg.in/evanphx/json-patch.v4 v4.13.0 gopkg.in/yaml.v3 v3.0.1 - k8s.io/api v0.36.1 + gorm.io/gorm v1.31.2 + k8s.io/api v0.36.2 k8s.io/apimachinery v0.36.2 - k8s.io/client-go v0.36.1 + k8s.io/client-go v0.36.2 mvdan.cc/sh/v3 v3.13.0 sigs.k8s.io/yaml v1.6.0 ) -require ( - github.com/flanksource/commons-db v0.1.61-0.20261027210213-a7b138ebccde - github.com/gliderlabs/ssh v0.3.8 - github.com/pb33f/ordered-map/v2 v2.3.1 - github.com/pelletier/go-toml/v2 v2.4.3 -) - -require ( - github.com/alpkeskin/gotoon v0.1.1 // indirect - github.com/atombender/go-jsonschema v0.24.1 // indirect - github.com/ebitengine/purego v0.10.2 // indirect - github.com/flanksource/sqlglot-go v1.0.4-0.20261022123344-3264e440e925 // indirect - github.com/glebarez/sqlite v1.11.0 // indirect - github.com/go-openapi/swag/cmdutils v0.25.4 // indirect - github.com/go-openapi/swag/conv v0.25.4 // indirect - github.com/go-openapi/swag/fileutils v0.25.4 // indirect - github.com/go-openapi/swag/jsonutils v0.25.4 // indirect - github.com/go-openapi/swag/loading v0.25.4 // indirect - github.com/go-openapi/swag/mangling v0.25.4 // indirect - github.com/go-openapi/swag/netutils v0.25.4 // indirect - github.com/go-openapi/swag/stringutils v0.25.4 // indirect - github.com/go-openapi/swag/typeutils v0.25.4 // indirect - github.com/go-openapi/swag/yamlutils v0.25.4 // indirect - github.com/hexops/gotextdiff v1.0.3 // indirect - github.com/ncruces/go-strftime v1.0.0 // indirect - github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect - github.com/sanity-io/litter v1.5.8 // indirect - github.com/shirou/gopsutil/v4 v4.26.7 // indirect - github.com/sosodev/duration v1.4.0 // indirect - go.yaml.in/yaml/v4 v4.0.0-rc.4 // indirect - google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.6.2 // indirect - gorm.io/driver/sqlserver v1.6.4 // indirect - modernc.org/libc v1.74.1 // indirect - modernc.org/mathutil v1.7.1 // indirect - modernc.org/memory v1.11.0 // indirect - modernc.org/sqlite v1.55.0 // indirect -) - require ( ariga.io/atlas v0.38.0 // indirect - cloud.google.com/go/cloudsqlconn v1.22.1 // indirect - github.com/agext/levenshtein v1.2.3 // indirect - github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be // indirect - github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect - github.com/bmatcuk/doublestar v1.3.4 // indirect - github.com/exaring/otelpgx v0.11.1 // indirect - github.com/fergusstrange/embedded-postgres v1.34.0 // indirect - github.com/go-openapi/inflect v0.21.5 // indirect - github.com/gofrs/flock v0.13.0 // indirect - github.com/google/jsonschema-go v0.4.2 // indirect - github.com/hashicorp/hcl/v2 v2.24.0 // indirect - github.com/mitchellh/go-wordwrap v1.0.1 // indirect - github.com/nukilabs/ftoa v1.0.0 // indirect - github.com/nukilabs/unicodeid v0.1.0 // indirect - github.com/pgplex/pgparser v0.2.0 // indirect - github.com/santhosh-tekuri/jsonschema/v6 v6.0.3 - github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect - github.com/zclconf/go-cty v1.18.1 // indirect - github.com/zclconf/go-cty-yaml v1.2.0 // indirect - go.opencensus.io v0.24.0 // indirect - gorm.io/driver/postgres v1.6.0 // indirect -) - -require ( - cel.dev/expr v0.25.1 // indirect + cel.dev/expr v0.25.3 // indirect cloud.google.com/go v0.123.0 // indirect cloud.google.com/go/auth v0.20.0 // indirect cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect + cloud.google.com/go/bigquery v1.77.0 // indirect + cloud.google.com/go/cloudsqlconn v1.22.1 // indirect cloud.google.com/go/compute/metadata v0.9.0 // indirect cloud.google.com/go/iam v1.7.0 // indirect cloud.google.com/go/kms v1.26.0 // indirect + cloud.google.com/go/logging v1.18.0 // indirect cloud.google.com/go/longrunning v0.9.0 // indirect cloud.google.com/go/monitoring v1.24.3 // indirect cloud.google.com/go/storage v1.62.3 // indirect dario.cat/mergo v1.0.2 // indirect filippo.io/edwards25519 v1.2.0 // indirect - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.22.0 // indirect - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1 // indirect + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.23.1 // indirect + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.14.1 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v1.12.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/keyvault/azkeys v0.10.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal v0.7.1 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.7.2 // indirect + github.com/Azure/azure-sdk-for-go/sdk/monitor/azquery v1.2.0 // indirect + github.com/AzureAD/microsoft-authentication-library-for-go v1.8.0 // indirect github.com/ClickHouse/ch-go v0.71.0 // indirect github.com/ClickHouse/clickhouse-go/v2 v2.46.0 // indirect - github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.32.0 // indirect + github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.35.0 // indirect github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.55.0 // indirect github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.55.0 // indirect github.com/Masterminds/goutils v1.1.1 // indirect @@ -132,19 +99,27 @@ require ( github.com/Microsoft/go-winio v0.6.2 // indirect github.com/ProtonMail/go-crypto v1.3.0 // indirect github.com/TomOnTime/utfutil v1.0.0 // indirect + github.com/agext/levenshtein v1.2.3 // indirect + github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b // indirect github.com/alecthomas/chroma/v2 v2.23.1 // indirect + github.com/alpkeskin/gotoon v0.1.1 // indirect github.com/andybalholm/brotli v1.2.0 // indirect + github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be // indirect github.com/antchfx/xmlquery v1.5.1 // indirect github.com/antchfx/xpath v1.3.6 // indirect - github.com/anthropics/anthropic-sdk-go v1.26.0 github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/apache/arrow/go/v15 v15.0.2 // indirect + github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 // indirect + github.com/atombender/go-jsonschema v0.24.1 // indirect github.com/atotto/clipboard v0.1.4 // indirect github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.13 // indirect github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.29 // indirect github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.29 // indirect github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.29 // indirect github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.30 // indirect + github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.56.2 // indirect + github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.75.2 // indirect github.com/aws/aws-sdk-go-v2/service/eks v1.84.6 // indirect github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.12 // indirect github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.18 // indirect @@ -155,84 +130,113 @@ require ( github.com/aws/aws-sdk-go-v2/service/signin v1.2.0 // indirect github.com/aws/aws-sdk-go-v2/service/sso v1.31.3 // indirect github.com/aws/aws-sdk-go-v2/service/ssooidc v1.36.6 // indirect - github.com/aws/smithy-go v1.27.1 // indirect + github.com/aws/smithy-go v1.27.3 // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/bahlo/generic-list-go v0.2.0 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/bmatcuk/doublestar/v4 v4.10.0 + github.com/bmatcuk/doublestar v1.3.4 // indirect github.com/buger/jsonparser v1.1.2 // indirect github.com/catppuccin/go v0.3.0 // indirect github.com/cenkalti/backoff/v5 v5.0.3 // indirect - github.com/cert-manager/cert-manager v1.20.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/charmbracelet/bubbles v0.21.1-0.20250623103423-23b8fd6302d7 // indirect github.com/charmbracelet/bubbletea v1.3.10 // indirect github.com/charmbracelet/colorprofile v0.4.3 // indirect github.com/charmbracelet/lipgloss v1.1.1-0.20250404203927-76690c660834 // indirect - github.com/charmbracelet/x/ansi v0.11.6 github.com/charmbracelet/x/cellbuf v0.0.15 // indirect - github.com/charmbracelet/x/exp/strings v0.0.0-20240722160745-212f7b056ed0 // indirect + github.com/charmbracelet/x/exp/strings v0.0.0-20260122224438-b01af16209d9 // indirect github.com/charmbracelet/x/term v0.2.2 // indirect github.com/clipperhouse/displaywidth v0.11.0 // indirect github.com/clipperhouse/uax29/v2 v2.7.0 // indirect github.com/cloudflare/circl v1.6.3 // indirect github.com/cncf/xds/go v0.0.0-20260202195803-dba9d589def2 // indirect github.com/coder/websocket v1.8.14 // indirect + github.com/creack/pty v1.1.24 // indirect github.com/cyphar/filepath-securejoin v0.6.1 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/deckarep/golang-set/v2 v2.8.0 // indirect github.com/distribution/reference v0.6.0 // indirect github.com/dlclark/regexp2 v1.11.5 // indirect github.com/dustin/go-humanize v1.0.1 // indirect + github.com/ebitengine/purego v0.10.2 // indirect github.com/eko/gocache/lib/v4 v4.2.3 // indirect github.com/eko/gocache/store/go_cache/v4 v4.2.5 // indirect + github.com/elazarl/goproxy v1.7.2 // indirect github.com/emicklei/go-restful/v3 v3.13.0 // indirect github.com/emirpasic/gods v1.18.1 // indirect - github.com/envoyproxy/go-control-plane/envoy v1.37.0 // indirect + github.com/envoyproxy/go-control-plane/envoy v1.39.1-0.20260819172001-e6e3fd93e4be // indirect github.com/envoyproxy/protoc-gen-validate v1.3.3 // indirect github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect + github.com/exaring/otelpgx v0.11.1 // indirect github.com/felixge/httpsnoop v1.1.0 // indirect + github.com/fergusstrange/embedded-postgres v1.34.0 // indirect + github.com/flanksource/commons-db/cmd/query v0.1.67 // indirect + github.com/flanksource/commons-db/recordstore v0.1.67 // indirect + github.com/flanksource/commons-db/tracing v0.1.67 // indirect github.com/flanksource/gomplate/v3 v3.24.90 // indirect - github.com/flanksource/is-healthy v1.0.92 // indirect + github.com/flanksource/is-healthy v1.0.93 // indirect github.com/flanksource/kubectl-neat v1.0.4 // indirect - github.com/fxamacker/cbor/v2 v2.9.0 // indirect + github.com/flanksource/repomap v0.4.1 // indirect + github.com/flanksource/sqlglot-go v1.1.1 // indirect + github.com/fxamacker/cbor/v2 v2.9.1 // indirect github.com/geoffgarside/ber v1.2.0 // indirect github.com/ghodss/yaml v1.0.0 // indirect + github.com/glebarez/sqlite v1.11.0 // indirect github.com/go-faster/city v1.0.1 // indirect github.com/go-faster/errors v0.7.1 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect github.com/go-git/go-billy/v5 v5.9.0 // indirect github.com/go-git/go-git/v5 v5.19.2 // indirect - github.com/go-jose/go-jose/v4 v4.1.4 // indirect - github.com/go-logr/logr v1.4.3 // indirect + github.com/go-jose/go-jose/v4 v4.1.7 // indirect + github.com/go-logr/logr v1.4.4 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.3.0 // indirect - github.com/go-openapi/jsonpointer v0.22.5 // indirect - github.com/go-openapi/jsonreference v0.21.4 // indirect - github.com/go-openapi/swag v0.25.4 // indirect - github.com/go-openapi/swag/jsonname v0.25.5 // indirect + github.com/go-openapi/inflect v0.21.5 // indirect + github.com/go-openapi/jsonpointer v1.0.0 // indirect + github.com/go-openapi/jsonreference v1.0.0 // indirect + github.com/go-openapi/swag v0.28.0 // indirect + github.com/go-openapi/swag/cmdutils v0.28.0 // indirect + github.com/go-openapi/swag/conv v0.28.0 // indirect + github.com/go-openapi/swag/fileutils v0.28.0 // indirect + github.com/go-openapi/swag/jsonutils v0.28.0 // indirect + github.com/go-openapi/swag/loading v0.28.0 // indirect + github.com/go-openapi/swag/mangling v0.28.0 // indirect + github.com/go-openapi/swag/netutils v0.28.0 // indirect + github.com/go-openapi/swag/pools v0.28.0 // indirect + github.com/go-openapi/swag/stringutils v0.28.0 // indirect + github.com/go-openapi/swag/typeutils v0.28.0 // indirect + github.com/go-openapi/swag/yamlutils v0.28.0 // indirect github.com/go-sql-driver/mysql v1.10.0 // indirect + github.com/go-stack/stack v1.8.1 // indirect github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/go-xmlfmt/xmlfmt v1.1.3 // indirect github.com/gobwas/glob v0.2.3 // indirect + github.com/goccy/go-json v0.10.6 // indirect github.com/goccy/go-yaml v1.19.2 // indirect + github.com/gofrs/flock v0.13.0 // indirect github.com/golang-jwt/jwt/v5 v5.3.1 // indirect github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect github.com/golang-sql/sqlexp v0.1.0 // indirect github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect github.com/google/btree v1.1.3 // indirect + github.com/google/flatbuffers v25.12.19+incompatible // indirect github.com/google/gnostic-models v0.7.1 // indirect github.com/google/go-cmp v0.7.0 // indirect - github.com/google/pprof v0.0.0-20260402051712-545e8a4df936 // indirect + github.com/google/gops v0.3.29 // indirect + github.com/google/jsonschema-go v0.4.3 // indirect + github.com/google/pprof v0.0.0-20260507013755-92041b743c96 // indirect github.com/google/s2a-go v0.1.9 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.17 // indirect github.com/googleapis/gax-go/v2 v2.22.0 // indirect github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect github.com/gosimple/slug v1.15.0 // indirect github.com/gosimple/unidecode v1.0.1 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect github.com/hairyhenderson/toml v0.4.2-0.20210923231440-40456b8e66cf // indirect github.com/hairyhenderson/yaml v0.0.0-20220618171115-2d35fca545ce // indirect + github.com/hashicorp/hcl/v2 v2.24.0 // indirect github.com/henvic/httpretty v0.1.4 // indirect + github.com/hexops/gotextdiff v1.0.3 // indirect github.com/hirochachacha/go-smb2 v1.1.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/itchyny/gojq v0.12.19 // indirect @@ -240,7 +244,6 @@ require ( github.com/jackc/pgerrcode v0.0.0-20250907135507-afb5586c32a6 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect - github.com/jackc/pgx/v5 v5.10.0 github.com/jackc/puddle/v2 v2.2.2 // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect github.com/jeremywohl/flatten v1.0.1 // indirect @@ -254,7 +257,7 @@ require ( github.com/klauspost/cpuid/v2 v2.3.0 // indirect github.com/kr/fs v0.1.0 // indirect github.com/kylelemons/godebug v1.1.0 // indirect - github.com/labstack/echo/v4 v4.15.2 // indirect + github.com/labstack/echo/v4 v4.16.3 // indirect github.com/labstack/gommon v0.5.0 // indirect github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect @@ -262,13 +265,13 @@ require ( github.com/lib/pq v1.12.3 // indirect github.com/lucasb-eyer/go-colorful v1.3.0 // indirect github.com/lufia/plan9stats v0.0.0-20251013123823-9fd1530e3ec3 // indirect - github.com/mark3labs/mcp-go v0.56.0 - github.com/mattn/go-colorable v0.1.14 // indirect + github.com/maruel/panicparse/v2 v2.5.0 // indirect + github.com/mattn/go-colorable v0.1.15 // indirect github.com/mattn/go-isatty v0.0.22 // indirect github.com/mattn/go-localereader v0.0.1 // indirect github.com/mattn/go-runewidth v0.0.21 // indirect - github.com/mbleigh/raymond v0.0.0-20250414171441-6b3a58ab9e0a github.com/microsoft/go-mssqldb v1.10.0 // indirect + github.com/mitchellh/go-wordwrap v1.0.1 // indirect github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/moby/spdystream v0.5.1 // indirect @@ -278,42 +281,53 @@ require ( github.com/muesli/cancelreader v0.2.2 // indirect github.com/muesli/termenv v0.16.0 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/mxschmitt/playwright-go v0.6201.1 // indirect + github.com/ncruces/go-strftime v1.0.0 // indirect + github.com/nukilabs/ftoa v1.0.0 // indirect + github.com/nukilabs/unicodeid v0.1.0 // indirect github.com/ohler55/ojg v1.28.1 // indirect github.com/oklog/ulid/v2 v2.1.1 // indirect - github.com/openai/openai-go v1.12.0 github.com/opencontainers/go-digest v1.0.0 // indirect + github.com/opensearch-project/opensearch-go/v2 v2.3.0 // indirect github.com/orcaman/concurrent-map/v2 v2.0.1 // indirect - github.com/patrickmn/go-cache v2.1.0+incompatible // indirect + github.com/patrickmn/go-cache v2.1.1-0.20191004192108-46f407853014+incompatible // indirect github.com/paulmach/orb v0.12.0 // indirect github.com/peterbourgon/diskv v2.0.1+incompatible // indirect + github.com/pgplex/pgparser v0.2.0 // indirect github.com/pierrec/lz4/v4 v4.1.26 // indirect github.com/pjbgf/sha1cd v0.6.0 // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pkg/sftp v1.13.10 // indirect - github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect + github.com/planetscale/vtprotobuf v0.6.1-0.20250313105119-ba97887b0a25 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect github.com/prometheus/client_golang v1.23.2 // indirect github.com/prometheus/client_model v0.6.2 // indirect github.com/prometheus/common v0.68.1 // indirect github.com/prometheus/procfs v0.20.1 // indirect + github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect + github.com/richardlehane/mscfb v1.0.9 // indirect + github.com/richardlehane/msoleps v1.0.6 // indirect github.com/rivo/uniseg v0.4.7 // indirect github.com/robertkrimen/otto v0.5.1 // indirect github.com/robfig/cron/v3 v3.0.1 // indirect github.com/samber/oops v1.22.0 // indirect + github.com/sanity-io/litter v1.5.8 // indirect github.com/segmentio/asm v1.2.1 // indirect + github.com/shirou/gopsutil/v4 v4.26.7 // indirect github.com/shoenig/go-m1cpu v0.1.7 // indirect github.com/shopspring/decimal v1.4.0 // indirect github.com/sirupsen/logrus v1.9.4 // indirect github.com/skeema/knownhosts v1.3.2 // indirect + github.com/sosodev/duration v1.4.0 // indirect github.com/spf13/cast v1.10.0 // indirect - github.com/spf13/pflag v1.0.10 - github.com/spiffe/go-spiffe/v2 v2.6.0 // indirect + github.com/spiffe/go-spiffe/v2 v2.8.1 // indirect github.com/tidwall/gjson v1.18.0 // indirect github.com/tidwall/match v1.2.0 // indirect github.com/tidwall/pretty v1.2.1 // indirect github.com/tidwall/sjson v1.2.5 // indirect + github.com/tiendc/go-deepcopy v1.7.2 // indirect github.com/tj/go-naturaldate v1.3.0 // indirect github.com/tklauser/go-sysconf v0.3.16 // indirect github.com/tklauser/numcpus v0.11.0 // indirect @@ -325,60 +339,65 @@ require ( github.com/xanzy/ssh-agent v0.3.3 // indirect github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect - github.com/xeipuuv/gojsonschema v1.2.0 + github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect + github.com/xuri/efp v0.0.3-0.20260924042702-217b81952dec // indirect + github.com/xuri/excelize/v2 v2.11.1-0.20261029001137-c5fd73bde8f6 // indirect + github.com/xuri/nfp v0.0.2-0.20250530014748-2ddeb826f9a9 // indirect github.com/yosida95/uritemplate/v3 v3.0.2 // indirect github.com/yuin/gopher-lua v1.1.1 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect + github.com/zclconf/go-cty v1.18.1 // indirect + github.com/zclconf/go-cty-yaml v1.2.0 // indirect + github.com/zeebo/xxh3 v1.1.0 // indirect + go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect - go.opentelemetry.io/contrib/detectors/gcp v1.43.0 // indirect - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.67.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.69.0 // indirect - go.opentelemetry.io/otel v1.44.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.44.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.44.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.44.0 // indirect - go.opentelemetry.io/otel/metric v1.44.0 // indirect - go.opentelemetry.io/otel/sdk v1.44.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.44.0 // indirect - go.opentelemetry.io/otel/trace v1.44.0 // indirect - go.opentelemetry.io/proto/otlp v1.10.0 // indirect + go.opentelemetry.io/contrib/detectors/gcp v1.45.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.70.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.70.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect + go.opentelemetry.io/otel/log v1.47.0 // indirect + go.opentelemetry.io/otel/metric v1.47.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect + go.opentelemetry.io/proto/otlp v1.11.0 // indirect go.yaml.in/yaml/v2 v2.4.4 // indirect - go.yaml.in/yaml/v3 v3.0.4 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + go.yaml.in/yaml/v4 v4.0.0-rc.4 // indirect gocloud.dev v0.46.0 // indirect - golang.org/x/crypto v0.53.0 golang.org/x/exp v0.0.0-20260527015227-08cc5374adb3 // indirect - golang.org/x/mod v0.37.0 // indirect - golang.org/x/net v0.56.0 // indirect - golang.org/x/sync v0.22.0 // indirect - golang.org/x/sys v0.46.0 - golang.org/x/text v0.40.0 // indirect + golang.org/x/mod v0.41.0 // indirect + golang.org/x/net v0.62.0 // indirect + golang.org/x/sync v0.24.0 // indirect + golang.org/x/telemetry v0.0.0-20260924152758-ed294f943157 // indirect + golang.org/x/text v0.43.0 // indirect golang.org/x/time v0.15.0 // indirect - golang.org/x/tools v0.47.0 // indirect + golang.org/x/tools v0.51.0 // indirect golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect google.golang.org/api v0.286.0 // indirect - google.golang.org/genai v1.57.0 google.golang.org/genproto v0.0.0-20260319201613-d00831a3d3e7 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260526163538-3dc84a4a5aaa // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260622175928-b703f567277d // indirect - google.golang.org/grpc v1.82.1 - google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af - gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.6.2 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/sourcemap.v1 v1.0.5 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect - gorm.io/gorm v1.31.2 - k8s.io/apiextensions-apiserver v0.36.1 // indirect + gorm.io/driver/postgres v1.6.0 // indirect + gorm.io/driver/sqlserver v1.6.4 // indirect k8s.io/klog/v2 v2.140.0 // indirect - k8s.io/kube-openapi v0.0.0-20260317180543-43fb72c5454a // indirect + k8s.io/kube-openapi v0.0.0-20260501160325-927ab1f70cd6 // indirect k8s.io/streaming v0.36.2 // indirect - k8s.io/utils v0.0.0-20260210185600-b8788abfbbc2 // indirect + k8s.io/utils v0.0.0-20260626114624-be93311217bd // indirect layeh.com/gopher-json v0.0.0-20201124131017-552bb3c4c3bf // indirect - sigs.k8s.io/gateway-api v1.5.1 // indirect + modernc.org/libc v1.74.1 // indirect + modernc.org/mathutil v1.7.1 // indirect + modernc.org/memory v1.11.0 // indirect + modernc.org/sqlite v1.55.0 // indirect sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect sigs.k8s.io/randfill v1.0.0 // indirect - sigs.k8s.io/structured-merge-diff/v6 v6.3.2 // indirect + sigs.k8s.io/structured-merge-diff/v6 v6.4.0 // indirect ) // github.com/glebarez/sqlite is a gorm dialector that, unreplaced, links its own diff --git a/go.sum b/go.sum index 4cc617b6..ff45035f 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ ariga.io/atlas v0.38.0 h1:MwbtwVtDWJFq+ECyeTAz2ArvewDnpeiw/t/sgNdDsdo= ariga.io/atlas v0.38.0/go.mod h1:D7XMK6ei3GvfDqvzk+2VId78j77LdqHrqPOWamn51/s= -cel.dev/expr v0.25.1 h1:1KrZg61W6TWSxuNZ37Xy49ps13NUovb66QLprthtwi4= -cel.dev/expr v0.25.1/go.mod h1:hrXvqGP6G6gyx8UAHSHJ5RGk//1Oj5nXQ2NI02Nrsg4= +cel.dev/expr v0.25.3 h1:A2jO8jwOugrrovveCWfj0KEZOfqiLgAcwjpHPhzIGw0= +cel.dev/expr v0.25.3/go.mod h1:hrXvqGP6G6gyx8UAHSHJ5RGk//1Oj5nXQ2NI02Nrsg4= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.123.0 h1:2NAUJwPR47q+E35uaJeYoNhuNEM9kM8SjgRgdeOJUSE= cloud.google.com/go v0.123.0/go.mod h1:xBoMV08QcqUGuPW65Qfm1o9Y4zKZBpGS+7bImXLTAZU= @@ -9,10 +9,14 @@ cloud.google.com/go/auth v0.20.0 h1:kXTssoVb4azsVDoUiF8KvxAqrsQcQtB53DcSgta74CA= cloud.google.com/go/auth v0.20.0/go.mod h1:942/yi/itH1SsmpyrbnTMDgGfdy2BUqIKyd0cyYLc5Q= cloud.google.com/go/auth/oauth2adapt v0.2.8 h1:keo8NaayQZ6wimpNSmW5OPc283g65QNIiLpZnkHRbnc= cloud.google.com/go/auth/oauth2adapt v0.2.8/go.mod h1:XQ9y31RkqZCcwJWNSx2Xvric3RrU88hAYYbjDWYDL+c= +cloud.google.com/go/bigquery v1.77.0 h1:L5AW3jhzEKpFVg4i0mVHxKpxogrqT7dczWBSr4m9MKU= +cloud.google.com/go/bigquery v1.77.0/go.mod h1:J4wuqka/1hEpdJxH2oBrUR0vjTD+r7drGkpcA3yqERM= cloud.google.com/go/cloudsqlconn v1.22.1 h1:c4HkWMSV4pDL8kJid+nIuF+6iE07pR5Mn/sRVY17wf4= cloud.google.com/go/cloudsqlconn v1.22.1/go.mod h1:p7l+u0ThOzSvC5a4fkywi1hEyD8S709X1zEqux9tsq0= cloud.google.com/go/compute/metadata v0.9.0 h1:pDUj4QMoPejqq20dK0Pg2N4yG9zIkYGdBtwLoEkH9Zs= cloud.google.com/go/compute/metadata v0.9.0/go.mod h1:E0bWwX5wTnLPedCKqk3pJmVgCBSM6qQI1yTBdEb3C10= +cloud.google.com/go/datacatalog v1.27.0 h1:AnghhtHKCqYIe62gTPHcn9nJr5jtxjZHV4D/Fob23gg= +cloud.google.com/go/datacatalog v1.27.0/go.mod h1:YTI11pFlC5HCj4CphEf+qWCy/z9udd7o0HVN6c2Povg= cloud.google.com/go/iam v1.7.0 h1:JD3zh0C6LHl16aCn5Akff0+GELdp1+4hmh6ndoFLl8U= cloud.google.com/go/iam v1.7.0/go.mod h1:tetWZW1PD/m6vcuY2Zj/aU0eCHNPuxedbnbRTyKXvdY= cloud.google.com/go/kms v1.26.0 h1:cK9mN2cf+9V63D3H1f6koxTatWy39aTI/hCjz1I+adU= @@ -31,26 +35,30 @@ dario.cat/mergo v1.0.2 h1:85+piFYR1tMbRrLcDwR18y4UKJ3aH1Tbzi24VRW1TK8= dario.cat/mergo v1.0.2/go.mod h1:E/hbnu0NxMFBjpMIE34DRGLWqDy0g5FuKDhCb31ngxA= filippo.io/edwards25519 v1.2.0 h1:crnVqOiS4jqYleHd9vaKZ+HKtHfllngJIiOpNpoJsjo= filippo.io/edwards25519 v1.2.0/go.mod h1:xzAOLCNug/yB62zG1bQ8uziwrIqIuxhctzJT18Q77mc= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.22.0 h1:aokoqcHvaGjiM3VpjKDfMMnF/8epJ+Q1HLJ7CudztqE= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.22.0/go.mod h1:/WYEx9pcM9Y+Dd/APJaNlSvVSvzl54rrMdZT5+Oi2LM= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1 h1:Hk5QBxZQC1jb2Fwj6mpzme37xbCDdNTxU7O9eb5+LB4= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1/go.mod h1:IYus9qsFobWIc2YVwe/WPjcnyCkPKtnHAqUYeebc8z0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2 h1:yz1bePFlP5Vws5+8ez6T3HWXPmwOK7Yvq8QxDBD3SKY= -github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2/go.mod h1:Pa9ZNPuoNu/GztvBSKk9J1cDJW6vk/n0zLtV4mgd8N8= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.23.1 h1:zvXfGJCWvywnCA814d8ZiVyt+fm9nnTE8xSb99zRyfo= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.23.1/go.mod h1:iptorS+VYKFL2N6PnebpS91dubG35eAOEERnT4PJbQU= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.14.1 h1:u93s+zU2JD62im61Bm5CZIc1ZrOJaIAWEg0WOrMVkEo= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.14.1/go.mod h1:oXtinPO4OLj9d1DOTrqrL1oRwGhcqadvAmrl6wTeGlk= +github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.4.0 h1:xFaZZ+IubdftrDHnGGwZ6QvQ3KHTtWl2MCK+GMt2vxs= +github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.4.0/go.mod h1:mCBhUhlMjLLJKr5aqw2TNS/VqJOie8MzWq3DAMJeKso= github.com/Azure/azure-sdk-for-go/sdk/internal v1.12.0 h1:fhqpLE3UEXi9lPaBRpQ6XuRW0nU7hgg4zlmZZa+a9q4= github.com/Azure/azure-sdk-for-go/sdk/internal v1.12.0/go.mod h1:7dCRMLwisfRH3dBupKeNCioWYUZ4SS09Z14H+7i8ZoY= github.com/Azure/azure-sdk-for-go/sdk/keyvault/azkeys v0.10.0 h1:m/sWOGCREuSBqg2htVQTBY8nOZpyajYztF0vUvSZTuM= github.com/Azure/azure-sdk-for-go/sdk/keyvault/azkeys v0.10.0/go.mod h1:Pu5Zksi2KrU7LPbZbNINx6fuVrUp/ffvpxdDj+i8LeE= github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal v0.7.1 h1:FbH3BbSb4bvGluTesZZ+ttN/MDsnMmQP36OSnDuSXqw= github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal v0.7.1/go.mod h1:9V2j0jn9jDEkCkv8w/bKTNppX/d0FVA1ud77xCIP4KA= +github.com/Azure/azure-sdk-for-go/sdk/monitor/azquery v1.2.0 h1:s0SaQtHigowP0n3Kx4ieV94pNZAHlHhS+xjZyLCSVCQ= +github.com/Azure/azure-sdk-for-go/sdk/monitor/azquery v1.2.0/go.mod h1:oI5SPI1vpNJYfP9MPWXthq7jDfh9xTAuQVBKPOu7DPo= github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.4.0 h1:E4MgwLBGeVB5f2MdcIVD3ELVAWpr+WD6MUe1i+tM/PA= github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.4.0/go.mod h1:Y2b/1clN4zsAoUd/pgNAQHjLDnTis/6ROkUfyob6psM= github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.2.0 h1:nCYfgcSyHZXJI8J0IWE5MsCGlb2xp9fJiXyxWgmOFg4= github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.2.0/go.mod h1:ucUjca2JtSZboY8IoUqyQyuuXvwbMBVwFOm0vdQPNhA= +github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c h1:udKWzYgxTojEKWjV8V+WSxDXJ4NFATAsZjh8iIbsQIg= +github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1 h1:WJTmL004Abzc5wDB5VtZG2PJk5ndYDgVacGqfirKxjM= github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1/go.mod h1:tCcJZ0uHAmvjsVYzEFivsRTN00oz5BEsRgQHu5JZ9WE= -github.com/AzureAD/microsoft-authentication-library-for-go v1.7.2 h1:RHK7bS+HQMslb1sZpAokUt+zTVmue0hKSs2C791hhzU= -github.com/AzureAD/microsoft-authentication-library-for-go v1.7.2/go.mod h1:HKpQxkWaGLJ+D/5H8QRpyQXA1eKjxkFlOMwck5+33Jk= +github.com/AzureAD/microsoft-authentication-library-for-go v1.8.0 h1:Nljr4q1GRA/5vCrMONS+g4u4LRHNgOXVSh3O43J2CnI= +github.com/AzureAD/microsoft-authentication-library-for-go v1.8.0/go.mod h1:Y33QHnf0FfdVewFFISOGe20mkZbxX4H839o955/PoeI= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/ClickHouse/ch-go v0.71.0 h1:bUdZ/EZj/LcVHsMqaRUP2holqygrPWQKeMjc6nZoyRM= github.com/ClickHouse/ch-go v0.71.0/go.mod h1:NwbNc+7jaqfY58dmdDUbG4Jl22vThgx1cYjBw0vtgXw= @@ -58,8 +66,8 @@ github.com/ClickHouse/clickhouse-go/v2 v2.46.0 h1:s3eRy+hYmu5uzotB6ZhDofgHu8kDgG github.com/ClickHouse/clickhouse-go/v2 v2.46.0/go.mod h1:giJfUVlMkcfUEPVfRpt51zZaGEx9i17gCos8gBl392c= github.com/DATA-DOG/go-sqlmock v1.5.2 h1:OcvFkGmslmlZibjAjaHm3L//6LiuBgolP7OputlJIzU= github.com/DATA-DOG/go-sqlmock v1.5.2/go.mod h1:88MAG/4G7SMwSE3CeA0ZKzrT5CiOU3OJ+JlNzwDqpNU= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.32.0 h1:rIkQfkCOVKc1OiRCNcSDD8ml5RJlZbH/Xsq7lbpynwc= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.32.0/go.mod h1:RD2SsorTmYhF6HkTmDw7KmPYQk8OBYwTkuasChwv7R4= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.35.0 h1:bN1gA3of5bXtbnLsRPrwfmbbe7A5UWFlcTHseujLnpc= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.35.0/go.mod h1:Yj5vHEz/aAepZGliRJsA6uvHAVAQyEwajq9ORCHPxzM= github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.55.0 h1:UnDZ/zFfG1JhH/DqxIZYU/1CUAlTUScoXD/LcM2Ykk8= github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.55.0/go.mod h1:IA1C1U7jO/ENqm/vhi7V9YYpBsp+IMyqNrEN94N7tVc= github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0.55.0 h1:7t/qx5Ost0s0wbA/VDrByOooURhp+ikYwv20i9Y07TQ= @@ -83,12 +91,20 @@ github.com/TomOnTime/utfutil v1.0.0 h1:/0Ivgo2OjXJxo8i7zgvs7ewSFZMLwCRGm3P5Umowb github.com/TomOnTime/utfutil v1.0.0/go.mod h1:l9lZmOniizVSuIliSkEf87qivMRlSNzbdBFKjuLRg1c= github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo= github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= +github.com/agnivade/levenshtein v1.2.1 h1:EHBY3UOn1gwdy/VbFwgo4cxecRznFk7fKWN1KOX7eoM= +github.com/agnivade/levenshtein v1.2.1/go.mod h1:QVVI16kDrtSuwcpd0p1+xMC6Z/VfhtCyDIjcwga4/DU= +github.com/ajstarks/deck v0.0.0-20200831202436-30c9fc6549a9/go.mod h1:JynElWSGnm/4RlzPXRlREEwqTHAN3T56Bv2ITsFT3gY= +github.com/ajstarks/deck/generate v0.0.0-20210309230005-c3f852c02e19/go.mod h1:T13YZdzov6OU0A1+RfKZiZN9ca6VeKdBdyDV+BY97Tk= +github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b h1:slYM766cy2nI3BwyRiyQj/Ud48djTMtMebDqepE95rw= +github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b/go.mod h1:1KcenG0jGWcpt8ov532z81sp/kMMUG485J2InIOyADM= github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0= github.com/alecthomas/assert/v2 v2.11.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= github.com/alecthomas/chroma/v2 v2.23.1 h1:nv2AVZdTyClGbVQkIzlDm/rnhk1E9bU9nXwmZ/Vk/iY= github.com/alecthomas/chroma/v2 v2.23.1/go.mod h1:NqVhfBR0lte5Ouh3DcthuUCTUpDC9cxBOfyMbMQPs3o= github.com/alecthomas/repr v0.5.2 h1:SU73FTI9D1P5UNtvseffFSGmdNci/O6RsqzeXJtP0Qs= github.com/alecthomas/repr v0.5.2/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= +github.com/alicebob/miniredis/v2 v2.38.0 h1:nZAzCR+Lj+Vxk4ZXzm2NuKq2O33RXj1XxJ2e2uP9jiw= +github.com/alicebob/miniredis/v2 v2.38.0/go.mod h1:TcL7YfarKPGDAthEtl5NBeHZfeUQj6OXMm/+iu5cLMM= github.com/alpkeskin/gotoon v0.1.1 h1:GQOVwMfWKINnfEA6slrXHJaJYDwnUFmrPlXOtnuja1w= github.com/alpkeskin/gotoon v0.1.1/go.mod h1:XRTz8RM4tz8M2nB37MNRN8rHF4YgeYd8nIXmoU0B0+M= github.com/andybalholm/brotli v1.2.0 h1:ukwgCxwYrmACq68yiUqwIWnGY0cTPox/M94sVwToPjQ= @@ -103,6 +119,8 @@ github.com/anthropics/anthropic-sdk-go v1.26.0 h1:oUTzFaUpAevfuELAP1sjL6CQJ9HHAf github.com/anthropics/anthropic-sdk-go v1.26.0/go.mod h1:qUKmaW+uuPB64iy1l+4kOSvaLqPXnHTTBKH6RVZ7q5Q= github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ= github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw= +github.com/apache/arrow/go/v15 v15.0.2 h1:60IliRbiyTWCWjERBCkO1W4Qun9svcYoZrSLcyOsMLE= +github.com/apache/arrow/go/v15 v15.0.2/go.mod h1:DGXsR3ajT524njufqf95822i+KTh+yea1jass9YXgjA= github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew1u1fNQOlOtuGxQY= github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= @@ -111,28 +129,41 @@ github.com/atombender/go-jsonschema v0.24.1 h1:Vb2JHFA0AxtMl8F1ecrpMQ3uQ2Cxm0Hgp github.com/atombender/go-jsonschema v0.24.1/go.mod h1:yYMQVvK3WlxXJIpciA84rKg/xf2VCxIsxNt9I7Ugvmw= github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4= github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= +github.com/aws/aws-sdk-go v1.44.263/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go-v2 v1.18.0/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= github.com/aws/aws-sdk-go-v2 v1.42.0 h1:XvXMJTkFQtpBKIWZnmr9ZEOc2InWM2yldjXEJ/bymhA= github.com/aws/aws-sdk-go-v2 v1.42.0/go.mod h1:27+ACypSLljLAEKsCYOmrjKh83vuTRkuAe9Uv/3A4bg= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.13 h1:p1BBrg/Hhp6uK7zpejeI8QFXHJeC/mynzi04Sl03k9g= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.13/go.mod h1:8cIfkE9MDhkRZGpQ22aV6/lkYeYSozpz16Smrs5x4Ls= +github.com/aws/aws-sdk-go-v2/config v1.18.25/go.mod h1:dZnYpD5wTW/dQF0rRNLVypB396zWCcPiBIvdvSWHEg4= github.com/aws/aws-sdk-go-v2/config v1.32.25 h1:ACCejvStYoilgwrfegSt5ZntCbPrk52qfwyNcnl3omM= github.com/aws/aws-sdk-go-v2/config v1.32.25/go.mod h1:LJyU8sDRbXUxFn8xMJIGP+v9QYYwveNLI8a/giAOiAs= +github.com/aws/aws-sdk-go-v2/credentials v1.13.24/go.mod h1:jYPYi99wUOPIFi0rhiOvXeSEReVOzBqFNOX5bXYoG2o= github.com/aws/aws-sdk-go-v2/credentials v1.19.24 h1:2hQqYCV9yqyePQ9o6dCrZc/zO8U3TwPr9mIKlZnPu/I= github.com/aws/aws-sdk-go-v2/credentials v1.19.24/go.mod h1:IDwpACtwqHLISdzfwUUNq4P9DsB/h5BLg4FwJPNfqFY= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.3/go.mod h1:4Q0UFP0YJf0NrsEuEYHpM9fTSEVnD16Z3uyEF7J9JGM= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.29 h1:r6qZHbT+wxgWO/e9vYNUEtg7lv5+UN3pRqKhLXvnArg= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.29/go.mod h1:QRnaRcTVGKPGRy8w78HMQtKUGRYcnMZAANATkeVA6Mo= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.33/go.mod h1:7i0PF1ME/2eUPFcjkVIwq+DOygHEoK92t5cDqNgYbIw= github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.29 h1:f3vKqSo13fhTYb+JEcXwXefZQE26I1FB5eTSniU67ko= github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.29/go.mod h1:MzoLFUArKGpGD+ukmPiTPG1X5x4o6M2kq4v2dr1FiEc= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.27/go.mod h1:UrHnn3QV/d0pBZ6QBAEQcqFLf8FAzLmoUfPVIueOvoM= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.29 h1:RdwIf/CuUsvJX3RgJagbOyotl/cxoLY4xviKuE7p2GY= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.29/go.mod h1:71wt8W2EgswdZy9Mf9KNnzxZ3TiZlv4caKghPktDOkA= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.34/go.mod h1:Etz2dj6UHYuw+Xw830KfzCfWGMzqvUTCjUj5b76GVDc= github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.30 h1:VTGy885W5DKBxWRUJbym9hytNaYzsyaPkCHGRRMAOhU= github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.30/go.mod h1:AS0HycUvJRFvTt613AYDOgO2jzw+00cVSMny8XB3yMY= +github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.56.2 h1:AEdVlfaKtqjQgnAZ71TAghxd2We92jSez2VAnjOx1vg= +github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.56.2/go.mod h1:/s52Xxp5LWbfLCWtelG67FDNtpoOoxdnZEzcixGQwcM= +github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.75.2 h1:qXso3xK+5GmfBq8n/ymjJB12kHkO3Yhy9+8cIHlw6J4= +github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.75.2/go.mod h1:N336OxQ6TvRbb6V1esVE8PtQFU86YvYaS+lVjsJTmP0= github.com/aws/aws-sdk-go-v2/service/eks v1.84.6 h1:RSCziGPe92ZoBreWKOJsLhK45Nx7+2b2y8hNbOUvHLQ= github.com/aws/aws-sdk-go-v2/service/eks v1.84.6/go.mod h1:rbIASs+SfCDUXx2EdfMkNpDGptlW8hvMZ9AawRiUBqE= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.12 h1:ZD2+BSw9vFsNlKYIasSNt3uDbjqqXIBcM13UJv/Lx2k= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.12/go.mod h1:Ms4zlcVBbXbiP7EVLhl+lgjvA/a7YphqQ3Ih3174EmI= github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.18 h1:W/EyPFl9A5rXrtoilfwHYEvzHER+K4SpBPtMXi24Mos= github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.18/go.mod h1:UG50K+pvd/uy6xExbobg0rjqFBFZe6I3l75EPDZw4tg= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.27/go.mod h1:EOwBD4J4S5qYszS5/3DpkejfuK+Z5/1uzICfPaZLtqw= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.29 h1:DRebniUGZ2MqiiIVmQJ04vIXr918hubdHMnarSLEWyU= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.29/go.mod h1:LfRkPCD8YHDM2E5eTkos2UpwYeZnBcVarTa8L59bJHA= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.25 h1:2pQEbwf+/6EDbiit/GcBE2K4IUpMZymaA0kOz3xK978= @@ -143,14 +174,18 @@ github.com/aws/aws-sdk-go-v2/service/s3 v1.102.2 h1:ie4ElCmUKS26pzrZcIk/lmt4yWjA github.com/aws/aws-sdk-go-v2/service/s3 v1.102.2/go.mod h1:zjsomFeX5duj+4PlMB+o4JoWTIx+G0XMyzjYrUbQkN0= github.com/aws/aws-sdk-go-v2/service/signin v1.2.0 h1:3nXpRcFwRCW8n7HgO2QGy0Dc20eQNfBuUemGQhpF8m8= github.com/aws/aws-sdk-go-v2/service/signin v1.2.0/go.mod h1:LxYujSTLPRlp2vTtcUO/+1ilrew8ytt6SvQyOgejzFQ= +github.com/aws/aws-sdk-go-v2/service/sso v1.12.10/go.mod h1:ouy2P4z6sJN70fR3ka3wD3Ro3KezSxU6eKGQI2+2fjI= github.com/aws/aws-sdk-go-v2/service/sso v1.31.3 h1:ey1XLTYXb9PcLt4535632o5kCGXNXEhNb620Dqwuylo= github.com/aws/aws-sdk-go-v2/service/sso v1.31.3/go.mod h1:Lk7PlmoTYryQmyBG0EXqj5BcUbj3whXdU2s3yGI3EAc= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.10/go.mod h1:AFvkxc8xfBe8XA+5St5XIHHrQQtkxqrRincx4hmMHOk= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.36.6 h1:yLr03zQE/5Eu5l3QU0Si+xMbLMbSDF2YXsigqXngs6g= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.36.6/go.mod h1:Q5N6icH+KJZDLh+ESNwzdv6cZ6vLFF/egy3IOxWhmz4= +github.com/aws/aws-sdk-go-v2/service/sts v1.19.0/go.mod h1:BgQOMsg8av8jset59jelyPW7NoZcZXLVpDsXunGDrk8= github.com/aws/aws-sdk-go-v2/service/sts v1.43.3 h1:VrIhKRCSK1umelSgB9RghvA9RTUYeQffyAS5ApXehNI= github.com/aws/aws-sdk-go-v2/service/sts v1.43.3/go.mod h1:r8wkDOuLaaMFqFiYAb8dGY2A3gJCOujMc6CFOVC4Zhc= -github.com/aws/smithy-go v1.27.1 h1:4T340VFndXtADGF52gYa1POyL7s9E4Z1OeZ1hCscIw8= -github.com/aws/smithy-go v1.27.1/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc= +github.com/aws/smithy-go v1.13.5/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= +github.com/aws/smithy-go v1.27.3 h1:F3Zb497UhhskkfpJmfkXswyo+t0sh9OTBnIHjogWbVY= +github.com/aws/smithy-go v1.27.3/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc= github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= github.com/aymanbagabas/go-udiff v0.4.1 h1:OEIrQ8maEeDBXQDoGCbbTTXYJMYRCRO1fnodZ12Gv5o= @@ -167,13 +202,15 @@ github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA= github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0= github.com/buger/jsonparser v1.1.2 h1:frqHqw7otoVbk5M8LlE/L7HTnIq2v9RX6EJ48i9AxJk= github.com/buger/jsonparser v1.1.2/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= +github.com/caarlos0/env/v11 v11.3.1 h1:cArPWC15hWmEt+gWk7YBi7lEXTXCvpaSdCiZE2X5mCA= +github.com/caarlos0/env/v11 v11.3.1/go.mod h1:qupehSf/Y0TUTsxKywqRt/vJjN5nz6vauiYEUUr8P4U= github.com/catppuccin/go v0.3.0 h1:d+0/YicIq+hSTo5oPuRi5kOpqkVA5tAsU6dNhvRu+aY= github.com/catppuccin/go v0.3.0/go.mod h1:8IHJuMGaUUjQM82qBrGNBv7LFq6JI3NnQCF6MOlZjpc= +github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= +github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM= github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cert-manager/cert-manager v1.20.0 h1:czZamsFJ1YdKPhpv+SopJZN9t3W68vQBnFYUevSHGqY= -github.com/cert-manager/cert-manager v1.20.0/go.mod h1:3oparI7R5JyJMNXntYod9p6DucIZ84st7y/9kL6cbBE= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/charmbracelet/bubbles v0.21.1-0.20250623103423-23b8fd6302d7 h1:JFgG/xnwFfbezlUnFMJy0nusZvytYysV4SCS2cYbvws= @@ -190,14 +227,14 @@ github.com/charmbracelet/x/ansi v0.11.6 h1:GhV21SiDz/45W9AnV2R61xZMRri5NlLnl6CVF github.com/charmbracelet/x/ansi v0.11.6/go.mod h1:2JNYLgQUsyqaiLovhU2Rv/pb8r6ydXKS3NIttu3VGZQ= github.com/charmbracelet/x/cellbuf v0.0.15 h1:ur3pZy0o6z/R7EylET877CBxaiE1Sp1GMxoFPAIztPI= github.com/charmbracelet/x/cellbuf v0.0.15/go.mod h1:J1YVbR7MUuEGIFPCaaZ96KDl5NoS0DAWkskup+mOY+Q= -github.com/charmbracelet/x/conpty v0.1.0 h1:4zc8KaIcbiL4mghEON8D72agYtSeIgq8FSThSPQIb+U= -github.com/charmbracelet/x/conpty v0.1.0/go.mod h1:rMFsDJoDwVmiYM10aD4bH2XiRgwI7NYJtQgl5yskjEQ= +github.com/charmbracelet/x/conpty v0.1.1 h1:s1bUxjoi7EpqiXysVtC+a8RrvPPNcNvAjfi4jxsAuEs= +github.com/charmbracelet/x/conpty v0.1.1/go.mod h1:OmtR77VODEFbiTzGE9G1XiRJAga6011PIm4u5fTNZpk= github.com/charmbracelet/x/errors v0.0.0-20240508181413-e8d8b6e2de86 h1:JSt3B+U9iqk37QUU2Rvb6DSBYRLtWqFqfxf8l5hOZUA= github.com/charmbracelet/x/errors v0.0.0-20240508181413-e8d8b6e2de86/go.mod h1:2P0UgXMEa6TsToMSuFqKFQR+fZTO9CNGUNokkPatT/0= github.com/charmbracelet/x/exp/golden v0.0.0-20250806222409-83e3a29d542f h1:pk6gmGpCE7F3FcjaOEKYriCvpmIN4+6OS/RD0vm4uIA= github.com/charmbracelet/x/exp/golden v0.0.0-20250806222409-83e3a29d542f/go.mod h1:IfZAMTHB6XkZSeXUqriemErjAWCCzT0LwjKFYCZyw0I= -github.com/charmbracelet/x/exp/strings v0.0.0-20240722160745-212f7b056ed0 h1:qko3AQ4gK1MTS/de7F5hPGx6/k1u0w4TeYmBFwzYVP4= -github.com/charmbracelet/x/exp/strings v0.0.0-20240722160745-212f7b056ed0/go.mod h1:pBhA0ybfXv6hDjQUZ7hk1lVxBiUbupdw5R31yPUViVQ= +github.com/charmbracelet/x/exp/strings v0.0.0-20260122224438-b01af16209d9 h1:JevRYfkTT0sN9OIXAOncYNC0cTP1Gml/0mCSnsmRkRk= +github.com/charmbracelet/x/exp/strings v0.0.0-20260122224438-b01af16209d9/go.mod h1:/ehtMPNh9K4odGFkqYJKpIYyePhdp1hLBRvyY4bWkH8= github.com/charmbracelet/x/term v0.2.2 h1:xVRT/S2ZcKdhhOuSP4t5cLi5o+JxklsoEObBSgfgZRk= github.com/charmbracelet/x/term v0.2.2/go.mod h1:kF8CY5RddLWrsgVwpw4kAa6TESp6EB5y3uxGLeCqzAI= github.com/charmbracelet/x/termios v0.1.1 h1:o3Q2bT8eqzGnGPOYheoYS8eEleT5ZVNYNy8JawjaNZY= @@ -218,6 +255,14 @@ github.com/cncf/xds/go v0.0.0-20260202195803-dba9d589def2 h1:aBangftG7EVZoUb69Os github.com/cncf/xds/go v0.0.0-20260202195803-dba9d589def2/go.mod h1:qwXFYgsP6T7XnJtbKlf1HP8AjxZZyzxMmc+Lq5GjlU4= github.com/coder/websocket v1.8.14 h1:9L0p0iKiNOibykf283eHkKUHHrpG7f65OE3BhhO7v9g= github.com/coder/websocket v1.8.14/go.mod h1:NX3SzP+inril6yawo5CQXx8+fk145lPDC6pumgx0mVg= +github.com/containerd/errdefs v1.0.0 h1:tg5yIfIlQIrxYtu9ajqY42W3lpS19XqdxRQeEwYG8PI= +github.com/containerd/errdefs v1.0.0/go.mod h1:+YBYIdtsnF4Iw6nWZhJcqGSg/dwvV7tyJ/kCkyJ2k+M= +github.com/containerd/errdefs/pkg v0.3.0 h1:9IKJ06FvyNlexW690DXuQNx2KA2cUJXx151Xdx3ZPPE= +github.com/containerd/errdefs/pkg v0.3.0/go.mod h1:NJw6s9HwNuRhnjJhM7pylWwMyAkmCQvQ4GpJHEqRLVk= +github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= +github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= +github.com/containerd/platforms v0.2.1 h1:zvwtM3rz2YHPQsF2CHYM8+KtB5dvhISiXh5ZpSBQv6A= +github.com/containerd/platforms v0.2.1/go.mod h1:XHCb+2/hzowdiut9rkudds9bE5yJ7npe7dG/wG+uFPw= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/creack/pty v1.1.24 h1:bJrF4RRfyJnbTJqzRLHzcGaZK1NeM5kTC9jGgovnR1s= github.com/creack/pty v1.1.24/go.mod h1:08sCNb52WyoAwi2QDyzUCTgcvVFhUzewun7wtTfvcwE= @@ -228,12 +273,30 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/deckarep/golang-set/v2 v2.8.0 h1:swm0rlPCmdWn9mESxKOjWk8hXSqoxOp+ZlfuyaAdFlQ= +github.com/deckarep/golang-set/v2 v2.8.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/dlclark/regexp2 v1.11.5 h1:Q/sSnsKerHeCkc/jSTNq1oCm7KiVgUMZRDUoRu0JQZQ= github.com/dlclark/regexp2 v1.11.5/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= +github.com/docker/go-connections v0.7.0 h1:6SsRfJddP22WMrCkj19x9WKjEDTB+ahsdiGYf0mN39c= +github.com/docker/go-connections v0.7.0/go.mod h1:no1qkHdjq7kLMGUXYAduOhYPSJxxvgWBh7ogVvptn3Q= +github.com/docker/go-sdk/client v0.1.0-alpha013 h1:FtIFLXjwSkQuOA4k6eE4Erz1nfW0d5Aq/lxID/d4Lpw= +github.com/docker/go-sdk/client v0.1.0-alpha013/go.mod h1:6AWYuKRnvTXp+rWYHDrWUui0Aykgl8JdjttukngnKE0= +github.com/docker/go-sdk/config v0.1.0-alpha013 h1:AbVVhOjtuyzlireZ8kJrzd3Xlrqz6CafsBQjLGKOipA= +github.com/docker/go-sdk/config v0.1.0-alpha013/go.mod h1:Eq39AVh06RUJ50fLvJHFKM80P9kZWTiog1x7NzrndBg= +github.com/docker/go-sdk/container v0.1.0-alpha016 h1:qvE173H6pDykJl5zXufDhp0nK4HSPjkfd5gjA+fPjvM= +github.com/docker/go-sdk/container v0.1.0-alpha016/go.mod h1:O0mTuDUPrl6x8BwwL53k1Q0C6wDoUp4xAmE1uLzjszw= +github.com/docker/go-sdk/context v0.1.0-alpha013 h1:he+yf7bEAOvDdeRkkd+vNFHiGhmZV2oSx0j7s9lI7e8= +github.com/docker/go-sdk/context v0.1.0-alpha013/go.mod h1:a+3Mdx3Tss56tN5bajB3YfW29ZHdm6nenlB6yxIaeF4= +github.com/docker/go-sdk/image v0.1.0-alpha015 h1:y0KqSQadpLMURL0jgA8HO79M0nHwQXEjmalPxxAqNwo= +github.com/docker/go-sdk/image v0.1.0-alpha015/go.mod h1:ujOXFWntnGkARHfXiIK/nonx6+8eQLqjWMb9wL35s0I= +github.com/docker/go-sdk/network v0.1.0-alpha013 h1:vl0F5LZLmuF9yBwJ9/6kPJqHOgevSFHNK82t9a2tejQ= +github.com/docker/go-sdk/network v0.1.0-alpha013/go.mod h1:kgEPlBmaYjQwO+a+6IfQmLvo6BC9x8106TbJBBEXF6w= +github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= +github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/ebitengine/purego v0.10.2 h1:W809HbnvzAxgdm+aOvlSekrM16wGCdT/e76+9tS7gzE= @@ -253,8 +316,8 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.14.0 h1:hbG2kr4RuFj222B6+7T83thSPqLjwBIfQawTkC++2HA= github.com/envoyproxy/go-control-plane v0.14.0/go.mod h1:NcS5X47pLl/hfqxU70yPwL9ZMkUlwlKxtAohpi2wBEU= -github.com/envoyproxy/go-control-plane/envoy v1.37.0 h1:u3riX6BoYRfF4Dr7dwSOroNfdSbEPe9Yyl09/B6wBrQ= -github.com/envoyproxy/go-control-plane/envoy v1.37.0/go.mod h1:DReE9MMrmecPy+YvQOAOHNYMALuowAnbjjEMkkWOi6A= +github.com/envoyproxy/go-control-plane/envoy v1.39.1-0.20260819172001-e6e3fd93e4be h1:SWe0x6yfglnxuvOiYgTTnNq7QD/yvqthOh1RBI8Bj8w= +github.com/envoyproxy/go-control-plane/envoy v1.39.1-0.20260819172001-e6e3fd93e4be/go.mod h1:PYEOlng9XcrulfyWpm49jECTPV0LT4q8cO7fLW/xwgk= github.com/envoyproxy/go-control-plane/ratelimit v0.1.0 h1:/G9QYbddjL25KvtKTv3an9lx6VBE2cnb8wp1vEGNYGI= github.com/envoyproxy/go-control-plane/ratelimit v0.1.0/go.mod h1:Wk+tMFAFbCXaJPzVVHnPgRKdUdwW/KdbRt94AzgRee4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= @@ -270,30 +333,46 @@ github.com/fergusstrange/embedded-postgres v1.34.0 h1:c6RKhPKFsLVU+Tdxsx8q0UxCHs github.com/fergusstrange/embedded-postgres v1.34.0/go.mod h1:w0YvnCgf19o6tskInrOOACtnqfVlOvluz3hlNLY7tRk= github.com/firebase/genkit/go v1.13.1 h1:6fgQ0ogxG+SIgtYQD/yf8T0+39lacioB5voFdFYk1tI= github.com/firebase/genkit/go v1.13.1/go.mod h1:nWewix7d2O+oikJ035XPmY4mrO2phXwmk6NekKmaDLU= -github.com/flanksource/clicky v1.21.88-0.20261027204456-34e65b99d69d h1:S8zFjrGZZj+HoOPt0YnUMgOt7YvLY1T4v9ifpsQphW8= -github.com/flanksource/clicky v1.21.88-0.20261027204456-34e65b99d69d/go.mod h1:2hh1pw/svkWomN+Ah946CD7zcwuGxvRSnR0PTSqMe/Y= -github.com/flanksource/clicky/aichat v1.21.82 h1:ccvtLRaQCQlAN+FVF3jp6I71CdycQwKrpicYB0ZeaX0= -github.com/flanksource/clicky/aichat v1.21.82/go.mod h1:Wa5PhmTSCimtWVu5KIy+PG7+x9+EICQPNlH6O83+dM0= -github.com/flanksource/commons v1.61.1-0.20261027203923-c5cfedcdae97 h1:vwBa3L3UPL7+zcJ+gG6NH1cZ8AAH4XxShkd+AQ4uY4Y= -github.com/flanksource/commons v1.61.1-0.20261027203923-c5cfedcdae97/go.mod h1:RlVSQ+Jq96jKaJWf3WnwVO4DmDTdzkm3sremzJuYuVw= -github.com/flanksource/commons-db v0.1.61-0.20261027210213-a7b138ebccde h1:QfMh6xZcg9/ksRl5k1Zpd1Enov932Z/xltj8hbRbLkY= -github.com/flanksource/commons-db v0.1.61-0.20261027210213-a7b138ebccde/go.mod h1:81yea1KIjO52xC2uoehwTd8BfnxSN+S6aoGYVDLuLp4= +github.com/flanksource/clicky v1.21.95-0.20261112060413-ae2c0bb79614 h1:Ls5AwnjPoDSGJH+pzlwlmXNF9u4nqs2wRUUqa8ljxLs= +github.com/flanksource/clicky v1.21.95-0.20261112060413-ae2c0bb79614/go.mod h1:H4HeUqMEzAz14ewqX5CNu/VnlaZHrTK/1otCgs1O1m4= +github.com/flanksource/clicky/aichat v1.21.91 h1:1yHU8qyHlOyOSbC97MP5XK8A/OAF6NvPulI7Y2MEUmw= +github.com/flanksource/clicky/aichat v1.21.91/go.mod h1:tt9CM4VIZSUbBTtgsri6NgtdCzCOgX1jEeC791TdUy4= +github.com/flanksource/clicky/valkey v1.21.82 h1:6R0Uysg4pJfVu1RmUqdXQqHLhtutHqy24tsAESwa5Ns= +github.com/flanksource/clicky/valkey v1.21.82/go.mod h1:ulGU+1dpyJZ106CS3fMinoVZ8lec2zaJDhWxqCLFa+o= +github.com/flanksource/commons v1.64.1 h1:qm6ZnsoTw9JxzzH3R3WJs9kKig0+nfMBXJomWgCi/VU= +github.com/flanksource/commons v1.64.1/go.mod h1:XauWx50brQc4kK6t9OwK9JVMXy/Aq99mX6w6txASBag= +github.com/flanksource/commons-db v0.1.69 h1:oxNc0ChQqASBEA4JaVJGPirOV82ZltDJ1mxQmNX9ZR4= +github.com/flanksource/commons-db v0.1.69/go.mod h1:grmVCAlfxqk8OuQRi1Jmgs9k3QELNVCDDJl3I3EsNAQ= +github.com/flanksource/commons-db/cmd/query v0.1.67 h1:n9ztHMGI6yIpeP4A1DlVp34RbZ+W7iOZRONOjupow5w= +github.com/flanksource/commons-db/cmd/query v0.1.67/go.mod h1:1ndCzXoFPSCLbDaSh0sgUbNz8INRDk5Rme89poJMfm4= +github.com/flanksource/commons-db/recordstore v0.1.67 h1:aefhLpKm8ZKKGXWTf85mdMcSwT+p6HFyVf00WtafN3c= +github.com/flanksource/commons-db/recordstore v0.1.67/go.mod h1:BUF54sbQmw4MWYhh9g3SnnnNXP8hmBG3PduOmiV11X0= +github.com/flanksource/commons-db/tracing v0.1.67 h1:sEJqjwwr2sJd8xSCT4Vezr9KxwjD3PcOwuD34rhHcKA= +github.com/flanksource/commons-db/tracing v0.1.67/go.mod h1:ojkSxwTjb5AVh+mmFWodeWt0GFp2157t9IxDIdtvTrU= +github.com/flanksource/deps v1.0.51 h1:i5iOzDTVTLdvXfMfan0tNZQAtaYxcipk0nJwE9FhMEk= +github.com/flanksource/deps v1.0.51/go.mod h1:/AdWJJhDH/Phs+NxR2RLiwM3sHgBzb+LNgqAwtcyYgU= +github.com/flanksource/deps/start v0.0.0-20261103114210-92d640aba10a h1:gJ2Ngheips7UQeJTEHcyUE7dcbIW0I0s2+z9HFA5UVg= +github.com/flanksource/deps/start v0.0.0-20261103114210-92d640aba10a/go.mod h1:2di5Ubu3eec1O3dAjFm2UgdRdomLw8WP7jMS3D0wjxI= +github.com/flanksource/gavel v0.0.79 h1:j45uzhdvtVPrH51wcaRlqj5LM2iImrsqj7gAtH0zFes= +github.com/flanksource/gavel v0.0.79/go.mod h1:9daOeCBQbYAdOrYPaORlq1Ar2NlEs59/kVN37N0U7XQ= github.com/flanksource/gomplate/v3 v3.24.90 h1:MAUlwU7REhSL62i4n74yvo+T4LA7HuRpJ9tKH9dbMzk= github.com/flanksource/gomplate/v3 v3.24.90/go.mod h1:tcjpBIaHboWVPUYt973dGLCWgTD1sOHdiFgA/AaPBPQ= -github.com/flanksource/is-healthy v1.0.92 h1:15lC+p1RmyO1kOdZdpHdheqysgIK+hQD2ftSQ64gDg0= -github.com/flanksource/is-healthy v1.0.92/go.mod h1:Gm46NfdDQsK9yDZNUNvkCm7jNnbl8R5vfcUYG3BgPXg= +github.com/flanksource/is-healthy v1.0.93 h1:hpXkPfMXG+zawNs0HTjc/3ZIjrW7obAPDR/VoTJk59Q= +github.com/flanksource/is-healthy v1.0.93/go.mod h1:Ee0lzss7zeLlfYOcr4r3eOUJqTD3fjVnxT5cv79UVF8= github.com/flanksource/kubectl-neat v1.0.4 h1:t5/9CqgE84oEtB0KitgJ2+WIeLfD+RhXSxYrqb4X8yI= github.com/flanksource/kubectl-neat v1.0.4/go.mod h1:Un/Voyh3cmiZNKQrW/TkAl28nAA7vwnwDGVjRErKjOw= +github.com/flanksource/repomap v0.4.1 h1:Cl5CiwYJX/NKes9qy0U3fKshO4jR0+wzND8+VfBIXII= +github.com/flanksource/repomap v0.4.1/go.mod h1:cEV1sJNWhOruzSU65LtH/k6kkjZSZW4rOUwl86DrO7w= github.com/flanksource/sandbox-runtime v1.0.2 h1:dEaVyUpeaCAn3GOiWcNDrPguaey1Gx9eTsPAc27W3Eg= github.com/flanksource/sandbox-runtime v1.0.2/go.mod h1:x5Ywc1MrP3lTgmj0VUCeFJzrDZ3mBhBV4Gdc/ioV76M= -github.com/flanksource/sqlglot-go v1.0.4-0.20261022123344-3264e440e925 h1:sQGUeHC+LP/rhh9lNBbQ9our+JYY1cgHQYPSTZKiMSw= -github.com/flanksource/sqlglot-go v1.0.4-0.20261022123344-3264e440e925/go.mod h1:lLkHKgcKwoLDcZ+VchYEp3mNic7fJml4bc8HXyh4vzY= +github.com/flanksource/sqlglot-go v1.1.1 h1:9AlEb41+Ll+W/PQwl7ctZMKo3phXF5f2jznsAcUmt9Y= +github.com/flanksource/sqlglot-go v1.1.1/go.mod h1:aDnAJW6L2s2EXgiM8blbZ+ldV76Rdyu87KkPZJxFQIY= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.10.1 h1:b0/UzAf9yR5rhf3RPm9gf3ehBPpf0oZKIjtpKrx59Ho= github.com/fsnotify/fsnotify v1.10.1/go.mod h1:TLheqan6HD6GBK6PrDWyDPBaEV8LspOxvPSjC+bVfgo= -github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM= -github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ= +github.com/fxamacker/cbor/v2 v2.9.1 h1:2rWm8B193Ll4VdjsJY28jxs70IdDsHRWgQYAI80+rMQ= +github.com/fxamacker/cbor/v2 v2.9.1/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ= github.com/geoffgarside/ber v1.1.0/go.mod h1:jVPKeCbj6MvQZhwLYsGwaGI52oUorHoHKNecGT85ZCc= github.com/geoffgarside/ber v1.2.0 h1:/loowoRcs/MWLYmGX9QtIAbA+V/FrnVLsMMPhwiRm64= github.com/geoffgarside/ber v1.2.0/go.mod h1:jVPKeCbj6MvQZhwLYsGwaGI52oUorHoHKNecGT85ZCc= @@ -319,11 +398,11 @@ github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMj github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= github.com/go-git/go-git/v5 v5.19.2 h1:wkfn7vOlUBu8ivAWKBWisTiwJK4jYHzTF8Ndv1LyGqY= github.com/go-git/go-git/v5 v5.19.2/go.mod h1:QqCBE1EFN5ddFmrliLQ3/ntRCUjZU3EJuwuB/jWEHjk= -github.com/go-jose/go-jose/v4 v4.1.4 h1:moDMcTHmvE6Groj34emNPLs/qtYXRVcd6S7NHbHz3kA= -github.com/go-jose/go-jose/v4 v4.1.4/go.mod h1:x4oUasVrzR7071A4TnHLGSPpNOm2a21K9Kf04k1rs08= +github.com/go-jose/go-jose/v4 v4.1.7 h1:Nac/98uT5LPkfbiFuYa8ktf62a2VxwQ4xbq1GK8pV5E= +github.com/go-jose/go-jose/v4 v4.1.7/go.mod h1:x4oUasVrzR7071A4TnHLGSPpNOm2a21K9Kf04k1rs08= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= -github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.4 h1:tG4xh9yMsRCAiodLVTxyrkzSZ9+o0L1Kg/+cPVcbP/8= +github.com/go-logr/logr v1.4.4/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= @@ -331,52 +410,56 @@ github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/go-openapi/inflect v0.21.5 h1:M2RCq6PPS3YbIaL7CXosGL3BbzAcmfBAT0nC3YfesZA= github.com/go-openapi/inflect v0.21.5/go.mod h1:GypUyi6bU880NYurWaEH2CmH84zFDNd+EhhmzroHmB4= -github.com/go-openapi/jsonpointer v0.22.5 h1:8on/0Yp4uTb9f4XvTrM2+1CPrV05QPZXu+rvu2o9jcA= -github.com/go-openapi/jsonpointer v0.22.5/go.mod h1:gyUR3sCvGSWchA2sUBJGluYMbe1zazrYWIkWPjjMUY0= -github.com/go-openapi/jsonreference v0.21.4 h1:24qaE2y9bx/q3uRK/qN+TDwbok1NhbSmGjjySRCHtC8= -github.com/go-openapi/jsonreference v0.21.4/go.mod h1:rIENPTjDbLpzQmQWCj5kKj3ZlmEh+EFVbz3RTUh30/4= -github.com/go-openapi/swag v0.25.4 h1:OyUPUFYDPDBMkqyxOTkqDYFnrhuhi9NR6QVUvIochMU= -github.com/go-openapi/swag v0.25.4/go.mod h1:zNfJ9WZABGHCFg2RnY0S4IOkAcVTzJ6z2Bi+Q4i6qFQ= -github.com/go-openapi/swag/cmdutils v0.25.4 h1:8rYhB5n6WawR192/BfUu2iVlxqVR9aRgGJP6WaBoW+4= -github.com/go-openapi/swag/cmdutils v0.25.4/go.mod h1:pdae/AFo6WxLl5L0rq87eRzVPm/XRHM3MoYgRMvG4A0= -github.com/go-openapi/swag/conv v0.25.4 h1:/Dd7p0LZXczgUcC/Ikm1+YqVzkEeCc9LnOWjfkpkfe4= -github.com/go-openapi/swag/conv v0.25.4/go.mod h1:3LXfie/lwoAv0NHoEuY1hjoFAYkvlqI/Bn5EQDD3PPU= -github.com/go-openapi/swag/fileutils v0.25.4 h1:2oI0XNW5y6UWZTC7vAxC8hmsK/tOkWXHJQH4lKjqw+Y= -github.com/go-openapi/swag/fileutils v0.25.4/go.mod h1:cdOT/PKbwcysVQ9Tpr0q20lQKH7MGhOEb6EwmHOirUk= -github.com/go-openapi/swag/jsonname v0.25.5 h1:8p150i44rv/Drip4vWI3kGi9+4W9TdI3US3uUYSFhSo= -github.com/go-openapi/swag/jsonname v0.25.5/go.mod h1:jNqqikyiAK56uS7n8sLkdaNY/uq6+D2m2LANat09pKU= -github.com/go-openapi/swag/jsonutils v0.25.4 h1:VSchfbGhD4UTf4vCdR2F4TLBdLwHyUDTd1/q4i+jGZA= -github.com/go-openapi/swag/jsonutils v0.25.4/go.mod h1:7OYGXpvVFPn4PpaSdPHJBtF0iGnbEaTk8AvBkoWnaAY= -github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.4 h1:IACsSvBhiNJwlDix7wq39SS2Fh7lUOCJRmx/4SN4sVo= -github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.4/go.mod h1:Mt0Ost9l3cUzVv4OEZG+WSeoHwjWLnarzMePNDAOBiM= -github.com/go-openapi/swag/loading v0.25.4 h1:jN4MvLj0X6yhCDduRsxDDw1aHe+ZWoLjW+9ZQWIKn2s= -github.com/go-openapi/swag/loading v0.25.4/go.mod h1:rpUM1ZiyEP9+mNLIQUdMiD7dCETXvkkC30z53i+ftTE= -github.com/go-openapi/swag/mangling v0.25.4 h1:2b9kBJk9JvPgxr36V23FxJLdwBrpijI26Bx5JH4Hp48= -github.com/go-openapi/swag/mangling v0.25.4/go.mod h1:6dxwu6QyORHpIIApsdZgb6wBk/DPU15MdyYj/ikn0Hg= -github.com/go-openapi/swag/netutils v0.25.4 h1:Gqe6K71bGRb3ZQLusdI8p/y1KLgV4M/k+/HzVSqT8H0= -github.com/go-openapi/swag/netutils v0.25.4/go.mod h1:m2W8dtdaoX7oj9rEttLyTeEFFEBvnAx9qHd5nJEBzYg= -github.com/go-openapi/swag/stringutils v0.25.4 h1:O6dU1Rd8bej4HPA3/CLPciNBBDwZj9HiEpdVsb8B5A8= -github.com/go-openapi/swag/stringutils v0.25.4/go.mod h1:GTsRvhJW5xM5gkgiFe0fV3PUlFm0dr8vki6/VSRaZK0= -github.com/go-openapi/swag/typeutils v0.25.4 h1:1/fbZOUN472NTc39zpa+YGHn3jzHWhv42wAJSN91wRw= -github.com/go-openapi/swag/typeutils v0.25.4/go.mod h1:Ou7g//Wx8tTLS9vG0UmzfCsjZjKhpjxayRKTHXf2pTE= -github.com/go-openapi/swag/yamlutils v0.25.4 h1:6jdaeSItEUb7ioS9lFoCZ65Cne1/RZtPBZ9A56h92Sw= -github.com/go-openapi/swag/yamlutils v0.25.4/go.mod h1:MNzq1ulQu+yd8Kl7wPOut/YHAAU/H6hL91fF+E2RFwc= -github.com/go-openapi/testify/enable/yaml/v2 v2.4.0 h1:7SgOMTvJkM8yWrQlU8Jm18VeDPuAvB/xWrdxFJkoFag= -github.com/go-openapi/testify/enable/yaml/v2 v2.4.0/go.mod h1:14iV8jyyQlinc9StD7w1xVPW3CO3q1Gj04Jy//Kw4VM= -github.com/go-openapi/testify/v2 v2.4.0 h1:8nsPrHVCWkQ4p8h1EsRVymA2XABB4OT40gcvAu+voFM= -github.com/go-openapi/testify/v2 v2.4.0/go.mod h1:HCPmvFFnheKK2BuwSA0TbbdxJ3I16pjwMkYkP4Ywn54= +github.com/go-openapi/jsonpointer v1.0.0 h1:kR9tHqY0CtZaOPVFm622dPVNhrvYpwr4uCxgL3h1H8s= +github.com/go-openapi/jsonpointer v1.0.0/go.mod h1:Z3rw7dWu1p9IgitXCFamSlA5lmDiklEB6vkaxcNZW5Y= +github.com/go-openapi/jsonreference v1.0.0 h1:jlmTr6torcd1YgDQvSfNmRtKzYDO4FGBkrAdlAVWnpY= +github.com/go-openapi/jsonreference v1.0.0/go.mod h1:jtwdyGbJk0Xhe5Y+rwtglQP6Sb1WZST4rT32LWB+sv0= +github.com/go-openapi/swag v0.28.0 h1:xkgbOSKj6DZziNpyqRRAOt3GJGtgjgsd2RoyT30VWuw= +github.com/go-openapi/swag v0.28.0/go.mod h1:4qYnT3Cqr1p1VknOdPo70evN4rgQnAg6jwApHyxSGIg= +github.com/go-openapi/swag/cmdutils v0.28.0 h1:7TOeNtkYru1SG8Y34tDh9WBbLsMqGnptuxWiHREPZ4Q= +github.com/go-openapi/swag/cmdutils v0.28.0/go.mod h1:Sm1MVFMkF6guJJ+pQqHnQA3N0j9qALV3NxzDSv6bETM= +github.com/go-openapi/swag/conv v0.28.0 h1:GtqqbyFe7vR5Y7ehxG9W6/OvrSFdf1OLeTGp40TqxH8= +github.com/go-openapi/swag/conv v0.28.0/go.mod h1:mbUE+mzctnhxi864m0Q07SpN8OowD9JhxmxuYvZZD/k= +github.com/go-openapi/swag/fileutils v0.28.0 h1:Z04XWQD7R8Eq+7GnOrjovBxPPmZzsS4gt2H2GPGIViU= +github.com/go-openapi/swag/fileutils v0.28.0/go.mod h1:VvJFZLTZS0AI854gEQz5tk7dBESdLjiNUMSZ/th2ry8= +github.com/go-openapi/swag/jsonutils v0.28.0 h1:YIch6FwO7RXzeAnbO8Tu7dWBZeUEH+4nA0HXltVTnv4= +github.com/go-openapi/swag/jsonutils v0.28.0/go.mod h1:CYM3WlTUcagR2ZoHdz54di/cbBqt82tuxuXgAjxw+mg= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.28.0 h1:qV+VVUAx5Oro8WjVWpZeql7YReTKhT4smR4zhcOQZr0= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.28.0/go.mod h1:mofwUWx70wvskwESqRJ//k/9kURmCgyJl5m5Ppoh5kY= +github.com/go-openapi/swag/loading v0.28.0 h1:td8QZdZC9MIYGGSnSPKShKiK22I2tU5UQvuUhIBPRLU= +github.com/go-openapi/swag/loading v0.28.0/go.mod h1:rXB0QiQX5mMveXEA7ouM4KiiM9jVJe4K6BVbwhD1M4k= +github.com/go-openapi/swag/mangling v0.28.0 h1:pH8eyeNO9SLYsTMWJrurnNfKmDa28XrlA+HePVD53VM= +github.com/go-openapi/swag/mangling v0.28.0/go.mod h1:jtBE2+V+3pILxOR7Vgce+Cwp6A2PgZbvVqfNntbVs0w= +github.com/go-openapi/swag/netutils v0.28.0 h1:YXN6TALEi2pzts8/8GNm6T61HTAZsieukGZidap989k= +github.com/go-openapi/swag/netutils v0.28.0/go.mod h1:J+WYyFMLtvtCGqa6jLv+YNUmIKI3ZRQRrvfNDMoQoEQ= +github.com/go-openapi/swag/pools v0.28.0 h1:HPMZWSAfce3rdVTFcjFiCIBtDg9h4x2QlRrHipwhxeU= +github.com/go-openapi/swag/pools v0.28.0/go.mod h1:kVQefhSK5RWuRe7BXsL8htgBPAMpN7HDGpGEknqugeE= +github.com/go-openapi/swag/stringutils v0.28.0 h1:ixsc9iYgDPubHL/8nSkbnryEHpD2VRlBMLKpQyPXcDU= +github.com/go-openapi/swag/stringutils v0.28.0/go.mod h1:lzRN95CxXmA03XcDWHLOb6nOMcxCqR5rGY0lOgsfRoM= +github.com/go-openapi/swag/typeutils v0.28.0 h1:nRBKSBXjDgf01VDPB3fWeD9nQuhCOVeIYAkUx2tbkyY= +github.com/go-openapi/swag/typeutils v0.28.0/go.mod h1:Srm0xFNRZ1Y+vCxJclo5qzx8aj+1pAKda/YfFPrG0dQ= +github.com/go-openapi/swag/yamlutils v0.28.0 h1:TV3JXH6DS46KUroDtMLAYHGkdWf5VDq3wVWFirmzROY= +github.com/go-openapi/swag/yamlutils v0.28.0/go.mod h1:x0q/yndZHEgk9Rx3DyDqzFUmHy55KTvIZldvF2dTJXs= +github.com/go-openapi/testify/enable/yaml/v2 v2.6.0 h1:gGHwAJ0R/5jU8BEGDbfRNR3hL68dAVi84WuOApp29B0= +github.com/go-openapi/testify/enable/yaml/v2 v2.6.0/go.mod h1:tY+St1SGq4NFl0QIqdTY4aEdbChAHxhyB77XQi9iJCo= +github.com/go-openapi/testify/v2 v2.6.0 h1:5PKH2HE7YJ/LuRPQGvSxBRlFXNQhSetBLlGAgUEu3ug= +github.com/go-openapi/testify/v2 v2.6.0/go.mod h1:SgsVHtfooshd0tublTtJ50FPKhujf47YRqauXXOUxfw= github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7eI= github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow= github.com/go-sql-driver/mysql v1.10.0 h1:Q+1LV8DkHJvSYAdR83XzuhDaTykuDx0l6fkXxoWCWfw= github.com/go-sql-driver/mysql v1.10.0/go.mod h1:M+cqaI7+xxXGG9swrdeUIoPG3Y3KCkF0pZej+SK+nWk= +github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= +github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= -github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= -github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= +github.com/go-test/deep v1.1.1 h1:0r/53hagsehfO4bzD2Pgr/+RgHqhmf+k1Bpse2cTu1U= +github.com/go-test/deep v1.1.1/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= github.com/go-xmlfmt/xmlfmt v1.1.3 h1:t8Ey3Uy7jDSEisW2K3somuMKIpzktkWptA0iFCnRUWY= github.com/go-xmlfmt/xmlfmt v1.1.3/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= +github.com/goccy/go-json v0.10.6 h1:p8HrPJzOakx/mn/bQtjgNjdTcN+/S6FcG2CTtQOrHVU= +github.com/goccy/go-json v0.10.6/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= github.com/goccy/go-yaml v1.19.2 h1:PmFC1S6h8ljIz6gMRBopkjP1TVT7xuwrButHID66PoM= github.com/goccy/go-yaml v1.19.2/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA= github.com/gofrs/flock v0.13.0 h1:95JolYOvGMqeH31+FC7D2+uULf6mG61mEZ/A8dRYMzw= @@ -413,6 +496,8 @@ github.com/google/cel-go v0.31.0 h1:H0bhpFTqOvmHrBGrWKp7ZlhBm5Hh8PYUEXnwxT1LL7A= github.com/google/cel-go v0.31.0/go.mod h1:X0bD6iVNR8pkROSOoHVdgTkzmRcosof7WQqCD6wcMc8= github.com/google/dotprompt/go v0.0.0-20260708220100-73beb993ac95 h1:SJdnmyOaT+kZNcUR+a1y2+Oa51j2ctCjYbtexaiXN68= github.com/google/dotprompt/go v0.0.0-20260708220100-73beb993ac95/go.mod h1:dnlL7KrFwJ7s8EJdsAp1WdLqOalJq1Sx2jWZnQkhFXs= +github.com/google/flatbuffers v25.12.19+incompatible h1:haMV2JRRJCe1998HeW/p0X9UaMTK6SDo0ffLn2+DbLs= +github.com/google/flatbuffers v25.12.19+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/gnostic-models v0.7.1 h1:SisTfuFKJSKM5CPZkffwi6coztzzeYUhc3v4yxLWH8c= github.com/google/gnostic-models v0.7.1/go.mod h1:whL5G0m6dmc5cPxKc5bdKdEN3UjI7OUGxBlw57miDrQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -423,21 +508,28 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/go-github/v57 v57.0.0 h1:L+Y3UPTY8ALM8x+TV0lg+IEBI+upibemtBD8Q9u7zHs= +github.com/google/go-github/v57 v57.0.0/go.mod h1:s0omdnye0hvK/ecLvpsGfJMiRt85PimQh4oygmLIxHw= +github.com/google/go-querystring v1.2.0 h1:yhqkPbu2/OH+V9BfpCVPZkNmUXhb2gBxJArfhIxNtP0= +github.com/google/go-querystring v1.2.0/go.mod h1:8IFJqpSRITyJ8QhQ13bmbeMBDfmeEJZD5A0egEOmkqU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/jsonschema-go v0.4.2 h1:tmrUohrwoLZZS/P3x7ex0WAVknEkBZM46iALbcqoRA8= -github.com/google/jsonschema-go v0.4.2/go.mod h1:r5quNTdLOYEz95Ru18zA0ydNbBuYoo9tgaYcxEYhJVE= +github.com/google/gops v0.3.29 h1:n98J2qSOK1NJvRjdLDcjgDryjpIBGhbaqph1mXKL0rY= +github.com/google/gops v0.3.29/go.mod h1:8N3jZftuPazvUwtYY/ncG4iPrjp15ysNKLfq+QQPiwc= +github.com/google/jsonschema-go v0.4.3 h1:/DBOLZTfDow7pe2GmaJNhltueGTtDKICi8V8p+DQPd0= +github.com/google/jsonschema-go v0.4.3/go.mod h1:r5quNTdLOYEz95Ru18zA0ydNbBuYoo9tgaYcxEYhJVE= github.com/google/martian/v3 v3.3.3 h1:DIhPTQrbPkgs2yJYdXU/eNACCG5DVQjySNRNlflZ9Fc= github.com/google/martian/v3 v3.3.3/go.mod h1:iEPrYcgCF7jA9OtScMFQyAlZZ4YXTKEtJ1E6RWzmBA0= -github.com/google/pprof v0.0.0-20260402051712-545e8a4df936 h1:EwtI+Al+DeppwYX2oXJCETMO23COyaKGP6fHVpkpWpg= -github.com/google/pprof v0.0.0-20260402051712-545e8a4df936/go.mod h1:MxpfABSjhmINe3F1It9d+8exIHFvUqtLIRCdOGNXqiI= +github.com/google/pprof v0.0.0-20260507013755-92041b743c96 h1:YDDnaZ9afWajDboPMt9Vikqca/yWAX7KAxVzb4lJU1M= +github.com/google/pprof v0.0.0-20260507013755-92041b743c96/go.mod h1:MxpfABSjhmINe3F1It9d+8exIHFvUqtLIRCdOGNXqiI= github.com/google/s2a-go v0.1.9 h1:LGD7gtMgezd8a/Xak7mEWL0PjoTQFvpRudN895yqKW0= github.com/google/s2a-go v0.1.9/go.mod h1:YA0Ei2ZQL3acow2O62kdp9UlnvMmU7kA6Eutn0dXayM= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.1-0.20241114170450-2d3c2a9cc518 h1:UBg1xk+oAsIVbFuGg6hdfAm7EvCv3EL80vFxJNsslqw= +github.com/google/uuid v1.6.1-0.20241114170450-2d3c2a9cc518/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/wire v0.7.0 h1:JxUKI6+CVBgCO2WToKy/nQk0sS+amI9z9EjVmdaocj4= github.com/google/wire v0.7.0/go.mod h1:n6YbUQD9cPKTnHXEBN2DXlOp/mVADhVErcMFb0v3J18= github.com/googleapis/enterprise-certificate-proxy v0.3.17 h1:73NfMHdiqo9JFU9+7a5ExpVa10/R29pXfZIaW559nrg= @@ -450,8 +542,8 @@ github.com/gosimple/slug v1.15.0 h1:wRZHsRrRcs6b0XnxMUBM6WK1U1Vg5B0R7VkIf1Xzobo= github.com/gosimple/slug v1.15.0/go.mod h1:UiRaFH+GEilHstLUmcBgWcI42viBN7mAb818JrYOeFQ= github.com/gosimple/unidecode v1.0.1 h1:hZzFTMMqSswvf0LBJZCZgThIZrpDHFXux9KeGmn6T/o= github.com/gosimple/unidecode v1.0.1/go.mod h1:CP0Cr1Y1kogOtx0bJblKzsVWrqYaqfNOnHzpgWw4Awc= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0 h1:5VipnvEpbqr2gA2VbM+nYVbkIF28c5ZQfqCBQ5g2xfk= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0/go.mod h1:Hyl3n6Twe1hvtd9XUXDec4pTvgMSEixRuQKPTMH2bNs= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 h1:/Tnpcb2E0Pz/tN9s3bfEY2Q8ePCEX9iuS+cneUwncnw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0/go.mod h1:zOBXOsUaBSjKgmH4OGzV1esUpR3oUSCPYVd2cUBjKYY= github.com/hairyhenderson/toml v0.4.2-0.20210923231440-40456b8e66cf h1:I1sbT4ZbIt9i+hB1zfKw2mE8C12TuGxPiW7YmtLbPa4= github.com/hairyhenderson/toml v0.4.2-0.20210923231440-40456b8e66cf/go.mod h1:jDHmWDKZY6MIIYltYYfW4Rs7hQ50oS4qf/6spSiZAxY= github.com/hairyhenderson/yaml v0.0.0-20220618171115-2d35fca545ce h1:cVkYhlWAxwuS2/Yp6qPtcl0fGpcWxuZNonywHZ6/I+s= @@ -492,6 +584,7 @@ github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath v0.4.1-0.20220621161143-b0104c826a24 h1:liMMTbpW34dhU4az1GN0pTPADwNmvoRSeoZ6PItiqnY= github.com/jmespath/go-jmespath v0.4.1-0.20220621161143-b0104c826a24/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= @@ -527,8 +620,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/labstack/echo/v4 v4.15.2 h1:nnh2sCzGCVYnU+wCisMPiYapEg/QVo/gcI9ePKg5/T4= -github.com/labstack/echo/v4 v4.15.2/go.mod h1:Xzp1Ns1RA2c9fY7nSgUJkpkUZGNbEIVHZbtbOMPktBI= +github.com/labstack/echo/v4 v4.16.3 h1:wAzM49wiBxHpZJQ621lminvdxbwfd1Cn6KwRThKV6nA= +github.com/labstack/echo/v4 v4.16.3/go.mod h1:V/EQaTVHYJH92QhbQe7kFQ4mjgcjxLQQUQtAN87zZdw= github.com/labstack/gommon v0.5.0 h1:6VSQ2NOzsnEJ5W6+84E0RbcaDDmgB6NIAzWCczTEe6c= github.com/labstack/gommon v0.5.0/go.mod h1:Rzlg7HHy1maLfzBYGg9NZcVuz1sA68HHhLjhcEllYE0= github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 h1:SOEGU9fKiNWd/HOJuq6+3iTQz8KNCLtVX6idSoTLdUw= @@ -547,8 +640,10 @@ github.com/mark3labs/mcp-go v0.56.0 h1:7aCj2wODCskMi08f923ADG+EfELZBdiKILny415cI github.com/mark3labs/mcp-go v0.56.0/go.mod h1:+8WclSK1ZUweCP3hvktSji8n8ABG/95QaEkeVE/Uwas= github.com/maruel/natural v1.1.1 h1:Hja7XhhmvEFhcByqDoHz9QZbkWey+COd9xWfCfn1ioo= github.com/maruel/natural v1.1.1/go.mod h1:v+Rfd79xlw1AgVBjbO0BEQmptqb5HvL/k9GRHB7ZKEg= -github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE= -github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= +github.com/maruel/panicparse/v2 v2.5.0 h1:yCtuS0FWjfd0RTYMXGpDvWcb0kINm8xJGu18/xMUh00= +github.com/maruel/panicparse/v2 v2.5.0/go.mod h1:DA2fDiBk63bKfBf4CVZP9gb4fuvzdPbLDsSI873hweQ= +github.com/mattn/go-colorable v0.1.15 h1:+u9SLTRGnXv73cEsnsmoZBom+dMU88B2M0aDcWy0/jY= +github.com/mattn/go-colorable v0.1.15/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= github.com/mattn/go-isatty v0.0.22 h1:j8l17JJ9i6VGPUFUYoTUKPSgKe/83EYU2zBC7YNKMw4= github.com/mattn/go-isatty v0.0.22/go.mod h1:ZXfXG4SQHsB/w3ZeOYbR0PrPwLy+n6xiMrJlRFqopa4= github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4= @@ -569,8 +664,26 @@ github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4 github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/zz4kQkprJgF2EVszyDE= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0= +github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= +github.com/moby/go-archive v0.1.0 h1:Kk/5rdW/g+H8NHdJW2gsXyZ7UnzvJNOy6VKJqueWdcQ= +github.com/moby/go-archive v0.1.0/go.mod h1:G9B+YoujNohJmrIYFBpSd54GTUB4lt9S+xVQvsJyFuo= +github.com/moby/moby/api v1.52.0 h1:00BtlJY4MXkkt84WhUZPRqt5TvPbgig2FZvTbe3igYg= +github.com/moby/moby/api v1.52.0/go.mod h1:8mb+ReTlisw4pS6BRzCMts5M49W5M7bKt1cJy/YbAqc= +github.com/moby/moby/client v0.1.0 h1:nt+hn6O9cyJQqq5UWnFGqsZRTS/JirUqzPjEl0Bdc/8= +github.com/moby/moby/client v0.1.0/go.mod h1:O+/tw5d4a1Ha/ZA/tPxIZJapJRUS6LNZ1wiVRxYHyUE= +github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk= +github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc= github.com/moby/spdystream v0.5.1 h1:9sNYeYZUcci9R6/w7KDaFWEWeV4LStVG78Mpyq/Zm/Y= github.com/moby/spdystream v0.5.1/go.mod h1:xBAYlnt/ay+11ShkdFKNAG7LsyK/tmNBVvVOwrfMgdI= +github.com/moby/sys/sequential v0.6.0 h1:qrx7XFUd/5DxtqcoH1h438hF5TmOvzC/lspjy7zgvCU= +github.com/moby/sys/sequential v0.6.0/go.mod h1:uyv8EUTrca5PnDsdMGXhZe6CCe8U/UiTWd+lL+7b/Ko= +github.com/moby/sys/user v0.4.0 h1:jhcMKit7SA80hivmFJcbB1vqmw//wU61Zdui2eQXuMs= +github.com/moby/sys/user v0.4.0/go.mod h1:bG+tYYYJgaMtRKgEmuueC0hJEAZWwtIbZTB+85uoHjs= +github.com/moby/sys/userns v0.1.0 h1:tVLXkFOxVu9A64/yh59slHVv9ahO9UIev4JZusOLG/g= +github.com/moby/sys/userns v0.1.0/go.mod h1:IHUYgu/kao6N8YZlp9Cf444ySSvCmDlmzUcYfDHOl28= +github.com/moby/term v0.5.2 h1:6qk3FJAFDs6i/q3W/pQ97SX192qKfZgGjCQqfCJkgzQ= +github.com/moby/term v0.5.2/go.mod h1:d3djjFCrjnB+fl8NJux+EJzu0msscUP+f8it8hPkFLc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -590,6 +703,8 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mxschmitt/playwright-go v0.6201.1 h1:KBBDopE+IIdjAp2FIk6zhLcKCCSSx/T6rGjKZmfo/Bs= +github.com/mxschmitt/playwright-go v0.6201.1/go.mod h1:vLBP2yVO1gokUlb9ENA+YE3VQaVqf2A9BGxcb7aPjMI= github.com/ncruces/go-strftime v1.0.0 h1:HMFp8mLCTPp341M/ZnA4qaf7ZlsbTc+miZjCLOFAw7w= github.com/ncruces/go-strftime v1.0.0/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls= github.com/nukilabs/ftoa v1.0.0 h1:AiCb9begI2rwjDQm7/H+ce1ctdkixnOOw/bpurZTySc= @@ -608,10 +723,14 @@ github.com/openai/openai-go v1.12.0 h1:NBQCnXzqOTv5wsgNC36PrFEiskGfO5wccfCWDo9S1 github.com/openai/openai-go v1.12.0/go.mod h1:g461MYGXEXBVdV5SaR/5tNzNbSfwTBBefwc+LlDCK0Y= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= +github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040= +github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M= +github.com/opensearch-project/opensearch-go/v2 v2.3.0 h1:nQIEMr+A92CkhHrZgUhcfsrZjibvB3APXf2a1VwCmMQ= +github.com/opensearch-project/opensearch-go/v2 v2.3.0/go.mod h1:8LDr9FCgUTVoT+5ESjc2+iaZuldqE+23Iq0r1XeNue8= github.com/orcaman/concurrent-map/v2 v2.0.1 h1:jOJ5Pg2w1oeB6PeDurIYf6k9PQ+aTITr/6lP/L/zp6c= github.com/orcaman/concurrent-map/v2 v2.0.1/go.mod h1:9Eq3TG2oBe5FirmYWQfYO5iH1q0Jv47PLaNK++uCdOM= -github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= -github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= +github.com/patrickmn/go-cache v2.1.1-0.20191004192108-46f407853014+incompatible h1:IWzUvJ72xMjmrjR9q3H1PF+jwdN0uNQiR2t1BLNalyo= +github.com/patrickmn/go-cache v2.1.1-0.20191004192108-46f407853014+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= github.com/paulmach/orb v0.12.0 h1:z+zOwjmG3MyEEqzv92UN49Lg1JFYx0L9GpGKNVDKk1s= github.com/paulmach/orb v0.12.0/go.mod h1:5mULz1xQfs3bmQm63QEJA6lNGujuRafwA5S/EnuLaLU= github.com/paulmach/protoscan v0.2.1/go.mod h1:SpcSwydNLrxUGSDvXvO0P7g7AuhJ7lcKfDlhJCDw2gY= @@ -634,8 +753,8 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v1.13.10 h1:+5FbKNTe5Z9aspU88DPIKJ9z2KZoaGCu6Sr6kKR/5mU= github.com/pkg/sftp v1.13.10/go.mod h1:bJ1a7uDhrX/4OII+agvy28lzRvQrmIQuaHrcI1HbeGA= -github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 h1:GFCKgmp0tecUJ0sJuv4pzYCqS9+RGSn52M3FUwPs+uo= -github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8= +github.com/planetscale/vtprotobuf v0.6.1-0.20250313105119-ba97887b0a25 h1:S1hI5JiKP7883xBzZAr1ydcxrKNSVNm7+3+JwjxZEsg= +github.com/planetscale/vtprotobuf v0.6.1-0.20250313105119-ba97887b0a25/go.mod h1:ZQntvDG8TkPgljxtA0R9frDoND4QORU1VXz015N5Ks4= github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= @@ -653,6 +772,10 @@ github.com/prometheus/procfs v0.20.1 h1:XwbrGOIplXW/AU3YhIhLODXMJYyC1isLFfYCsTEy github.com/prometheus/procfs v0.20.1/go.mod h1:o9EMBZGRyvDrSPH1RqdxhojkuXstoe4UlK79eF5TGGo= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= +github.com/richardlehane/mscfb v1.0.9 h1:8xdd9auUvXbFoCw3L9h1spnQHZgjNsSX+ek46J6A9tE= +github.com/richardlehane/mscfb v1.0.9/go.mod h1:pe0+IUIc0AHh0+teNzBlJCtSyZdFOGgV4ZK9bsoV+Jo= +github.com/richardlehane/msoleps v1.0.6 h1:9BvkpjvD+iUBalUY4esMwv6uBkfOip/Lzvd93jvR9gg= +github.com/richardlehane/msoleps v1.0.6/go.mod h1:BWev5JBpU9Ko2WAgmZEuiz4/u3ZYTKbjLycmwiWUfWg= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/robertkrimen/otto v0.5.1 h1:avDI4ToRk8k1hppLdYFTuuzND41n37vPGJU7547dGf0= @@ -700,8 +823,8 @@ github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiT github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spiffe/go-spiffe/v2 v2.6.0 h1:l+DolpxNWYgruGQVV0xsfeya3CsC7m8iBzDnMpsbLuo= -github.com/spiffe/go-spiffe/v2 v2.6.0/go.mod h1:gm2SeUoMZEtpnzPNs2Csc0D/gX33k1xIx7lEzqblHEs= +github.com/spiffe/go-spiffe/v2 v2.8.1 h1:eXZMLsu+3MLEPJyGJkolqtVrteZfQdUpOWj6LTiDl/E= +github.com/spiffe/go-spiffe/v2 v2.8.1/go.mod h1:47Q0Q9/AqGha8QLHp+kxpH4Wca7X7EnOtlIJy3mxZ3U= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= @@ -716,8 +839,9 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= -github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE= +github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg= github.com/t14raptor/go-fast v0.1.0 h1:KqwQE+MNvC1NKhoAacqP87NrNOFavvWSP2m6BtCXxsk= github.com/t14raptor/go-fast v0.1.0/go.mod h1:IyzuItbJu1DY1z+xBRE9Bk/jCvaJEFG/yeSupi/2HDU= github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= @@ -732,6 +856,8 @@ github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY= github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28= +github.com/tiendc/go-deepcopy v1.7.2 h1:Ut2yYR7W9tWjTQitganoIue4UGxZwCcJy3orjrrIj44= +github.com/tiendc/go-deepcopy v1.7.2/go.mod h1:4bKjNC2r7boYOkD2IOuZpYjmlDdzjbpTRyCx+goBCJQ= github.com/timberio/go-datemath v0.1.0 h1:1OUCvSIX1qXLJ57h12OWfgt6MNpJnsdNvrp8dLIUFtg= github.com/timberio/go-datemath v0.1.0/go.mod h1:m7kjsbCuO4QKP3KLfnxiUZWiOiFXmxj30HeexjL3lc0= github.com/tj/assert v0.0.0-20190920132354-ee03d75cd160 h1:NSWpaDaurcAJY7PkL8Xt0PhZE7qpvbZl5ljd8r6U0bI= @@ -746,6 +872,8 @@ github.com/ugorji/go/codec v1.3.1 h1:waO7eEiFDwidsBN6agj1vJQ4AG7lh2yqXyOXqhgQuyY github.com/ugorji/go/codec v1.3.1/go.mod h1:pRBVtBSKl77K30Bv8R2P+cLSGaTtex6fsA2Wjqmfxj4= github.com/ulikunitz/xz v0.5.15 h1:9DNdB5s+SgV3bQ2ApL10xRc35ck0DuIX/isZvIk+ubY= github.com/ulikunitz/xz v0.5.15/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= +github.com/valkey-io/valkey-go v1.0.75 h1:cfq9DODW2ntuUgyHJmFWb4/p+xpLpQB1t5SQyWM9uJ4= +github.com/valkey-io/valkey-go v1.0.75/go.mod h1:6X581PhgfeMkJmyfjIsa2eFdq6dy3Qkkg9zwjM1p42M= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo= @@ -768,6 +896,12 @@ github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 h1:nIPpBwaJSVYIxUFsDv3M8ofm github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos= github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no= github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= +github.com/xuri/efp v0.0.3-0.20260924042702-217b81952dec h1:sZZokRLgr8nyrzkDDCQcvEYBsTrZr6eqXa/R9qALoQA= +github.com/xuri/efp v0.0.3-0.20260924042702-217b81952dec/go.mod h1:ybY/Jr0T0GTCnYjKqmdwxyxn2BQf2RcQIIvex5QldPI= +github.com/xuri/excelize/v2 v2.11.1-0.20261029001137-c5fd73bde8f6 h1:zGu5f3tQT1WHoaP60eteDfGgqCT+APDwHsvAkWsjb84= +github.com/xuri/excelize/v2 v2.11.1-0.20261029001137-c5fd73bde8f6/go.mod h1:NQLBThVu4BB7tYM8wJIBj2dZsptXbDW4WyrFlL8YLZQ= +github.com/xuri/nfp v0.0.2-0.20250530014748-2ddeb826f9a9 h1:+C0TIdyyYmzadGaL/HBLbf3WdLgC29pgyhTjAT/0nuE= +github.com/xuri/nfp v0.0.2-0.20250530014748-2ddeb826f9a9/go.mod h1:WwHg+CVyzlv/TX9xqBFXEZAuxOPxn2k1GNHwG41IIUQ= github.com/xyproto/randomstring v1.0.5 h1:YtlWPoRdgMu3NZtP45drfy1GKoojuR7hmRcnhZqKjWU= github.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3iGxZ18UQApw/E= github.com/yosida95/uritemplate/v3 v3.0.2 h1:Ed3Oyj9yrmi9087+NczuL5BwkIc4wvTb5zIM+UJPGz4= @@ -788,49 +922,56 @@ github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940 h1:4r45xpDWB6 github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940/go.mod h1:CmBdvvj3nqzfzJ6nTCIwDTPZ56aVGvDrmztiO5g3qrM= github.com/zclconf/go-cty-yaml v1.2.0 h1:GDyL4+e/Qe/S0B7YaecMLbVvAR/Mp21CXMOSiCTOi1M= github.com/zclconf/go-cty-yaml v1.2.0/go.mod h1:9YLUH4g7lOhVWqUbctnVlZ5KLpg7JAprQNgxSZ1Gyxs= +github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ= +github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0= +github.com/zeebo/xxh3 v1.1.0 h1:s7DLGDK45Dyfg7++yxI0khrfwq9661w9EN78eP/UZVs= +github.com/zeebo/xxh3 v1.1.0/go.mod h1:IisAie1LELR4xhVinxWS5+zf1lA4p0MW4T+w+W07F5s= go.mongodb.org/mongo-driver v1.11.4/go.mod h1:PTSz5yu21bkT/wXpkS7WR5f0ddqw5quethTUn9WM+2g= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= -go.opentelemetry.io/contrib/detectors/gcp v1.43.0 h1:62yY3dT7/ShwOxzA0RsKRgshBmfElKI4d/Myu2OxDFU= -go.opentelemetry.io/contrib/detectors/gcp v1.43.0/go.mod h1:RyaZMFY7yi1kAs45S6mbFGz8O8rqB0dTY14uzvG4LCs= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.67.0 h1:yI1/OhfEPy7J9eoa6Sj051C7n5dvpj0QX8g4sRchg04= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.67.0/go.mod h1:NoUCKYWK+3ecatC4HjkRktREheMeEtrXoQxrqYFeHSc= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.69.0 h1:8tvICD4vSTOOsNrsI4Ljf6C+6UKvpTEH5XY3JMoyPoo= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.69.0/go.mod h1:z9+yiacE0IHRqM4qFfkbt/JYlmYXgss8GY/jXoNuPJI= -go.opentelemetry.io/otel v1.44.0 h1:JjwHmHpA4iZ3wBxluu2fbbE7j4kqlE8jXyAyPXH7HqU= -go.opentelemetry.io/otel v1.44.0/go.mod h1:BMgjTHL9WPRlRjL2oZCBTL4whCGtXch2H4BhOPIAyYc= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.44.0 h1:4YsVu3B8+3qtWYYrsUYgn0OG78pN0rnNPRGX4SbokQI= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.44.0/go.mod h1:+wnlSn0mD1ADVMe3v9Z/WIaiz6q6gL2J/ejaAmdmv80= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.44.0 h1:qazEJlUOQzhCpzQpFETGby7EdqjI1wsd0W+6Gg1SCTU= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.44.0/go.mod h1:fOD2Yefuxixkx3ahVNf0O/PERb6r4OlbxfATVnYvzCo= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.44.0 h1:lgh3PiVrRUWMLOVSkQicxzZll5NjF1r+AtsX1XRIHw0= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.44.0/go.mod h1:5Cnhth3m/AgOeTgE3ex12pPmiu/gGtZit03kSzx9X7s= +go.opentelemetry.io/contrib/detectors/gcp v1.45.0 h1:9jR0ZPRok9ryaOQ2Wx8rg5F7Aon59mxrqbVI60/vlBk= +go.opentelemetry.io/contrib/detectors/gcp v1.45.0/go.mod h1:VSme3o2fvSg5bVg0dRzyHaj4Z5EVhG+g2Fde6LKzmQA= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.70.0 h1:oECp5f+hN7nkwjU/8BxQ/q23bGPb8FIrD839owX222E= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.70.0/go.mod h1:DqEFwLumhzMBDQv9PcWbyoDxHI/4lAk6CM4nJBH39sc= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.70.0 h1:LMuyCAyfalSjDyjdC65nK6N0zoTT63+E/u95X0JovZI= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.70.0/go.mod h1:085m8qbm4hgc8rZWGDEa4vmyyo2c3nPxUslYUKUIU04= +go.opentelemetry.io/otel v1.47.0 h1:j7ALJ/zgkS7Z6aeJW09p8VC9804bC+PpeTfCD4XPnOM= +go.opentelemetry.io/otel v1.47.0/go.mod h1:8wS9O2qfXrYrzp6hIF/HOYJJf/wIhFPhR2xLuP+iXQU= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 h1:julhjPeUH/q/7hinbSdDdqt5h7Zw9YWmRlWRhI0jd54= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0/go.mod h1:Ao2mz688LH/tFf0yMAenidq6k2YNSx6SIY2q6jDACck= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.47.0 h1:UFpxOpYPmMNUtOWhdb+nC1WELIgVf8z9higURrbzYU4= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.47.0/go.mod h1:YBGjxe3lt0jtXoEXxGrGhv/jM7oUBUDVK7zhAvNyEjc= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 h1:aXZXsZ012wOgVkqaiQv+Z/d8V0xKjmg70F6m4CE94lc= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0/go.mod h1:ziu1gUIJhAaxM3EV1e3Ralk5AAyL1UOYz3lJJ4VSI38= go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.43.0 h1:TC+BewnDpeiAmcscXbGMfxkO+mwYUwE/VySwvw88PfA= go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.43.0/go.mod h1:J/ZyF4vfPwsSr9xJSPyQ4LqtcTPULFR64KwTikGLe+A= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.44.0 h1:bl2S7Ubua0Nms+D/gAmznQTd4dxxMA93aKbcpKqiTCs= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.44.0/go.mod h1:L0hRV50XdVIODHUfWEqGRCXQvj2rV82STVo12FMFBU0= -go.opentelemetry.io/otel/metric v1.44.0 h1:1w0gILTcHdr3YI+ixLyjemwrVnsMURbTZFrSYCdDdmc= -go.opentelemetry.io/otel/metric v1.44.0/go.mod h1:8O7hanEPBNgEMmybD3s2VBKcgWOCsA6tzHBPODAiquo= -go.opentelemetry.io/otel/metric/x v0.66.0 h1:YkCrx1zLOChi9ZcZ6euupOcsgzbVlec7D/xoEU1+cTA= -go.opentelemetry.io/otel/metric/x v0.66.0/go.mod h1:d1+BDj9t96do0/1LoU1ayfCv79ZgNE41qbhBvnMOBZk= -go.opentelemetry.io/otel/sdk v1.44.0 h1:nHYwb9lK+fJPU/dnT6s7W7Z8itMWyqrnVfbheVYrZ58= -go.opentelemetry.io/otel/sdk v1.44.0/go.mod h1:Osuydd3Se74nqjAKxid74N5eC+jfEqfTegHRnq58oK0= -go.opentelemetry.io/otel/sdk/metric v1.44.0 h1:3LlKgI+VjbVsjNRFZJZAJ30WjXC5VkNRks6si09iEfI= -go.opentelemetry.io/otel/sdk/metric v1.44.0/go.mod h1:5B5pMARnXxKhltooO4xUuCBorl65a4EpnTalObqOigA= -go.opentelemetry.io/otel/trace v1.44.0 h1:jxF5CsGYCe74MCRx2X4g7WsY/VBKRqqpNvXlX/6gtIk= -go.opentelemetry.io/otel/trace v1.44.0/go.mod h1:oLl1jrMQAVo6v3GAggN+1VH9VIz9iUSvW53sW1Q8PIE= -go.opentelemetry.io/proto/otlp v1.10.0 h1:IQRWgT5srOCYfiWnpqUYz9CVmbO8bFmKcwYxpuCSL2g= -go.opentelemetry.io/proto/otlp v1.10.0/go.mod h1:/CV4QoCR/S9yaPj8utp3lvQPoqMtxXdzn7ozvvozVqk= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.45.0 h1:lsA/S1bxgdbyFGkTj+3meEdJ6ADVU7QoFstV6MXgE68= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.45.0/go.mod h1:L7u+MirGoB1bjeLH66+xDykF4RC8C3RN7lIFpBiewUo= +go.opentelemetry.io/otel/log v1.47.0 h1:cOTS1CcLbSQeZKanGJ+0JpF/+t4PELi3O3bbl2lqCcI= +go.opentelemetry.io/otel/log v1.47.0/go.mod h1:9byitSQ5pLC6PpqwGXjqdMKya6ZTswHRZh2vvXT33nw= +go.opentelemetry.io/otel/metric v1.47.0 h1:4PptaldXx3Eat1XjMZ68pPJEs5wrhlemctZE9a3UdWY= +go.opentelemetry.io/otel/metric v1.47.0/go.mod h1:ADGSXxRrXM6bjbvLo535EstVFlPpPYZm4LBKixjDHwU= +go.opentelemetry.io/otel/metric/x v0.69.0 h1:DjRLr15H83v+hCW7JA9NoJvOkYTtmq5YoDRbe9deYpM= +go.opentelemetry.io/otel/metric/x v0.69.0/go.mod h1:uVvsMPMFFyj/HUQfrUnH3JjnOQ1dwFDorgFLRBasM0k= +go.opentelemetry.io/otel/sdk v1.47.0 h1:zWXEr4j2lFefG87TU6Yg8a7ngfohIKFZHKp0Hf5hC6I= +go.opentelemetry.io/otel/sdk v1.47.0/go.mod h1:VUc24kiOeoGsxG8G9ULx3fWKvB7jMhnGE8Oi607lgR0= +go.opentelemetry.io/otel/sdk/metric v1.47.0 h1:lfISg2j93VT6yqdk9OfUaZmw/GfcZqCCV3jdXtsPnKw= +go.opentelemetry.io/otel/sdk/metric v1.47.0/go.mod h1:ypLp+mW1Nt2x+Szt3b5/i1syodyts49lMOwxpDI3VGw= +go.opentelemetry.io/otel/trace v1.47.0 h1:JOjX/Oci8K94QHddo+bbfya/Ai/nf6/dt9ZfrFNWSrM= +go.opentelemetry.io/otel/trace v1.47.0/go.mod h1:jNaSLa2PZEYFG6fRjJABAu+bw4FS08uDmPg28lTghu0= +go.opentelemetry.io/proto/otlp v1.11.0 h1:5rrYs0Ykyj50sdU/JU0x8etU+LubXWb+gED6TbEdMIk= +go.opentelemetry.io/proto/otlp v1.11.0/go.mod h1:SmVizdCOAm3XBtG1g1NnOdhW6jtddT72hLMhv8VwA8E= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/mock v0.6.0 h1:hyF9dfmbgIX5EfOdasqLsWD6xqpNZlXblLB/Dbnwv3Y= go.uber.org/mock v0.6.0/go.mod h1:KiVJ4BqZJaMj4svdfmHM0AUx4NJYO8ZNpPnZn1Z+BBU= go.yaml.in/yaml/v2 v2.4.4 h1:tuyd0P+2Ont/d6e2rl3be67goVK4R6deVxCUX5vyPaQ= go.yaml.in/yaml/v2 v2.4.4/go.mod h1:gMZqIpDtDqOfM0uNfy0SkpRhvUryYH0Z6wdMYcacYXQ= -go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= +go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw= +go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= go.yaml.in/yaml/v4 v4.0.0-rc.4 h1:UP4+v6fFrBIb1l934bDl//mmnoIZEDK0idg1+AIvX5U= go.yaml.in/yaml/v4 v4.0.0-rc.4/go.mod h1:aZqd9kCMsGL7AuUv/m/PvWLdg5sjJsZ4oHDEnfPPfY0= gocloud.dev v0.46.0 h1:niIuZwSjMtBx8K+ITB2s5kZullB13PGOS2ZoQPZxQ4Q= @@ -845,11 +986,13 @@ golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliY golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= -golang.org/x/crypto v0.53.0 h1:QZ4Muo8THX6CizN2vPPd5fBGHyogrdK9fG4wLPFUsto= -golang.org/x/crypto v0.53.0/go.mod h1:DNLU434OwVakk9PzuwV8w62mAJpRJL3vsgcfp4Qnsio= +golang.org/x/crypto v0.58.0 h1:COkYLr4k7nDI4r6QtMML2AfzeIswWHAJthLS6K/M/54= +golang.org/x/crypto v0.58.0/go.mod h1:Xh+kl5A+M0gMiWDytH2Hhr5Z7WbNCpv/eB/EFgfSk+w= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20260527015227-08cc5374adb3 h1:VHEvKbpgPXcPXn40t9cDTGK3JZwMikIEyF/CTrFfu7k= golang.org/x/exp v0.0.0-20260527015227-08cc5374adb3/go.mod h1:d2fgXJLVs4dYDHUk5lwMIfzRzSrWCfGZb0ZqeLa/Vcw= +golang.org/x/image v0.44.0 h1:+tDekMZED9+LrtB3G5xzRggpVh9CARjZqROla3R3R+I= +golang.org/x/image v0.44.0/go.mod h1:V8K3KE9KKKE+pLpQDOeN18w9oacNSvy1tDOirTu4xtY= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -860,8 +1003,8 @@ golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/mod v0.37.0 h1:vF1DjpVEshcIqoEaauuHebaLk1O1forxjxBaVn884JQ= -golang.org/x/mod v0.37.0/go.mod h1:m8S8VeM9r4dzDwjrKO0a1sZP3YjeMamRRlD+fmR2Q/0= +golang.org/x/mod v0.41.0 h1:qJmnOUb4YB+FsEuM3HcWucdZASCPGhsX6uljO6pog0c= +golang.org/x/mod v0.41.0/go.mod h1:Ek9pY8RKWXwsWvd3rQiHYtMqkjSUV+s1Rj7j4H5Ur6o= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -874,14 +1017,16 @@ golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= -golang.org/x/net v0.56.0 h1:Rw8j/hFzGvJUZwNBXnAtf5sVDVt+65SK2C7IxCxZt5o= -golang.org/x/net v0.56.0/go.mod h1:D3Ku6r+V6JROoZK144D2XfMHFcMq/0zSfLelVTCFKec= +golang.org/x/net v0.62.0 h1:18ELalfM5+XNRwzM2nYqXsZQ9ByS1uhj2O/U7+5jqRY= +golang.org/x/net v0.62.0/go.mod h1:WgDCOTH8iwtB66T4/GfI94AHo/hhdb7Hah9NDseQfiI= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs= golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q= @@ -897,8 +1042,8 @@ golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sync v0.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek= -golang.org/x/sync v0.22.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= +golang.org/x/sync v0.24.0 h1:iqiDrGoDgyuvAKrhLQthUEzU/R378N78gXbBjxed7oA= +golang.org/x/sync v0.24.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -907,6 +1052,7 @@ golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -921,31 +1067,35 @@ golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.46.0 h1:noSf2Fq6F8DBgS+LysIkx7rIExoNHJsxOAtPp4rthXw= -golang.org/x/sys v0.46.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/sys v0.49.0 h1:XbzkgYJHdqh/8m2Uu0W/dQv8nktxx4BFHp1M0gROTXA= +golang.org/x/sys v0.49.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= +golang.org/x/telemetry v0.0.0-20260924152758-ed294f943157 h1:DftxASHKl6JolFPqoN+2WrFO53JvkHwRXvFqf8gsivA= +golang.org/x/telemetry v0.0.0-20260924152758-ed294f943157/go.mod h1:i+ivNqjDnTF3WTElsdk5g9V5DTSBYgdNo7xTU9SDwYA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= -golang.org/x/term v0.44.0 h1:0rLvDRCtNj0gZkyIXhCyOb2OAzEhLVqc4B+hrsBhrmc= -golang.org/x/term v0.44.0/go.mod h1:7ze4MdzUzLXpSAoFP1H0bOI9aXDqveSvatT5vKcFh2Y= +golang.org/x/term v0.47.0 h1:cpyOwQkr2Nzxe2p6KnrTG7Ei2wtzjsuSjhpXXepZ/BM= +golang.org/x/term v0.47.0/go.mod h1:efAfAuG6RKABvg1ArGebRkvX6LXul14SM67o2e4mUCY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= -golang.org/x/text v0.40.0 h1:Ub2Z6/xjgF1WrYQz2nuITOEegKFtiIy+rieRJ5lHZKs= -golang.org/x/text v0.40.0/go.mod h1:hpnzDAfGV753zIKo+wk3u1bVKCGPbrnF7+7LBF/UHVY= +golang.org/x/text v0.43.0 h1:1QivrlhwAsnMOcqgOdl9my7s9OyZl8O5/UGUTJVXoWc= +golang.org/x/text v0.43.0/go.mod h1:hbSIYA/amXcRXTFSZqh8tWHEoqRvvbKPJ2uz/KU+a+s= golang.org/x/time v0.15.0 h1:bbrp8t3bGUeFOx08pvsMYRTCVSMk89u4tKbNOZbp88U= golang.org/x/time v0.15.0/go.mod h1:Y4YMaQmXwGQZoFaVFk4YpCt4FLQMYKZe9oeV/f4MSno= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -956,12 +1106,13 @@ golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= -golang.org/x/tools v0.47.0 h1:7Kn5x/d1svx/PzryTsqeoZN4TZwqeH5pGWjefhLi/1Q= -golang.org/x/tools v0.47.0/go.mod h1:dFHnyTvFWY212G+h7ZY4Vsp/K3U4/7W9TyVaAul8uCA= +golang.org/x/tools v0.51.0 h1:k4Xc/1Om9jwkBJBo4NVLMSARBoWtK10mx+W5BnXCeAI= +golang.org/x/tools v0.51.0/go.mod h1:9eEncMayCV6zRMGhR5eZEC2iBx98qWcF1HZ9Z7wJOoA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -981,17 +1132,17 @@ google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98 google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20260319201613-d00831a3d3e7 h1:XzmzkmB14QhVhgnawEVsOn6OFsnpyxNPRY9QV01dNB0= google.golang.org/genproto v0.0.0-20260319201613-d00831a3d3e7/go.mod h1:L43LFes82YgSonw6iTXTxXUX1OlULt4AQtkik4ULL/I= -google.golang.org/genproto/googleapis/api v0.0.0-20260526163538-3dc84a4a5aaa h1:Kjn0N0tCrDgiAFW+lGO4JZ3ck44CehvJQMAwj9QF0G8= -google.golang.org/genproto/googleapis/api v0.0.0-20260526163538-3dc84a4a5aaa/go.mod h1:q4lMZS6kskjT5HvCPrnnypcDPVJqT/f4nfxmkE7gryY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260622175928-b703f567277d h1:mpAgMyM9vQHxycBlDq50y1VHpfSfVwzXvrQKtYbXuUY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260622175928-b703f567277d/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= +google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc h1:rZHRz0ogq4Pid1IKtA/ivHi8XONVF5tqUQXA2TtgpkE= +google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc/go.mod h1:K/n0XLazCJHjD73YuMyNJsN38BPPy1kfFnKxUXaThFU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc h1:4bNTbnb44EqGVy9HaQxSY2jnafSUdgV3qHtedvNpDKg= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc/go.mod h1:OaIUM3+LpYcK2GXM4FTmhWoIq371Owdr+Cc7/BsYHHc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.82.1 h1:NnAxzGRA0677vCa4BUkOAnO5+FfQqVl9iUXeD0IqcGE= -google.golang.org/grpc v1.82.1/go.mod h1:yzTZ1TB1Z3SG+LIYaI+WiE8D5+PZ3ArnrSp8zF3+/ZA= +google.golang.org/grpc v1.85.0 h1:BPBCfuVRQ1qvBhKDOq9uvQllMvO59rKsYhXpp7Dd8vw= +google.golang.org/grpc v1.85.0/go.mod h1:0rQrOD58yjal/0EaVbGBANindixsCZNQPDV3VKtaKuQ= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.6.2 h1:rgSNvqscFZ1JgV/4wH5GOsZFSFkR2Eua9As3KIr2LlM= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.6.2/go.mod h1:iMEtFwDlAhjDU9L5mY6U1XLwlIId/G3h+QcBHDIvrJ8= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -1005,8 +1156,8 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af h1:+5/Sw3GsDNlEmu7TfklWKPdQ0Ykja5VEmq2i817+jbI= -google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= +google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc= +google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1039,22 +1190,21 @@ gotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q= gotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -k8s.io/api v0.36.1 h1:XbL/EMj8K2aJpJtePmqUyQMsM0D4QI2pvl7YKJ20FTY= -k8s.io/api v0.36.1/go.mod h1:KOWo4ey3TINlXjeHVuwB3i+tXXnu+UcwFBHlI/9dvEo= -k8s.io/apiextensions-apiserver v0.36.1 h1:6JfYmPUsuUIHuN+3QxutXYWj492RqF5fBSx67GYK5Ks= -k8s.io/apiextensions-apiserver v0.36.1/go.mod h1:pLzZin90riwisdzKwv/GoTwENooytoIx5zWJb4Hkby8= +honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= +k8s.io/api v0.36.2 h1:TF6YDLIzKfccK7cq9YpTcGX8TJmEkHVRv78DM51fRYY= +k8s.io/api v0.36.2/go.mod h1:F4LbMO4brjZYh7yFkXWhynSvtB7YauxV4c+HHkNRGNg= k8s.io/apimachinery v0.36.2 h1:0PE/W/WNy1UX61NLbXY5TMbJ6UwLL6E6lAPkYrKFxbQ= k8s.io/apimachinery v0.36.2/go.mod h1:fvf/HOLXq9RId0rnDIbN1OEBvHXdQbLMM8nu0LcBUf4= -k8s.io/client-go v0.36.1 h1:FN/K8QIT2CEDt+2WB2HnWrUANZ50AP5GII43/SP2JR0= -k8s.io/client-go v0.36.1/go.mod h1:s6rAnCtTGYDQnpNjEhSaISV+2O8jwruZ6m3QOYBFbtU= +k8s.io/client-go v0.36.2 h1:bfgxmFKc9CgqsgX4xKLAAdmTQlWee7Ob/HlDOrJ5TBI= +k8s.io/client-go v0.36.2/go.mod h1:1vgO4OAlfPnoLcb+Rze2GF5rAr14w8qjrYMoyXJzQj0= k8s.io/klog/v2 v2.140.0 h1:Tf+J3AH7xnUzZyVVXhTgGhEKnFqye14aadWv7bzXdzc= k8s.io/klog/v2 v2.140.0/go.mod h1:o+/RWfJ6PwpnFn7OyAG3QnO47BFsymfEfrz6XyYSSp0= -k8s.io/kube-openapi v0.0.0-20260317180543-43fb72c5454a h1:xCeOEAOoGYl2jnJoHkC3hkbPJgdATINPMAxaynU2Ovg= -k8s.io/kube-openapi v0.0.0-20260317180543-43fb72c5454a/go.mod h1:uGBT7iTA6c6MvqUvSXIaYZo9ukscABYi2btjhvgKGZ0= +k8s.io/kube-openapi v0.0.0-20260501160325-927ab1f70cd6 h1:ngxu1nL4SbFuXwu1EY7cSKcVqSjTQPVbYQT6WNjTXaU= +k8s.io/kube-openapi v0.0.0-20260501160325-927ab1f70cd6/go.mod h1:uGBT7iTA6c6MvqUvSXIaYZo9ukscABYi2btjhvgKGZ0= k8s.io/streaming v0.36.2 h1:NSKthPPg9UFSKsRauVJUVGH2Dvn8fhKmY4qrMkw/p98= k8s.io/streaming v0.36.2/go.mod h1:z6fV3D+NVkoeqRMtWwlUZK6U17SY/LqNzOxWL6GyR/s= -k8s.io/utils v0.0.0-20260210185600-b8788abfbbc2 h1:AZYQSJemyQB5eRxqcPky+/7EdBj0xi3g0ZcxxJ7vbWU= -k8s.io/utils v0.0.0-20260210185600-b8788abfbbc2/go.mod h1:xDxuJ0whA3d0I4mf/C4ppKHxXynQ+fxnkmQH0vTHnuk= +k8s.io/utils v0.0.0-20260626114624-be93311217bd h1:Ea7fgQ5we8Y9T0OX5o0dAHzQOBRI07D/dEYRaB9ZZEs= +k8s.io/utils v0.0.0-20260626114624-be93311217bd/go.mod h1:xDxuJ0whA3d0I4mf/C4ppKHxXynQ+fxnkmQH0vTHnuk= layeh.com/gopher-json v0.0.0-20201124131017-552bb3c4c3bf h1:rRz0YsF7VXj9fXRF6yQgFI7DzST+hsI3TeFSGupntu0= layeh.com/gopher-json v0.0.0-20201124131017-552bb3c4c3bf/go.mod h1:ivKkcY8Zxw5ba0jldhZCYYQfGdb2K6u9tbYK1AwMIBc= modernc.org/cc/v4 v4.29.0 h1:CXgwL8cvxmyzBQZzbSl/6xFtMCryb6u8IOqDci39cgc= @@ -1087,13 +1237,11 @@ modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y= modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= mvdan.cc/sh/v3 v3.13.0 h1:dSfq/MVsY4w0Vsi6Lbs0IcQquMVqLdKLESAOZjuHdLg= mvdan.cc/sh/v3 v3.13.0/go.mod h1:KV1GByGPc/Ho0X1E6Uz9euhsIQEj4hwyKnodLlFLoDM= -sigs.k8s.io/gateway-api v1.5.1 h1:RqVRIlkhLhUO8wOHKTLnTJA6o/1un4po4/6M1nRzdd0= -sigs.k8s.io/gateway-api v1.5.1/go.mod h1:GvCETiaMAlLym5CovLxGjS0NysqFk3+Yuq3/rh6QL2o= sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg= sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg= sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU= sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= -sigs.k8s.io/structured-merge-diff/v6 v6.3.2 h1:kwVWMx5yS1CrnFWA/2QHyRVJ8jM6dBA80uLmm0wJkk8= -sigs.k8s.io/structured-merge-diff/v6 v6.3.2/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE= +sigs.k8s.io/structured-merge-diff/v6 v6.4.0 h1:qmp2e3ZfFi1/jJbDGpD4mt3wyp6PE1NfKHCYLqgNQJo= +sigs.k8s.io/structured-merge-diff/v6 v6.4.0/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE= sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs= sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4= diff --git a/hack/adapterbrowser/main.go b/hack/adapterbrowser/main.go new file mode 100644 index 00000000..1f30dd59 --- /dev/null +++ b/hack/adapterbrowser/main.go @@ -0,0 +1,73 @@ +// adapterbrowser smoke-checks every live catalog resource through agent-browser. +package main + +import ( + "context" + "encoding/json" + "flag" + "fmt" + "net/http" + "net/url" + "os/exec" + "strings" + "time" + + "github.com/flanksource/captain/pkg/adapters" +) + +type catalogDocument struct { + ID string `json:"id"` +} + +func main() { + native := flag.String("native-catalog", adapters.NativeResourceCatalogURL, "published native resource catalog the web UI loads") + flag.Parse() + documents := append(fetchCatalog("http://localhost:9020/api/captain/ai/adapter-schemas"), fetchCatalog(*native)...) + for _, document := range documents { + parts := strings.SplitN(document.ID, "/", 2) + if len(parts) != 2 { + panic("invalid resource id: " + document.ID) + } + location := "http://localhost:9020/adapter-schemas/" + url.PathEscape(parts[0]) + "/" + url.PathEscape(parts[1]) + "?view=form" + browser("open", location) + browser("wait", "--text", "Local preview.") + body := browser("get", "text", "body") + if strings.Contains(body, "Something went wrong") || !strings.Contains(body, "Validate schema") { + panic(fmt.Sprintf("%s form failed: %s", document.ID, body)) + } + fmt.Println("PASS " + document.ID) + } + fmt.Printf("PASS all %d resource forms\n", len(documents)) +} + +func browser(args ...string) string { + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + command := exec.CommandContext(ctx, "agent-browser", append([]string{"--engine", "chrome", "--session", "captain-adapters-impl"}, args...)...) + raw, err := command.CombinedOutput() + if err != nil { + panic(fmt.Sprintf("agent-browser %v: %v\n%s", args, err, raw)) + } + return string(raw) +} + +func fetchCatalog(location string) []catalogDocument { + response, err := (&http.Client{Timeout: 20 * time.Second}).Get(location) + check(err) + defer response.Body.Close() + if response.StatusCode != http.StatusOK { + panic(location + ": " + response.Status) + } + var documents []catalogDocument + check(json.NewDecoder(response.Body).Decode(&documents)) + if len(documents) == 0 { + panic("empty resource catalog: " + location) + } + return documents +} + +func check(err error) { + if err != nil { + panic(err) + } +} diff --git a/hack/adapterdto/main.go b/hack/adapterdto/main.go new file mode 100644 index 00000000..04efc5cd --- /dev/null +++ b/hack/adapterdto/main.go @@ -0,0 +1,46 @@ +// adapterdto preserves encoding/json's methods on generated native union types. +package main + +import ( + "go/ast" + "go/format" + "go/parser" + "go/token" + "os" + "path/filepath" +) + +func main() { + paths, err := filepath.Glob("zz_generated_*.go") + check(err) + for _, path := range paths { + set := token.NewFileSet() + file, err := parser.ParseFile(set, path, nil, parser.ParseComments) + check(err) + ast.Inspect(file, func(node ast.Node) bool { + declaration, ok := node.(*ast.TypeSpec) + if !ok { + return true + } + selector, ok := declaration.Type.(*ast.SelectorExpr) + if !ok { + return true + } + qualifier, ok := selector.X.(*ast.Ident) + if ok && qualifier.Name == "json" && selector.Sel.Name == "RawMessage" { + declaration.Assign = declaration.Name.End() + } + return true + }) + output, err := os.Create(path) + check(err) + check(format.Node(output, set, file)) + check(output.Close()) + } +} + +func check(err error) { + if err != nil { + panic(err) + } +} diff --git a/hack/adapterresources/claude-types.ts b/hack/adapterresources/claude-types.ts new file mode 100644 index 00000000..7b60cb87 --- /dev/null +++ b/hack/adapterresources/claude-types.ts @@ -0,0 +1,11 @@ +import type { + Settings, + AgentDefinition, + McpServerConfigForProcessTransport, + SdkPluginConfig, +} from "../../.tmp/adapter-schema-sources/sdk/node_modules/@anthropic-ai/claude-agent-sdk/sdk"; + +export type CaptainClaudeSettings = Settings; +export type CaptainClaudeAgent = AgentDefinition; +export type CaptainClaudeMCP = McpServerConfigForProcessTransport; +export type CaptainClaudePlugin = SdkPluginConfig; diff --git a/hack/adapterresources/cli.go b/hack/adapterresources/cli.go new file mode 100644 index 00000000..73347974 --- /dev/null +++ b/hack/adapterresources/cli.go @@ -0,0 +1,59 @@ +package main + +import ( + "fmt" + "os" + "regexp" + "sort" + "strings" +) + +func inventoryCLIOptions() { + flagLine := regexp.MustCompile(`^ {2,6}(?:-[a-zA-Z],\s+)?--[a-zA-Z]`) + longFlag := regexp.MustCompile(`--[a-zA-Z][a-zA-Z0-9-]*`) + for _, provider := range []struct{ name, help, version string }{ + {"anthropic", "claude", "claude-cli 2.1.309"}, + {"openai", "codex", "codex-cli 0.164.0"}, + {"google", "gemini", "gemini-cli 0.64.0"}, + } { + raw, err := os.ReadFile(sourcePath(provider.help + "-help.txt")) + must(err) + path := "pkg/adapters/" + provider.name + "/cli.schema.json" + schema := readObject(path) + mapped := map[string]map[string]any{} + for _, raw := range schema["properties"].(map[string]any) { + field := raw.(map[string]any) + option := field["x-captain-option"].(map[string]any) + mapped[option["nativeName"].(string)] = option + } + var flags, missing []string + for _, line := range strings.Split(string(raw), "\n") { + if !flagLine.MatchString(line) { + continue + } + header := strings.SplitN(strings.TrimSpace(line), " ", 2)[0] + aliases := longFlag.FindAllString(header, -1) + var option map[string]any + for _, name := range aliases { + if mapped[name] != nil { + option = mapped[name] + break + } + } + if option == nil { + missing = append(missing, aliases[0]) + continue + } + if len(aliases) > 1 { + option["aliases"] = aliases + } + flags = append(flags, aliases...) + } + if len(missing) > 0 { + panic(fmt.Sprintf("%s CLI flags missing: %v", provider.name, missing)) + } + sort.Strings(flags) + schema["x-captain-inventory"] = map[string]any{"version": provider.version, "flags": flags} + writeObject(path, schema) + } +} diff --git a/hack/adapterresources/execution.go b/hack/adapterresources/execution.go new file mode 100644 index 00000000..115ed164 --- /dev/null +++ b/hack/adapterresources/execution.go @@ -0,0 +1,39 @@ +package main + +import ( + "path/filepath" + "strings" + + "github.com/flanksource/captain/pkg/adapters/presentation" +) + +func annotateExecutionSchemas() { + paths, err := filepath.Glob("pkg/adapters/*/*.schema.json") + must(err) + for _, path := range paths { + schema := readObject(path) + provider := schema["x-captain-adapter"].(map[string]any)["provider"].(string) + mode := schema["x-captain-adapter"].(map[string]any)["mode"].(string) + schema["title"] = presentation.Title(provider) + " " + presentation.Title(mode) + " options" + docs := map[string]string{ + "anthropic": "https://code.claude.com/docs/en/settings-reference", + "openai": "https://learn.chatgpt.com/docs/config-file/config-reference", + "google": "https://geminicli.com/docs/reference/configuration/", + "deepseek": "https://api-docs.deepseek.com/api/create-chat-completion/", + "jev": "https://github.com/flanksource/captain", + "bash": "https://www.gnu.org/software/bash/manual/bash.html#Invoking-Bash", + }[provider] + presentation.AnnotateSchema(schema, docs) + markNativeUnions(schema) + if strings.HasSuffix(path, "cli.schema.json") { + versions := map[string]string{"anthropic": "2.1.309", "openai": "codex-cli 0.164.0", "google": "0.64.0"} + for _, raw := range schema["x-captain-adapter"].(map[string]any)["sources"].([]any) { + source := raw.(map[string]any) + if source["kind"] == "cli-help" { + source["version"] = versions[provider] + } + } + } + writeObject(path, schema) + } +} diff --git a/hack/adapterresources/fetch-sources.sh b/hack/adapterresources/fetch-sources.sh new file mode 100755 index 00000000..3c0a55c8 --- /dev/null +++ b/hack/adapterresources/fetch-sources.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +# Captures the pinned native configuration sources that `go run ./hack/adapterresources resources` +# turns into the published native resource schemas. Run from the repository root. +set -euo pipefail + +CODEX_VERSION=rust-v0.164.0 +GEMINI_VERSION=v0.64.0 +CLAUDE_AGENT_SDK_VERSION=0.3.280 +TS_JSON_SCHEMA_GENERATOR_VERSION=2.9.0 + +sources=.tmp/adapter-schema-sources +mkdir -p "$sources" + +curl -fsSL "https://raw.githubusercontent.com/openai/codex/${CODEX_VERSION}/codex-rs/core/config.schema.json" -o "$sources/codex-config.json" +curl -fsSL "https://raw.githubusercontent.com/google-gemini/gemini-cli/${GEMINI_VERSION}/schemas/settings.schema.json" -o "$sources/gemini-settings.json" + +command npm install --silent --no-audit --no-fund --ignore-scripts --prefix "$sources/sdk" \ + "@anthropic-ai/claude-agent-sdk@${CLAUDE_AGENT_SDK_VERSION}" "ts-json-schema-generator@${TS_JSON_SCHEMA_GENERATOR_VERSION}" + +for resource in Settings:settings Agent:agent MCP:mcp Plugin:plugin; do + "$sources/sdk/node_modules/.bin/ts-json-schema-generator" --path hack/adapterresources/claude-types.ts \ + --type "CaptainClaude${resource%%:*}" --out "$sources/claude-${resource##*:}.json" +done diff --git a/hack/adapterresources/main.go b/hack/adapterresources/main.go new file mode 100644 index 00000000..9e9d996a --- /dev/null +++ b/hack/adapterresources/main.go @@ -0,0 +1,143 @@ +// adapterresources generates adapter schemas from captured upstream sources. +// +// resources native provider resource schemas + the published catalog (CI, schemas branch) +// execution enriches the committed execution schemas (needs locally captured CLI help/protocols) +package main + +import ( + "crypto/sha256" + "encoding/json" + "flag" + "fmt" + "os" + "path/filepath" + "strings" + + "github.com/flanksource/captain/pkg/adapters" + "github.com/flanksource/captain/pkg/adapters/presentation" +) + +const usage = "usage: adapterresources resources [-sources DIR] [-out DIR] | execution [-sources DIR] [-resources DIR]" + +type nativeSource struct{ provider, file, version, reference, docs, patches string } + +var nativeSources = []nativeSource{ + {"openai", "codex-config.json", "codex-cli 0.164.0", "https://raw.githubusercontent.com/openai/codex/rust-v0.164.0/codex-rs/core/config.schema.json", "https://learn.chatgpt.com/docs/config-file/config-reference", ""}, + {"anthropic", "claude-settings.json", "@anthropic-ai/claude-agent-sdk 0.3.280; ts-json-schema-generator 2.9.0", "@anthropic-ai/claude-agent-sdk/sdk.d.ts#Settings", "https://code.claude.com/docs/en/settings-reference", "anthropic.yaml"}, + {"google", "gemini-settings.json", "gemini-cli 0.64.0", "https://raw.githubusercontent.com/google-gemini/gemini-cli/v0.64.0/schemas/settings.schema.json", "https://geminicli.com/docs/reference/configuration/", ""}, +} + +var sourcesDir string + +func main() { + if len(os.Args) < 2 { + panic(usage) + } + flags := flag.NewFlagSet(os.Args[1], flag.ExitOnError) + flags.StringVar(&sourcesDir, "sources", ".tmp/adapter-schema-sources", "captured upstream sources (hack/adapterresources/fetch-sources.sh)") + out := flags.String("out", ".tmp/adapter-schemas", "directory for the generated native resource schemas and catalog") + resources := flags.String("resources", ".tmp/adapter-schemas", "directory holding the generated native resource schemas") + must(flags.Parse(os.Args[2:])) + switch os.Args[1] { + case "resources": + writeNativeResources(*out) + case "execution": + enrichRuntimeSchemas(*resources) + enrichAPISchemas() + annotateExecutionSchemas() + inventoryCLIOptions() + default: + panic(usage) + } +} + +func writeNativeResources(out string) { + must(os.MkdirAll(out, 0o755)) + sources := map[string]map[string]any{} + for _, source := range nativeSources { + schema := nativeResource(source) + writeObject(filepath.Join(out, source.provider+".json"), schema) + sources[source.provider] = schema + } + documents, err := adapters.NativeResourceSchemas(sources) + must(err) + encoded, err := json.Marshal(documents) + must(err) + must(os.WriteFile(filepath.Join(out, adapters.NativeResourceCatalogFile), append(encoded, '\n'), 0o644)) + fmt.Printf("%s: %d documents\n", adapters.NativeResourceCatalogFile, len(documents)) +} + +func nativeResource(source nativeSource) map[string]any { + raw, err := os.ReadFile(sourcePath(source.file)) + must(err) + schema := applyPatches(source.patches, raw) + flattenRoot(schema) + if source.provider == "openai" { + completePermissionMaps(schema) + } + if source.provider == "anthropic" { + mergeClaudeResources(schema) + } + properties, ok := schema["properties"].(map[string]any) + if !ok || len(properties) < 20 { + panic(fmt.Sprintf("%s has no complete native configuration: %d properties", source.provider, len(properties))) + } + schema["title"] = strings.ToUpper(source.provider[:1]) + source.provider[1:] + " configuration" + schema["description"] = "Complete native " + source.provider + " configuration captured from " + source.version + "." + schema["x-captain-resource"] = map[string]any{ + "provider": source.provider, "version": source.version, "reference": source.reference, + "sourceSha256": fmt.Sprintf("%x", sha256.Sum256(raw)), "propertyCount": len(properties), + } + if source.patches != "" { + schema["x-captain-resource"].(map[string]any)["patches"] = "hack/adapterresources/patches/" + source.patches + } + schema["x-captain-generated"] = "go run ./hack/adapterresources resources" + presentation.AnnotateSchema(schema, source.docs) + fmt.Printf("%s: %d top-level properties\n", source.provider, len(properties)) + return schema +} + +func sourcePath(name string) string { return filepath.Join(sourcesDir, name) } + +func mergeClaudeResources(schema map[string]any) { + definitions := schema["definitions"].(map[string]any) + for _, resource := range []string{"mcp", "agent", "plugin"} { + raw, err := os.ReadFile(sourcePath("claude-" + resource + ".json")) + must(err) + var extra map[string]any + must(json.Unmarshal(raw, &extra)) + for key, value := range extra["definitions"].(map[string]any) { + if existing, ok := definitions[key]; ok { + left, err := json.Marshal(existing) + must(err) + right, err := json.Marshal(value) + must(err) + if string(left) != string(right) { + panic("conflicting native definition " + key) + } + } + definitions[key] = value + } + } +} + +func flattenRoot(schema map[string]any) { + for schema["$ref"] != nil { + ref, ok := schema["$ref"].(string) + if !ok || !strings.HasPrefix(ref, "#/definitions/") { + panic(fmt.Sprintf("unexpected root reference %v", schema["$ref"])) + } + definitions := schema["definitions"].(map[string]any) + target := definitions[strings.TrimPrefix(ref, "#/definitions/")].(map[string]any) + delete(schema, "$ref") + for key, value := range target { + schema[key] = value + } + } +} + +func must(err error) { + if err != nil { + panic(err) + } +} diff --git a/hack/adapterresources/patches.go b/hack/adapterresources/patches.go new file mode 100644 index 00000000..12ff8be4 --- /dev/null +++ b/hack/adapterresources/patches.go @@ -0,0 +1,34 @@ +package main + +import ( + "encoding/json" + "fmt" + "os" + "path/filepath" + + jsonpatch "gopkg.in/evanphx/json-patch.v4" + "sigs.k8s.io/yaml" +) + +// applyPatches applies an RFC 6902 JSON Patch, authored as YAML under +// hack/adapterresources/patches, to a captured upstream source. Patches address +// the source as captured (before root flattening), so one patch reaches every +// projection of that definition. A `test` op guards each change: an upstream +// change to the patched node fails generation instead of silently drifting. +func applyPatches(name string, raw []byte) map[string]any { + if name != "" { + document, err := os.ReadFile(filepath.Join("hack/adapterresources/patches", name)) + must(err) + operations, err := yaml.YAMLToJSON(document) + must(err) + patch, err := jsonpatch.DecodePatch(operations) + must(err) + raw, err = patch.Apply(raw) + if err != nil { + panic(fmt.Sprintf("apply %s: %v", name, err)) + } + } + var schema map[string]any + must(json.Unmarshal(raw, &schema)) + return schema +} diff --git a/hack/adapterresources/patches/anthropic.yaml b/hack/adapterresources/patches/anthropic.yaml new file mode 100644 index 00000000..81eeee1e --- /dev/null +++ b/hack/adapterresources/patches/anthropic.yaml @@ -0,0 +1,44 @@ +# RFC 6902 JSON Patch over the captured Claude Agent SDK settings schema +# (.tmp/adapter-schema-sources/claude-settings.json, before root flattening). +# Every path is in the SDK's `Settings` definition, so each change reaches the +# settings, sandbox and permissions projections alike. `test` ops pin the +# upstream value a change depends on: when the SDK changes it, generation fails. + +# Help text: the SDK declares the sandbox block and its switches without descriptions. +- op: add + path: /definitions/Settings/properties/sandbox/description + value: Run Bash commands inside Claude Code's sandbox, restricting their filesystem and network access. +- op: test + path: /definitions/Settings/properties/sandbox/properties/enabled + value: {type: boolean} +- op: add + path: /definitions/Settings/properties/sandbox/properties/enabled/description + value: Run Bash commands in the sandbox. Default false. +- op: test + path: /definitions/Settings/properties/sandbox/properties/autoAllowBashIfSandboxed + value: {type: boolean} +- op: add + path: /definitions/Settings/properties/sandbox/properties/autoAllowBashIfSandboxed/description + value: Approve Bash commands without a permission prompt when they run sandboxed. Default true. + +# Typing: transcript retention is a whole number of days, minimum 1 (per its description). +- op: test + path: /definitions/Settings/properties/cleanupPeriodDays/type + value: number +- op: replace + path: /definitions/Settings/properties/cleanupPeriodDays/type + value: integer +- op: add + path: /definitions/Settings/properties/cleanupPeriodDays/minimum + value: 1 + +# Enum: the description accepts 'manual' as an alias for 'default', the enum omits it. +- op: test + path: /definitions/Settings/properties/permissions/properties/defaultMode/enum + value: [acceptEdits, auto, bypassPermissions, default, dontAsk, plan] +- op: replace + path: /definitions/Settings/properties/permissions/properties/defaultMode/enum + value: [acceptEdits, auto, bypassPermissions, default, dontAsk, plan, manual] +- op: add + path: /definitions/Settings/properties/permissions/properties/defaultMode/x-enum-labels + value: {manual: Manual (alias of Default)} diff --git a/hack/adapterresources/permissions.go b/hack/adapterresources/permissions.go new file mode 100644 index 00000000..26fee271 --- /dev/null +++ b/hack/adapterresources/permissions.go @@ -0,0 +1,22 @@ +package main + +// Codex's flattened Rust maps are not emitted by schemars. These value types +// come from codex-rs/config/src/permissions_toml.rs at rust-v0.164.0. +func completePermissionMaps(schema map[string]any) { + definitions := schema["definitions"].(map[string]any) + for name, target := range map[string]string{ + "PermissionsToml": "PermissionProfileToml", + "FilesystemPermissionsToml": "FilesystemPermissionToml", + "NetworkDomainPermissionsToml": "NetworkDomainPermissionToml", + "NetworkUnixSocketPermissionsToml": "NetworkUnixSocketPermissionToml", + "WorkspaceRootsToml": "", + } { + value := map[string]any{"type": "boolean"} + if target != "" { + value = map[string]any{"$ref": "#/definitions/" + target} + } + node := definitions[name].(map[string]any) + node["additionalProperties"] = value + node["x-captain-source"] = "https://github.com/openai/codex/blob/rust-v0.164.0/codex-rs/config/src/permissions_toml.rs" + } +} diff --git a/hack/adapterresources/publish-schemas-branch.sh b/hack/adapterresources/publish-schemas-branch.sh new file mode 100755 index 00000000..ba2ddb15 --- /dev/null +++ b/hack/adapterresources/publish-schemas-branch.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash +# Publishes generated adapter schemas to the orphan `schemas` branch, gh-pages +# style: the branch holds only generated artifacts, under adapters/. The first +# run creates the branch. Usage: publish-schemas-branch.sh +set -euo pipefail + +generated=$(cd "$1" && pwd) +source_sha=$2 +branch=schemas +worktree=$(mktemp -d) +trap 'git worktree remove --force "$worktree"' EXIT + +test -s "$generated/native-resources.json" + +if git ls-remote --exit-code --heads origin "$branch" >/dev/null; then + git fetch --depth 1 origin "$branch" + git worktree add -B "$branch" "$worktree" FETCH_HEAD +else + git worktree add --detach "$worktree" + git -C "$worktree" checkout --orphan "$branch" + git -C "$worktree" rm -r -q --cached . + git -C "$worktree" clean -f -d -x -q +fi + +rm -rf "$worktree/adapters" +mkdir -p "$worktree/adapters" +cp "$generated"/*.json "$worktree/adapters/" +cat >"$worktree/README.md" <<'README' +# Captain generated schemas + +Generated by the `Adapter schemas` workflow from `main`; never edit by hand. +`adapters/native-resources.json` is the native provider resource catalog the +Captain web UI loads. `adapters/.json` are the full provider +configuration schemas it is projected from. See docs/adapter-resource-schemas.md +on `main` for sources, patches and regeneration. +README + +git -C "$worktree" add -A +if git -C "$worktree" diff --cached --quiet; then + echo "schemas branch already matches ${source_sha}" + exit 0 +fi +git -C "$worktree" -c user.name="github-actions[bot]" -c user.email="41898282+github-actions[bot]@users.noreply.github.com" \ + commit -q -m "chore(schemas): publish adapter schemas from ${source_sha}" +git -C "$worktree" push origin "$branch" diff --git a/hack/adapterresources/runtime.go b/hack/adapterresources/runtime.go new file mode 100644 index 00000000..aefa7a86 --- /dev/null +++ b/hack/adapterresources/runtime.go @@ -0,0 +1,171 @@ +package main + +import ( + "encoding/json" + "fmt" + "os" + "path/filepath" + "strings" + + "github.com/flanksource/captain/pkg/adapters/presentation" +) + +func enrichRuntimeSchemas(resources string) { + path := "pkg/adapters/openai/agent.schema.json" + schema := readObject(path) + definitions := map[string]any{} + properties := schema["properties"].(map[string]any) + for _, operation := range []struct{ name, file, native string }{ + {"initialize", "v1/InitializeParams", "initialize"}, + {"threadStart", "v2/ThreadStartParams", "thread/start"}, + {"threadResume", "v2/ThreadResumeParams", "thread/resume"}, + {"turnStart", "v2/TurnStartParams", "turn/start"}, + } { + native := readObject(sourcePath("codex-protocol/" + operation.file + ".json")) + renameReferences(native, "OpenAIAgent") + for key, value := range native["definitions"].(map[string]any) { + definitions["OpenAIAgent"+key] = value + } + old := properties[operation.name].(map[string]any) + for key, raw := range native["properties"].(map[string]any) { + field := raw.(map[string]any) + previous, exists := old["properties"].(map[string]any)[key].(map[string]any) + if exists { + for _, annotation := range []string{"title", "description", "x-captain-option", "readOnly", "x-clicky-section", "x-clicky-order", "x-enum-display", "x-enum-icons"} { + if value, ok := previous[annotation]; ok { + field[annotation] = value + } + } + } else { + field["readOnly"] = true + field["x-clicky-section"] = "cli" + field["x-captain-option"] = map[string]any{"nativeName": operation.native + "." + key, + "support": "unsupported", "note": "Accepted by the native protocol; Captain does not construct this option."} + } + } + old["properties"] = native["properties"] + delete(old, "required") + if required, ok := native["required"]; ok { + old["required"] = required + } + } + schema["$defs"] = definitions + sources := schema["x-captain-adapter"].(map[string]any)["sources"].([]any) + for _, raw := range sources { + source := raw.(map[string]any) + if source["kind"] == "protocol" { + source["version"] = "codex-cli 0.164.0" + } + } + presentation.AnnotateSchema(schema, "https://learn.chatgpt.com/docs/developers/app-server") + markNativeUnions(schema) + writeObject(path, schema) + enrichClaudeRuntime(resources) +} + +func enrichClaudeRuntime(resources string) { + source := readObject(filepath.Join(resources, "anthropic.json")) + definitions := source["definitions"].(map[string]any) + settings := definitions["Settings"].(map[string]any) + path := "pkg/adapters/anthropic/agent.schema.json" + schema := readObject(path) + props := schema["properties"].(map[string]any) + for _, mapping := range []struct{ property, definition string }{ + {"sandbox", ""}, {"settings", "Settings"}, {"managedSettings", "Settings"}, + {"agents", "AgentDefinition"}, {"mcpServers", "McpServerConfigForProcessTransport"}, + } { + field := props[mapping.property].(map[string]any) + var native map[string]any + if mapping.property == "sandbox" { + native = settings["properties"].(map[string]any)["sandbox"].(map[string]any) + } else if mapping.property == "agents" || mapping.property == "mcpServers" { + native = map[string]any{"type": "object", "additionalProperties": map[string]any{"$ref": "#/definitions/" + mapping.definition}} + } else { + native = map[string]any{"$ref": "#/definitions/" + mapping.definition} + } + delete(field, "additionalProperties") + for key, value := range native { + field[key] = value + } + } + schema["definitions"] = definitions + renameReferences(schema, "AnthropicAgent") + renamed := map[string]any{} + for key, value := range definitions { + renamed["AnthropicAgent"+key] = value + } + delete(schema, "definitions") + schema["$defs"] = renamed + presentation.AnnotateSchema(schema, "https://platform.claude.com/docs/en/agent-sdk/typescript") + markNativeUnions(schema) + writeObject(path, schema) +} + +func renameReferences(raw any, prefix string) { + switch node := raw.(type) { + case map[string]any: + if ref, ok := node["$ref"].(string); ok && strings.HasPrefix(ref, "#/definitions/") { + node["$ref"] = "#/$defs/" + prefix + strings.TrimPrefix(ref, "#/definitions/") + } + for _, child := range node { + renameReferences(child, prefix) + } + case []any: + for _, child := range node { + renameReferences(child, prefix) + } + } +} + +func markNativeUnions(raw any) { + switch node := raw.(type) { + case map[string]any: + _, oneOf := node["oneOf"].([]any) + _, anyOf := node["anyOf"].([]any) + if oneOf || anyOf { + node["goJSONSchema"] = map[string]any{"type": "json.RawMessage", "imports": []any{"encoding/json"}} + } + for _, child := range node { + markNativeUnions(child) + } + case []any: + for _, child := range node { + markNativeUnions(child) + } + } +} + +func readObject(path string) map[string]any { + raw, err := os.ReadFile(path) + must(err) + var schema map[string]any + must(json.Unmarshal(raw, &schema)) + return schema +} + +func writeObject(path string, value map[string]any) { + clearFieldIdentifiers(value) + raw, err := json.MarshalIndent(value, "", " ") + must(err) + must(os.WriteFile(path, append(raw, '\n'), 0o644)) + fmt.Println("Updated " + path) +} + +func clearFieldIdentifiers(raw any) { + switch node := raw.(type) { + case map[string]any: + if extension, ok := node["goJSONSchema"].(map[string]any); ok { + delete(extension, "identifier") + if len(extension) == 0 { + delete(node, "goJSONSchema") + } + } + for _, child := range node { + clearFieldIdentifiers(child) + } + case []any: + for _, child := range node { + clearFieldIdentifiers(child) + } + } +} diff --git a/hack/adapterresources/sdk.go b/hack/adapterresources/sdk.go new file mode 100644 index 00000000..511eaf00 --- /dev/null +++ b/hack/adapterresources/sdk.go @@ -0,0 +1,195 @@ +package main + +import ( + "encoding/json" + "fmt" + "reflect" + "strings" + "time" + + anthropic "github.com/anthropics/anthropic-sdk-go" + "github.com/flanksource/captain/pkg/adapters/presentation" + openai "github.com/openai/openai-go" + "github.com/openai/openai-go/responses" + "google.golang.org/genai" +) + +type sdkSchemas struct { + prefix string + definitions map[string]any + sources map[string]sdkSource +} + +func enrichAPISchemas() { + for _, provider := range []struct { + name, version, docs string + request reflect.Type + extras map[string]reflect.Type + }{ + {"anthropic", "github.com/anthropics/anthropic-sdk-go v1.26.0", "https://platform.claude.com/docs/en/api/messages", reflect.TypeFor[anthropic.MessageNewParams](), nil}, + {"openai", "github.com/openai/openai-go v1.12.0", "https://platform.openai.com/docs/api-reference/responses/create", reflect.TypeFor[responses.ResponseNewParams](), nil}, + {"google", "google.golang.org/genai v1.57.0", "https://ai.google.dev/api/generate-content", reflect.TypeFor[genai.GenerateContentConfig](), map[string]reflect.Type{"contents": reflect.TypeFor[[]*genai.Content]()}}, + {"deepseek", "github.com/openai/openai-go v1.12.0", "https://api-docs.deepseek.com/api/create-chat-completion/", reflect.TypeFor[openai.ChatCompletionNewParams](), nil}, + } { + path := "pkg/adapters/" + provider.name + "/api.schema.json" + schema := readObject(path) + builder := &sdkSchemas{prefix: strings.ToUpper(provider.name[:1]) + provider.name[1:] + "API", definitions: map[string]any{}, sources: map[string]sdkSource{}} + native := builder.structure(provider.request) + properties := schema["properties"].(map[string]any) + for key, raw := range native["properties"].(map[string]any) { + field, exists := properties[key].(map[string]any) + if !exists { + field = map[string]any{"readOnly": true, "x-clicky-section": "environment", + "x-captain-option": map[string]any{"nativeName": key, "support": "unsupported", + "note": "Declared by " + provider.version + "; Captain does not construct this request option."}} + properties[key] = field + } + shape := raw.(map[string]any) + if provider.name == "anthropic" && key == "model" { + delete(field, "enum") + delete(field, "x-enum-labels") + delete(field, "x-enum-display") + } + for _, keyword := range []string{"type", "items", "properties", "additionalProperties", "oneOf", "anyOf", "$ref", "goJSONSchema"} { + delete(field, keyword) + } + for keyword, value := range shape { + if keyword != "title" && keyword != "description" { + field[keyword] = value + } + } + } + for key, kind := range provider.extras { + field := properties[key].(map[string]any) + shape := builder.value(kind) + for keyword, value := range shape { + field[keyword] = value + } + } + schema["$defs"] = builder.definitions + schema["x-captain-inventory"] = map[string]any{"sourceType": provider.request.String(), "version": provider.version} + presentation.AnnotateSchema(schema, provider.docs) + markNativeUnions(schema) + writeObject(path, schema) + fmt.Printf("%s: %d native request definitions from %s\n", provider.name, len(builder.definitions), provider.version) + } +} + +func (b *sdkSchemas) value(kind reflect.Type) map[string]any { + for kind.Kind() == reflect.Pointer { + kind = kind.Elem() + } + if kind == reflect.TypeFor[json.RawMessage]() || kind.Kind() == reflect.Interface { + return map[string]any{"format": "json"} + } + if kind == reflect.TypeFor[time.Time]() { + return map[string]any{"type": "string", "format": "date-time"} + } + if strings.Contains(kind.PkgPath(), "/param") && strings.HasPrefix(kind.Name(), "Opt[") { + field, exists := kind.FieldByName("Value") + if !exists { + panic("native optional type has no Value: " + kind.String()) + } + return b.value(field.Type) + } + if strings.HasSuffix(kind.PkgPath(), "/constant") { + raw, err := json.Marshal(reflect.Zero(kind).Interface()) + must(err) + var value any + must(json.Unmarshal(raw, &value)) + return map[string]any{"const": value} + } + if kind.Kind() == reflect.Struct && kind.Name() != "" { + name := b.prefix + kind.Name() + if _, exists := b.definitions[name]; !exists { + b.definitions[name] = map[string]any{} + b.definitions[name] = b.structure(kind) + } + return map[string]any{"$ref": "#/$defs/" + name} + } + switch kind.Kind() { + case reflect.String: + values := b.source(kind.PkgPath()).enums[kind.Name()] + if kind == reflect.TypeFor[anthropic.Model]() { + return map[string]any{"type": "string", "examples": values} + } + if len(values) > 0 { + return map[string]any{"type": "string", "enum": values} + } + return map[string]any{"type": "string"} + case reflect.Bool: + return map[string]any{"type": "boolean"} + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + return map[string]any{"type": "integer"} + case reflect.Float32, reflect.Float64: + return map[string]any{"type": "number"} + case reflect.Slice, reflect.Array: + if kind.Elem().Kind() == reflect.Uint8 { + return map[string]any{"type": "string", "contentEncoding": "base64"} + } + return map[string]any{"type": "array", "items": b.value(kind.Elem())} + case reflect.Map: + if kind.Key().Kind() != reflect.String { + panic("non-string native map key: " + kind.String()) + } + return map[string]any{"type": "object", "additionalProperties": b.value(kind.Elem())} + case reflect.Struct: + return b.structure(kind) + default: + panic("unrepresentable native request type: " + kind.String()) + } +} + +func (b *sdkSchemas) structure(kind reflect.Type) map[string]any { + properties := map[string]any{} + var required, alternatives []any + source := b.source(kind.PkgPath()) + for i := 0; i < kind.NumField(); i++ { + field := kind.Field(i) + if !field.IsExported() { + continue + } + tag := strings.Split(field.Tag.Get("json"), ",") + if tag[0] == "-" { + continue + } + if contains(tag, "inline") { + alternatives = append(alternatives, b.value(field.Type)) + continue + } + if tag[0] == "" { + panic("native field has no JSON name: " + kind.String() + "." + field.Name) + } + value := b.value(field.Type) + if description := source.fields[kind.Name()+"."+field.Name]; description != "" { + value["description"] = description + } + properties[tag[0]] = value + if contains(tag, "required") { + required = append(required, tag[0]) + } + } + if len(alternatives) > 0 { + if len(properties) > 0 { + panic("native union mixes inline variants and properties: " + kind.String()) + } + return map[string]any{"anyOf": alternatives} + } + result := map[string]any{"type": "object", "additionalProperties": false, "properties": properties} + if len(required) > 0 { + result["required"] = required + } + if description := source.types[kind.Name()]; description != "" { + result["description"] = description + } + return result +} + +func contains(values []string, value string) bool { + for _, candidate := range values { + if candidate == value { + return true + } + } + return false +} diff --git a/hack/adapterresources/sdk_source.go b/hack/adapterresources/sdk_source.go new file mode 100644 index 00000000..013b791f --- /dev/null +++ b/hack/adapterresources/sdk_source.go @@ -0,0 +1,81 @@ +package main + +import ( + "go/ast" + "go/parser" + "go/token" + "os" + "os/exec" + "path/filepath" + "strconv" + "strings" +) + +type sdkSource struct { + fields map[string]string + types map[string]string + enums map[string][]any +} + +func (b *sdkSchemas) source(path string) sdkSource { + if source, exists := b.sources[path]; exists { + return source + } + source := sdkSource{fields: map[string]string{}, types: map[string]string{}, enums: map[string][]any{}} + if path == "" { + return source + } + dir, err := exec.Command("go", "list", "-f", "{{.Dir}}", path).Output() + must(err) + files, err := os.ReadDir(strings.TrimSpace(string(dir))) + must(err) + for _, file := range files { + if !strings.HasSuffix(file.Name(), ".go") || strings.HasSuffix(file.Name(), "_test.go") { + continue + } + parsed, err := parser.ParseFile(token.NewFileSet(), filepath.Join(strings.TrimSpace(string(dir)), file.Name()), nil, parser.ParseComments) + must(err) + collectSDKDeclarations(parsed, source) + } + b.sources[path] = source + return source +} + +func collectSDKDeclarations(file *ast.File, source sdkSource) { + for _, declaration := range file.Decls { + group, ok := declaration.(*ast.GenDecl) + if !ok { + continue + } + currentType := "" + for _, raw := range group.Specs { + switch spec := raw.(type) { + case *ast.TypeSpec: + source.types[spec.Name.Name] = group.Doc.Text() + if structure, ok := spec.Type.(*ast.StructType); ok { + for _, field := range structure.Fields.List { + for _, name := range field.Names { + source.fields[spec.Name.Name+"."+name.Name] = field.Doc.Text() + } + } + } + case *ast.ValueSpec: + if group.Tok != token.CONST { + continue + } + if kind, ok := spec.Type.(*ast.Ident); ok { + currentType = kind.Name + } + for _, rawValue := range spec.Values { + literal, ok := rawValue.(*ast.BasicLit) + if !ok || literal.Kind != token.STRING || currentType == "" { + continue + } + value, err := strconv.Unquote(literal.Value) + must(err) + source.enums[currentType] = append(source.enums[currentType], value) + } + } + } + } +} diff --git a/migrations/04_demote_extra_transcript_children.sql b/migrations/04_demote_extra_transcript_children.sql new file mode 100644 index 00000000..23202fc1 --- /dev/null +++ b/migrations/04_demote_extra_transcript_children.sql @@ -0,0 +1,43 @@ +-- phase: pre +-- dependsOn: 02_merge_duplicate_sessions.sql + +-- One admission session is one provider conversation, so it holds at most one +-- transcript child; captain_sessions_transcript_parent_key in 10_sessions.pg.hcl +-- enforces it. Before the key existed, a run of a different provider family +-- admitted on a session that already had a transcript (a Codex-planned Gavel +-- session resumed with Claude) minted a second transcript child, and every read +-- of that session failed as a conflict. +-- +-- The key cannot be created while those rows exist, which is why this runs in +-- the pre phase -- after 02, whose re-pointing of children onto a surviving +-- duplicate can itself leave a parent with two transcript children. The oldest +-- child by (created_at, id) is the conversation the session started as and stays +-- its transcript; the others are kept as 'agent' children so nothing is deleted. +-- +-- On a database that predates 78 the column does not exist yet and there is +-- nothing to repair. Idempotent: once every parent has one transcript child the +-- update matches nothing. + +DO $$ +BEGIN + IF NOT EXISTS ( + SELECT 1 FROM information_schema.columns + WHERE table_schema = current_schema() + AND table_name = 'captain_sessions' + AND column_name = 'parent_relation' + ) THEN + RETURN; + END IF; + + UPDATE captain_sessions child + SET parent_relation = 'agent' + FROM ( + SELECT id, + row_number() OVER (PARTITION BY parent_session_id ORDER BY created_at, id) AS position + FROM captain_sessions + WHERE parent_relation = 'transcript' + ) ranked + WHERE child.id = ranked.id + AND ranked.position > 1; +END +$$; diff --git a/migrations/10_sessions.pg.hcl b/migrations/10_sessions.pg.hcl index dee1e205..b2d2dcce 100644 --- a/migrations/10_sessions.pg.hcl +++ b/migrations/10_sessions.pg.hcl @@ -180,6 +180,15 @@ table "captain_sessions" { index "captain_sessions_parent_session_id_idx" { columns = [column.parent_session_id] } + # One admission session is one provider conversation, so it holds at most one + # transcript child: the read path folds exactly one. A run of a different + # provider family cannot continue it. 04_demote_extra_transcript_children.sql + # demotes the extra children written before this key existed. + index "captain_sessions_transcript_parent_key" { + unique = true + columns = [column.parent_session_id] + where = "parent_relation = 'transcript'" + } index "captain_sessions_root_session_id_idx" { columns = [column.root_session_id] } diff --git a/migrations/41_runtime_profiles.pg.hcl b/migrations/41_runtime_profiles.pg.hcl index 98aa21ae..81d0949a 100644 --- a/migrations/41_runtime_profiles.pg.hcl +++ b/migrations/41_runtime_profiles.pg.hcl @@ -34,6 +34,11 @@ table "captain_runtime_presets" { type = enum.captain_spec_layer_scope } # The complete task Spec (api.RuntimePresetSpec) as JSON. + column "sort_order" { + null = false + type = bigint + default = 0 + } column "spec" { null = false type = jsonb diff --git a/migrations/82_gavel_transcript_parent_relation.sql b/migrations/82_gavel_transcript_parent_relation.sql index 9f5b1542..374eb354 100644 --- a/migrations/82_gavel_transcript_parent_relation.sql +++ b/migrations/82_gavel_transcript_parent_relation.sql @@ -20,11 +20,28 @@ -- The predicate is unambiguous: only a Gavel admission root parents a provider -- session row, and the transcript child is the only child it creates. Rows -- already at 'transcript' are left alone, so this is safe to re-run. +-- +-- captain_sessions_transcript_parent_key allows one transcript child per parent +-- and, on an upgrade, already exists when this post-phase script runs. So only +-- the oldest candidate of a root is relabelled, and only when the root has no +-- transcript child yet; a later Claude/Codex child of the same root is a +-- different conversation and stays 'agent' (see +-- 04_demote_extra_transcript_children.sql). UPDATE public.captain_sessions AS child SET parent_relation = 'transcript' -FROM public.captain_sessions AS root -WHERE child.parent_session_id = root.id - AND child.parent_relation = 'agent' - AND child.source IN ('claude', 'codex') - AND root.source = 'gavel'; +FROM ( + SELECT DISTINCT ON (candidate.parent_session_id) candidate.id + FROM public.captain_sessions AS candidate + JOIN public.captain_sessions AS root ON root.id = candidate.parent_session_id + WHERE candidate.parent_relation = 'agent' + AND candidate.source IN ('claude', 'codex') + AND root.source = 'gavel' + AND NOT EXISTS ( + SELECT 1 FROM public.captain_sessions AS transcript + WHERE transcript.parent_session_id = root.id + AND transcript.parent_relation = 'transcript' + ) + ORDER BY candidate.parent_session_id, candidate.created_at, candidate.id +) AS oldest +WHERE child.id = oldest.id; diff --git a/migrations/84_prompt_run_session_lifecycle.sql b/migrations/84_prompt_run_session_lifecycle.sql index 02407484..d4ea244b 100644 --- a/migrations/84_prompt_run_session_lifecycle.sql +++ b/migrations/84_prompt_run_session_lifecycle.sql @@ -26,6 +26,12 @@ -- or from how the execution ended (a chat interrupt), which the run alone does -- not carry. A new run going `running` still reopens such a session. -- +-- A chat turn (runtime->>'mode' = 'chat') settles without ending its +-- sessions: the chat outlives the turn and awaits the next message, so its +-- sessions stay `running` and go `idle`. The chat writes their terminal +-- lifecycle itself when it ends (stopped, failed, or idle long enough to +-- finish); a follower therefore keeps one stream open across its turns. +-- -- The UPDATE fires only when the lifecycle differs, so 51 advances -- state_version once and 83 notifies each session once per change. -- @@ -42,6 +48,7 @@ SET search_path = pg_catalog, public AS $$ DECLARE lifecycle public.captain_session_lifecycle_status; + settled boolean; terminal boolean; target uuid; BEGIN @@ -53,6 +60,10 @@ BEGIN ELSE lifecycle := NEW.state::text::public.captain_session_lifecycle_status; END CASE; + settled := lifecycle <> 'running'; + IF settled AND NEW.runtime ->> 'mode' = 'chat' THEN + lifecycle := 'running'; + END IF; terminal := lifecycle <> 'running'; FOREACH target IN ARRAY ARRAY[NEW.session_id, NEW.execution_session_id] LOOP @@ -67,15 +78,16 @@ BEGIN UPDATE public.captain_sessions s SET lifecycle_status = lifecycle, - activity_state = CASE WHEN terminal THEN 'idle' ELSE s.activity_state END, + activity_state = CASE WHEN settled THEN 'idle' ELSE s.activity_state END, state_reason = CASE WHEN terminal THEN NULLIF(btrim(NEW.error), '') END, started_at = COALESCE(s.started_at, NEW.started_at), ended_at = CASE WHEN terminal THEN GREATEST(NEW.finished_at, COALESCE(s.started_at, NEW.started_at)) END WHERE s.id = target - AND s.lifecycle_status IS DISTINCT FROM lifecycle - AND NOT (terminal AND s.lifecycle_status IN ('partial', 'interrupted')); + AND (s.lifecycle_status IS DISTINCT FROM lifecycle + OR (settled AND NOT terminal AND s.activity_state IS DISTINCT FROM 'idle')) + AND NOT (settled AND s.lifecycle_status IN ('partial', 'interrupted')); END LOOP; RETURN NULL; @@ -94,14 +106,17 @@ REVOKE ALL ON FUNCTION public.captain_project_prompt_run_lifecycle() FROM PUBLIC -- each session still `created` or `running` whose latest started run (the -- trigger's ordering) is terminal takes that run's outcome, exactly as the -- trigger would have projected it. A session whose latest run is still running --- is left alone -- the trigger projects its next change. Idempotent: a repaired +-- is left alone -- the trigger projects its next change, as is one whose latest +-- run is a chat turn: its chat owns the lifecycle. Idempotent: a repaired -- session is terminal and no longer matches. WITH run_sessions AS ( - SELECT r.session_id AS target, r.id, r.state, r.error, r.created_at, r.started_at, r.finished_at + SELECT r.session_id AS target, r.id, r.state, r.error, r.created_at, r.started_at, r.finished_at, + r.runtime ->> 'mode' AS mode FROM public.captain_prompt_runs r WHERE r.state <> 'pending' UNION - SELECT r.execution_session_id, r.id, r.state, r.error, r.created_at, r.started_at, r.finished_at + SELECT r.execution_session_id, r.id, r.state, r.error, r.created_at, r.started_at, r.finished_at, + r.runtime ->> 'mode' FROM public.captain_prompt_runs r WHERE r.state <> 'pending' AND r.execution_session_id IS NOT NULL @@ -119,4 +134,5 @@ UPDATE public.captain_sessions s FROM latest WHERE s.id = latest.target AND latest.state IN ('succeeded', 'failed', 'cancelled') + AND latest.mode IS DISTINCT FROM 'chat' AND s.lifecycle_status IN ('created', 'running'); diff --git a/migrations/prompt_run_session_lifecycle_integration_test.go b/migrations/prompt_run_session_lifecycle_integration_test.go index f744c519..3aa87dd4 100644 --- a/migrations/prompt_run_session_lifecycle_integration_test.go +++ b/migrations/prompt_run_session_lifecycle_integration_test.go @@ -195,6 +195,28 @@ var _ = Describe("prompt run session lifecycle", Ordered, func() { })) }) + // A chat turn is one run, but the chat outlives it: between turns the chat + // awaits the next message, and only the chat knows when it has ended. + DescribeTable("leaves a live chat's sessions running and idle when a turn settles", + func(ctx SpecContext, state string) { + admission, execution := insertSession(ctx, "captain"), insertSession(ctx, "claude") + run := insertRun(ctx, admission, &execution, 0) + _, err := db.ExecContext(ctx, `UPDATE captain_prompt_runs SET runtime = '{"mode":"chat"}' WHERE id = $1`, run) + Expect(err).NotTo(HaveOccurred()) + startRun(ctx, run, time.Minute) + _, err = db.ExecContext(ctx, `UPDATE captain_sessions SET activity_state = 'working' WHERE id IN ($1, $2)`, admission, execution) + Expect(err).NotTo(HaveOccurred()) + + finishRun(ctx, run, state, "", 5*time.Minute) + + awaiting := sessionLifecycle{Lifecycle: "running", Activity: "idle", StateVersion: 3} + Expect(lifecycleOf(ctx, admission)).To(Equal(awaiting)) + Expect(lifecycleOf(ctx, execution)).To(Equal(awaiting)) + }, + Entry("an answered turn", "succeeded"), + Entry("an interrupted turn", "cancelled"), + ) + // A batch's runs are booked against its member sessions; the root's partial // verdict is Go's, derived from all of them. It("leaves a batch root's partial verdict and its version untouched by its members' runs", func(ctx SpecContext) { diff --git a/migrations/transcript_parent_key_integration_test.go b/migrations/transcript_parent_key_integration_test.go new file mode 100644 index 00000000..9cd356c8 --- /dev/null +++ b/migrations/transcript_parent_key_integration_test.go @@ -0,0 +1,95 @@ +package migrations + +import ( + "context" + "database/sql" + + "github.com/flanksource/commons-db/dbtest" + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +// One admission session is one provider conversation, so it holds at most one +// transcript child. captain_sessions_transcript_parent_key enforces that, and +// 04_demote_extra_transcript_children.sql repairs the rows written before it +// existed. 82_gavel_transcript_parent_relation.sql runs after the key is in +// place on an upgrade, so its relabel must not mint a second transcript either. +var _ = Describe("Captain transcript parent key", func() { + const ( + parentID = "11111111-1111-1111-1111-111111111111" + codexID = "22222222-2222-2222-2222-222222222222" + claudeID = "33333333-3333-3333-3333-333333333333" + lateID = "44444444-4444-4444-4444-444444444444" + ) + + // legacyDatabase is a migrated database put back into the state the key + // forbids: the key dropped and the named repair scripts unrecorded, so the + // next Apply runs them against the seeded rows. + legacyDatabase := func(ctx context.Context, scripts ...string) (string, *sql.DB) { + handle := dbtest.ForGinkgo(dbtest.Options{Name: "captain_transcript_parent_key"}) + dsn, db := handle.DSN(), handle.SQL() + Expect(Apply(ctx, dsn)).To(Succeed()) + _, err := db.ExecContext(ctx, `DROP INDEX captain_sessions_transcript_parent_key`) + Expect(err).NotTo(HaveOccurred()) + for _, script := range scripts { + _, err = db.ExecContext(ctx, + `DELETE FROM schema_migration_scripts WHERE scope = $1 AND path = $2`, Scope, script) + Expect(err).NotTo(HaveOccurred()) + } + _, err = db.ExecContext(ctx, ` + INSERT INTO captain_sessions (id, source, host_id, provider_session_id) + VALUES ($1, 'gavel', 'host-a', 'rollout-1')`, parentID) + Expect(err).NotTo(HaveOccurred()) + return dsn, db + } + + seedChildren := func(ctx context.Context, db *sql.DB, relation string) { + _, err := db.ExecContext(ctx, ` + INSERT INTO captain_sessions (id, source, host_id, provider_session_id, parent_session_id, root_session_id, parent_relation, created_at) + VALUES ($1, 'codex', 'host-a', 'rollout-1', $3, $3, $4, now() - interval '2 minutes'), + ($2, 'claude', 'host-a', 'rollout-1', $3, $3, $4, now() - interval '1 minute')`, + codexID, claudeID, parentID, relation) + Expect(err).NotTo(HaveOccurred()) + } + + relations := func(ctx context.Context, db *sql.DB) map[string]string { + rows, err := db.QueryContext(ctx, + `SELECT id::text, parent_relation FROM captain_sessions WHERE parent_session_id = $1`, parentID) + Expect(err).NotTo(HaveOccurred()) + defer func() { Expect(rows.Close()).To(Succeed()) }() + result := map[string]string{} + for rows.Next() { + var id, relation string + Expect(rows.Scan(&id, &relation)).To(Succeed()) + result[id] = relation + } + Expect(rows.Err()).NotTo(HaveOccurred()) + return result + } + + insertLateTranscript := func(ctx context.Context, db *sql.DB) error { + _, err := db.ExecContext(ctx, ` + INSERT INTO captain_sessions (id, source, host_id, provider_session_id, parent_session_id, root_session_id, parent_relation) + VALUES ($1, 'api', 'host-a', 'rollout-1', $2, $2, 'transcript')`, lateID, parentID) + return err + } + + It("keeps the oldest transcript child, demotes the rest to agent, and rejects another", func(ctx SpecContext) { + dsn, db := legacyDatabase(ctx, "04_demote_extra_transcript_children.sql") + seedChildren(ctx, db, "transcript") + + Expect(Apply(ctx, dsn)).To(Succeed()) + + Expect(relations(ctx, db)).To(Equal(map[string]string{codexID: "transcript", claudeID: "agent"})) + Expect(insertLateTranscript(ctx, db)).To(MatchError(ContainSubstring("captain_sessions_transcript_parent_key"))) + }) + + It("relabels only the oldest Gavel agent child when the key already exists", func(ctx SpecContext) { + dsn, db := legacyDatabase(ctx, "04_demote_extra_transcript_children.sql", "82_gavel_transcript_parent_relation.sql") + seedChildren(ctx, db, "agent") + + Expect(Apply(ctx, dsn)).To(Succeed()) + + Expect(relations(ctx, db)).To(Equal(map[string]string{codexID: "transcript", claudeID: "agent"})) + }) +}) diff --git a/pkg/adapters/anthropic/agent.schema.json b/pkg/adapters/anthropic/agent.schema.json index 9f00e7d2..1b6737c4 100644 --- a/pkg/adapters/anthropic/agent.schema.json +++ b/pkg/adapters/anthropic/agent.schema.json @@ -1,424 +1,19402 @@ { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "AnthropicAgentOptions", - "description": "Native Claude Agent SDK options and Captain bridge arguments used by the Anthropic agent runtime.", - "type": "object", - "additionalProperties": false, - "x-captain-adapter": { - "provider": "anthropic", - "mode": "agent", - "sources": [ - {"kind": "sdk", "reference": "@anthropic-ai/claude-agent-sdk.Options", "version": "0.3.280"}, - {"kind": "protocol", "reference": "pkg/ai/provider/claudeagent/protocol.ts InitializeParams and PromptParams", "version": "6a2b56cbd26702b18905865f21fc66d44cc864cc"}, - {"kind": "implementation", "reference": "pkg/ai/provider/claudeagent/agent.ts and bridge_params.go", "version": "6a2b56cbd26702b18905865f21fc66d44cc864cc"} - ] - }, - "properties": { - "model": { - "title": "Model", "description": "Claude model identifier passed to the Agent SDK.", - "type": "string", "x-clicky-section": "model", "x-clicky-order": 10, "x-icon": "sparkles", - "x-captain-option": {"nativeName": "model", "support": "mapped", "specPath": "model.name"} + "$defs": { + "AnthropicAgentAgentDefinition": { + "additionalProperties": false, + "description": "Definition for a custom subagent that can be invoked via the Agent tool.", + "properties": { + "background": { + "description": "Run this agent as a background task (non-blocking, fire-and-forget) when invoked", + "title": "Background", + "type": "boolean", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "criticalSystemReminder_EXPERIMENTAL": { + "description": "Experimental: Critical reminder added to system prompt", + "title": "Critical System Reminder EXPERIMENTAL", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": { + "description": "Natural language description of when to use this agent", + "title": "Description", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "disallowedTools": { + "description": "Array of tool names to explicitly disallow for this agent. MCP server-level specs (mcp__server, mcp__server__*, mcp__*) remove every tool from the named server (or all MCP tools).", + "items": { + "description": "Disallowed Tools value configuration. See the linked native reference for semantics and availability.", + "title": "Disallowed Tools value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Disallowed Tools", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "effort": { + "anyOf": [ + { + "const": "low", + "description": "Effort configuration. See the linked native reference for semantics and availability.", + "title": "Effort", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "const": "medium", + "description": "Effort configuration. See the linked native reference for semantics and availability.", + "title": "Effort", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "const": "high", + "description": "Effort configuration. See the linked native reference for semantics and availability.", + "title": "Effort", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "const": "xhigh", + "description": "Effort configuration. See the linked native reference for semantics and availability.", + "title": "Effort", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "const": "max", + "description": "Effort configuration. See the linked native reference for semantics and availability.", + "title": "Effort", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "description": "Effort configuration. See the linked native reference for semantics and availability.", + "title": "Effort", + "type": "number", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + ], + "description": "Reasoning effort level for this agent. Either a named level or an integer", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Effort", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "initialPrompt": { + "description": "Auto-submitted as the first user turn when this agent is the main thread agent. Slash commands are processed. Prepended to any user-provided prompt.", + "title": "Initial Prompt", + "type": "string", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "maxTurns": { + "description": "Maximum number of agentic turns (API round-trips) before stopping", + "title": "Max Turns", + "type": "number", + "x-clicky-order": 70, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "mcpServers": { + "description": "MCP Servers configuration. See the linked native reference for semantics and availability.", + "items": { + "$ref": "#/$defs/AnthropicAgentAgentMcpServerSpec", + "description": "MCP Servers value configuration. See the linked native reference for semantics and availability.", + "title": "MCP Servers value", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "MCP Servers", + "type": "array", + "x-clicky-order": 80, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "memory": { + "description": "Scope for auto-loading agent memory files. 'user' - ~/.claude/agent-memory/\u003cagentType\u003e/, 'project' - .claude/agent-memory/\u003cagentType\u003e/, 'local' - .claude/agent-memory-local/\u003cagentType\u003e/", + "enum": [ + "user", + "project", + "local" + ], + "title": "Memory", + "type": "string", + "x-clicky-order": 90, + "x-enum-display": "segmented", + "x-enum-labels": { + "local": "Local", + "project": "Project", + "user": "User" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "model": { + "description": "Model alias (e.g. 'fable', 'opus', 'sonnet', 'haiku') or full model ID (e.g. 'claude-fable-5'). 'inherit' uses the main model; if omitted, uses the default subagent model when one is configured, else the main model", + "title": "Model", + "type": "string", + "x-clicky-order": 100, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "observer": { + "description": "Agent type auto-spawned as a background observer whenever this agent runs. The observer receives read-only activity digests and reports via the ObserverReport tool; it never participates in the task.", + "title": "Observer", + "type": "string", + "x-clicky-order": 110, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "observerMessage": { + "description": "Supplemental postamble appended (after the harness-owned default) to each activity digest sent to the observer. Blank values are ignored.", + "title": "Observer Message", + "type": "string", + "x-clicky-order": 120, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "omitClaudeMd": { + "description": "Run this agent without the user, project and local CLAUDE.md instruction files when it runs as a subagent; managed policy files are kept. For agents that take everything they need from the delegation prompt. No effect on the main session agent.", + "title": "Omit Claude Md", + "type": "boolean", + "x-clicky-order": 130, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "permissionMode": { + "$ref": "#/$defs/AnthropicAgentPermissionMode", + "description": "Permission mode controlling how tool executions are handled", + "title": "Permission Mode", + "x-clicky-order": 140, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "prompt": { + "description": "The agent's system prompt", + "title": "Prompt", + "type": "string", + "x-clicky-order": 150, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "skills": { + "description": "Array of skill names to preload into the agent context", + "items": { + "description": "Skills value configuration. See the linked native reference for semantics and availability.", + "title": "Skills value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Skills", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 160, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "tools": { + "description": "Array of allowed tool names. If omitted, inherits all tools from parent. Note: passing 'Skill' here is deprecated — use the `skills` field instead.", + "items": { + "description": "Tools value configuration. See the linked native reference for semantics and availability.", + "title": "Tools value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Tools", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 170, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "description", + "prompt" + ], + "title": "Agent Definition", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, - "effort": { - "title": "Effort", "description": "Adaptive reasoning effort used by supported Claude models.", - "type": "string", "enum": ["low", "medium", "high", "xhigh", "max"], "x-clicky-section": "model", "x-clicky-order": 20, "x-enum-display": "combobox", - "x-captain-option": {"nativeName": "effort", "support": "mapped", "specPath": "model.effort"} + "AnthropicAgentAgentMcpServerSpec": { + "anyOf": [ + { + "description": "Agent MCP Server Spec configuration. See the linked native reference for semantics and availability.", + "title": "Agent MCP Server Spec", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": { + "$ref": "#/$defs/AnthropicAgentMcpServerConfigForProcessTransport", + "description": "Agent MCP Server Spec value configuration. See the linked native reference for semantics and availability.", + "title": "Agent MCP Server Spec value", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "Agent MCP Server Spec configuration. See the linked native reference for semantics and availability.", + "title": "Agent MCP Server Spec", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + ], + "description": "Agent MCP Server Spec configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Agent MCP Server Spec", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, - "cwd": { - "title": "Working directory", "description": "Working directory used by Claude Code tools and settings discovery.", - "type": "string", "format": "path", "x-clicky-section": "workspace", "x-clicky-order": 30, - "x-captain-option": {"nativeName": "cwd", "support": "mapped", "specPath": "context.dir"} + "AnthropicAgentCaptainClaudeAgent": { + "$ref": "#/$defs/AnthropicAgentAgentDefinition", + "description": "Captain Claude Agent configuration. See the linked native reference for semantics and availability.", + "title": "Captain Claude Agent", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, - "systemPrompt": { - "title": "System prompt", "description": "System prompt string, string blocks, or custom/preset configuration used for the session.", - "oneOf": [{"type": "string"}, {"type": "array", "items": {"type": "string"}}, {"type": "object", "additionalProperties": true}], "x-clicky-section": "prompt", "x-clicky-order": 40, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "systemPrompt", "support": "mapped", "specPath": "prompt.system"} + "AnthropicAgentCaptainClaudeMCP": { + "$ref": "#/$defs/AnthropicAgentMcpServerConfigForProcessTransport", + "description": "Captain Claude MCP configuration. See the linked native reference for semantics and availability.", + "title": "Captain Claude MCP", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, - "appendSystemPrompt": { - "title": "Append system prompt", "description": "Captain bridge text appended to the Agent SDK system prompt.", - "type": "string", "x-clicky-section": "prompt", "x-clicky-order": 50, - "x-captain-option": {"nativeName": "initialize.appendSystemPrompt", "support": "mapped", "specPath": "prompt.appendSystem"} + "AnthropicAgentCaptainClaudePlugin": { + "$ref": "#/$defs/AnthropicAgentSdkPluginConfig", + "description": "Captain Claude Plugin configuration. See the linked native reference for semantics and availability.", + "title": "Captain Claude Plugin", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, - "allowedTools": { - "title": "Allowed tools", "description": "Tool names the Agent SDK may use without being denied by Captain's policy.", - "type": "array", "items": {"type": "string"}, "x-clicky-section": "permissions", "x-clicky-order": 60, "x-array-display": "list", - "x-captain-option": {"nativeName": "allowedTools", "support": "mapped", "specPath": "permissions.tools.allow"} + "AnthropicAgentCaptainClaudeSettings": { + "$ref": "#/$defs/AnthropicAgentSettings", + "description": "Captain Claude Settings configuration. See the linked native reference for semantics and availability.", + "title": "Captain Claude Settings", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, - "disallowedTools": { - "title": "Disallowed tools", "description": "Tool names explicitly denied by Captain's policy.", - "type": "array", "items": {"type": "string"}, "x-clicky-section": "permissions", "x-clicky-order": 70, "x-array-display": "list", - "x-captain-option": {"nativeName": "disallowedTools", "support": "mapped", "specPath": "permissions.tools.deny"} + "AnthropicAgentMcpHttpServerConfig": { + "additionalProperties": false, + "description": "MCP HTTP Server Config configuration. See the linked native reference for semantics and availability.", + "properties": { + "alwaysLoad": { + "description": "When true, all tools from this server are always included in the prompt and never deferred behind tool search. Equivalent to setting defer_loading: false on the API. Default: tools are deferred when tool search is enabled. As a side effect this also blocks startup until the server is connected (capped at the standard 5s connect timeout) even though MCP startup is otherwise non-blocking by default, since the tools must be present when the turn-1 prompt is built.", + "title": "Always Load", + "type": "boolean", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "headers": { + "additionalProperties": { + "description": "Headers value configuration. See the linked native reference for semantics and availability.", + "title": "Headers value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "Headers configuration. See the linked native reference for semantics and availability.", + "title": "Headers", + "type": "object", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "timeout": { + "description": "Per-server tool-call timeout in milliseconds. Overrides the MCP_TOOL_TIMEOUT environment variable for this server. Hard wall-clock limit per call; progress notifications do not extend it. Values below 1000ms are ignored (falls through to MCP_TOOL_TIMEOUT or the default).", + "title": "Timeout", + "type": "number", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "tools": { + "description": "Tools configuration. See the linked native reference for semantics and availability.", + "items": { + "$ref": "#/$defs/AnthropicAgentMcpServerToolPolicy", + "description": "Tools value configuration. See the linked native reference for semantics and availability.", + "title": "Tools value", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Tools", + "type": "array", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "http", + "description": "Type configuration. See the linked native reference for semantics and availability.", + "title": "Type", + "type": "string", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "Url configuration. See the linked native reference for semantics and availability.", + "title": "Url", + "type": "string", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type", + "url" + ], + "title": "MCP HTTP Server Config", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, - "additionalDirectories": { - "title": "Additional directories", "description": "Directories outside cwd that Claude's tools may access.", - "type": "array", "items": {"type": "string", "format": "path"}, "x-clicky-section": "workspace", "x-clicky-order": 80, "x-array-display": "list", - "x-captain-option": {"nativeName": "additionalDirectories", "support": "mapped", "specPath": "permissions.directories"} + "AnthropicAgentMcpSSEServerConfig": { + "additionalProperties": false, + "description": "MCP SSEServer Config configuration. See the linked native reference for semantics and availability.", + "properties": { + "alwaysLoad": { + "description": "When true, all tools from this server are always included in the prompt and never deferred behind tool search. Equivalent to setting defer_loading: false on the API. Default: tools are deferred when tool search is enabled. As a side effect this also blocks startup until the server is connected (capped at the standard 5s connect timeout) even though MCP startup is otherwise non-blocking by default, since the tools must be present when the turn-1 prompt is built.", + "title": "Always Load", + "type": "boolean", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "headers": { + "additionalProperties": { + "description": "Headers value configuration. See the linked native reference for semantics and availability.", + "title": "Headers value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "Headers configuration. See the linked native reference for semantics and availability.", + "title": "Headers", + "type": "object", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "timeout": { + "description": "Per-server tool-call timeout in milliseconds. Overrides the MCP_TOOL_TIMEOUT environment variable for this server. Hard wall-clock limit per call; progress notifications do not extend it. Values below 1000ms are ignored (falls through to MCP_TOOL_TIMEOUT or the default).", + "title": "Timeout", + "type": "number", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "tools": { + "description": "Tools configuration. See the linked native reference for semantics and availability.", + "items": { + "$ref": "#/$defs/AnthropicAgentMcpServerToolPolicy", + "description": "Tools value configuration. See the linked native reference for semantics and availability.", + "title": "Tools value", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Tools", + "type": "array", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "sse", + "description": "Type configuration. See the linked native reference for semantics and availability.", + "title": "Type", + "type": "string", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "Url configuration. See the linked native reference for semantics and availability.", + "title": "Url", + "type": "string", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type", + "url" + ], + "title": "MCP SSEServer Config", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, - "maxTurns": { - "title": "Maximum turns", "description": "Maximum number of agent turns before the SDK stops.", - "type": "integer", "minimum": 1, "x-clicky-section": "model", "x-clicky-order": 90, - "x-captain-option": {"nativeName": "maxTurns", "support": "mapped", "specPath": "budget.maxTurns"} + "AnthropicAgentMcpSdkServerConfig": { + "additionalProperties": false, + "description": "MCP SDK Server Config configuration. See the linked native reference for semantics and availability.", + "properties": { + "name": { + "description": "Name configuration. See the linked native reference for semantics and availability.", + "title": "Name", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "timeout": { + "description": "Per-server tool-call timeout in milliseconds. Overrides the MCP_TOOL_TIMEOUT environment variable for this server. Hard wall-clock limit per call; progress notifications do not extend it. Values below 1000ms are ignored (falls through to MCP_TOOL_TIMEOUT or the default). Applies when the server is first registered; changing it for an already-registered server has no effect until it is removed and re-added.", + "title": "Timeout", + "type": "number", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "sdk", + "description": "Type configuration. See the linked native reference for semantics and availability.", + "title": "Type", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type", + "name" + ], + "title": "MCP SDK Server Config", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, - "maxBudgetUsd": { - "title": "Maximum budget", "description": "Maximum spend in US dollars before the SDK stops.", - "type": "number", "minimum": 0, "x-clicky-section": "model", "x-clicky-order": 100, - "x-captain-option": {"nativeName": "maxBudgetUsd", "support": "mapped", "specPath": "budget.cost"} + "AnthropicAgentMcpServerConfigForProcessTransport": { + "anyOf": [ + { + "$ref": "#/$defs/AnthropicAgentMcpStdioServerConfig", + "description": "MCP Server Config For Process Transport configuration. See the linked native reference for semantics and availability.", + "title": "MCP Server Config For Process Transport", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAgentMcpSSEServerConfig", + "description": "MCP Server Config For Process Transport configuration. See the linked native reference for semantics and availability.", + "title": "MCP Server Config For Process Transport", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAgentMcpHttpServerConfig", + "description": "MCP Server Config For Process Transport configuration. See the linked native reference for semantics and availability.", + "title": "MCP Server Config For Process Transport", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAgentMcpSdkServerConfig", + "description": "MCP Server Config For Process Transport configuration. See the linked native reference for semantics and availability.", + "title": "MCP Server Config For Process Transport", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + ], + "description": "MCP Server Config For Process Transport configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "MCP Server Config For Process Transport", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, - "permissionMode": { - "title": "Permission mode", "description": "Claude Code permission posture translated from Captain's runtime policy.", - "type": "string", "enum": ["default", "acceptEdits", "bypassPermissions", "plan", "dontAsk"], "x-clicky-section": "permissions", "x-clicky-order": 110, "x-enum-display": "combobox", - "x-captain-option": {"nativeName": "permissionMode", "support": "mapped", "specPath": "permissions.mode"} + "AnthropicAgentMcpServerToolPolicy": { + "additionalProperties": false, + "description": "Per-tool permission policy carried on mcp_set_servers for remote servers.", + "properties": { + "name": { + "description": "Name configuration. See the linked native reference for semantics and availability.", + "title": "Name", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "org_max_permission": { + "description": "Org admin's per-tool ceiling. Drives the auto-mode isOrgAskCeiling gate so an admin 'ask' cap forces a user prompt even in auto mode.", + "enum": [ + "allow", + "ask", + "blocked" + ], + "title": "Org max permission", + "type": "string", + "x-clicky-order": 20, + "x-enum-display": "segmented", + "x-enum-labels": { + "allow": "Allow", + "ask": "Ask", + "blocked": "Blocked" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "permission_policy": { + "description": "Permission policy configuration. See the linked native reference for semantics and availability.", + "enum": [ + "always_allow", + "always_ask", + "always_deny" + ], + "title": "Permission policy", + "type": "string", + "x-clicky-order": 30, + "x-enum-display": "segmented", + "x-enum-labels": { + "always_allow": "Always allow", + "always_ask": "Always ask", + "always_deny": "Always deny" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "name" + ], + "title": "MCP Server Tool Policy", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, - "sandbox": { - "title": "Sandbox", "description": "Claude Agent SDK filesystem and command sandbox configuration.", - "type": "object", "additionalProperties": true, "x-clicky-section": "sandbox", "x-clicky-order": 120, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "sandbox", "support": "mapped", "specPath": "permissions"} + "AnthropicAgentMcpStdioServerConfig": { + "additionalProperties": false, + "description": "MCP Stdio Server Config configuration. See the linked native reference for semantics and availability.", + "properties": { + "alwaysLoad": { + "description": "When true, all tools from this server are always included in the prompt and never deferred behind tool search. Equivalent to setting defer_loading: false on the API. Default: tools are deferred when tool search is enabled. As a side effect this also blocks startup until the server is connected (capped at the standard 5s connect timeout) even though MCP startup is otherwise non-blocking by default, since the tools must be present when the turn-1 prompt is built.", + "title": "Always Load", + "type": "boolean", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "args": { + "description": "Args configuration. See the linked native reference for semantics and availability.", + "items": { + "description": "Args value configuration. See the linked native reference for semantics and availability.", + "title": "Args value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Args", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "command": { + "description": "Command configuration. See the linked native reference for semantics and availability.", + "title": "Command", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "env": { + "additionalProperties": { + "description": "Env value configuration. See the linked native reference for semantics and availability.", + "title": "Env value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "Env configuration. See the linked native reference for semantics and availability.", + "title": "Env", + "type": "object", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "timeout": { + "description": "Per-server tool-call timeout in milliseconds. Overrides the MCP_TOOL_TIMEOUT environment variable for this server. Hard wall-clock limit per call; progress notifications do not extend it. Values below 1000ms are ignored (falls through to MCP_TOOL_TIMEOUT or the default).", + "title": "Timeout", + "type": "number", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "stdio", + "description": "Type configuration. See the linked native reference for semantics and availability.", + "title": "Type", + "type": "string", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "command" + ], + "title": "MCP Stdio Server Config", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, - "resume": { - "title": "Resume session", "description": "Claude session identifier resumed by the Agent SDK.", - "type": "string", "x-clicky-section": "workspace", "x-clicky-order": 130, - "x-captain-option": {"nativeName": "resume", "support": "mapped", "specPath": "sessionId"} + "AnthropicAgentPermissionMode": { + "description": "Permission mode for controlling how tool executions are handled. 'default' - Standard behavior, prompts for dangerous operations. 'acceptEdits' - Auto-accept file edit operations. 'bypassPermissions' - Bypass all permission checks (requires allowDangerouslySkipPermissions). 'plan' - Planning mode, no actual tool execution. 'dontAsk' - Don't prompt for permissions, deny if not pre-approved. 'auto' - Use a model classifier to approve/deny permission prompts.", + "enum": [ + "default", + "acceptEdits", + "bypassPermissions", + "plan", + "dontAsk", + "auto" + ], + "title": "Permission Mode", + "type": "string", + "x-enum-display": "combobox", + "x-enum-icons": { + "acceptEdits": "folder", + "auto": "sparkles", + "bypassPermissions": "lock-open", + "default": "shield", + "dontAsk": "prohibit", + "plan": "list-dashes" + }, + "x-enum-labels": { + "acceptEdits": "Accept Edits", + "auto": "Auto", + "bypassPermissions": "Bypass Permissions", + "default": "Default", + "dontAsk": "Dont Ask", + "plan": "Plan" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, - "outputFormat": { - "title": "Output format", "description": "Structured-output JSON Schema passed to the Agent SDK.", - "type": "object", "additionalProperties": true, "x-clicky-section": "prompt", "x-clicky-order": 140, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "outputFormat", "support": "mapped", "specPath": ["prompt.schema", "prompt.schemaJson"]} + "AnthropicAgentSdkPluginConfig": { + "additionalProperties": false, + "description": "Configuration for loading a plugin.", + "properties": { + "path": { + "description": "Absolute or relative path to the plugin directory", + "title": "Path", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "skipMcpDiscovery": { + "description": "When true, the engine loads skills/hooks/agents/commands from this plugin but does NOT read its .mcp.json or manifest mcpServers. Use when the SDK host owns this plugin's MCP connections.", + "title": "Skip MCP Discovery", + "type": "boolean", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "local", + "description": "Plugin type. Currently only 'local' is supported", + "title": "Type", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type", + "path" + ], + "title": "SDK Plugin Config", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, - "outputSchema": { - "title": "Bridge output schema", "description": "Captain bridge JSON Schema converted into the SDK outputFormat option.", - "type": "object", "additionalProperties": true, "x-clicky-section": "prompt", "x-clicky-order": 150, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "initialize.outputSchema", "support": "mapped", "specPath": ["prompt.schema", "prompt.schemaJson"]} + "AnthropicAgentSettings": { + "additionalProperties": { + "description": "Settings value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Settings value", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "AUTO-GENERATED - DO NOT EDIT\n\nThis file is auto-generated from the settings JSON schema. To modify these types, edit SettingsSchema in src/utils/settings/types.ts and run:\n\n bun scripts/generate-sdk-types.ts", + "properties": { + "$schema": { + "description": "JSON Schema reference for Claude Code settings", + "title": "$schema", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "additionalMarketplaces": { + "additionalProperties": { + "additionalProperties": false, + "description": "Additional Marketplaces value configuration. See the linked native reference for semantics and availability.", + "properties": { + "autoUpdate": { + "description": "Whether to automatically update this marketplace and its installed plugins on startup", + "title": "Auto Update", + "type": "boolean", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "installLocation": { + "description": "Local cache path where marketplace manifest is stored (auto-generated if not provided)", + "title": "Install Location", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "anyOf": [ + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "headers": { + "additionalProperties": { + "description": "Headers value configuration. See the linked native reference for semantics and availability.", + "title": "Headers value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "Custom HTTP headers (e.g., for authentication)", + "title": "Headers", + "type": "object", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "headersHelper": { + "description": "Command that prints a JSON object of HTTP headers (e.g. a short-lived auth token). Its output overrides `headers` and, like `headers`, is inherited by same-origin archive downloads from this marketplace. Runs from a fixed directory (the Claude config home, never the session's), so give a bare command found via PATH or an absolute path; it is re-run on later refreshes of this marketplace.", + "title": "Headers Helper", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "url", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "Direct URL to marketplace.json file", + "title": "Url", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "url" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "path": { + "description": "Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)", + "title": "Path", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "ref": { + "description": "Git branch or tag to use (e.g., \"main\", \"v1.0.0\"). Defaults to repository default branch.", + "title": "Ref", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "repo": { + "description": "GitHub repository in owner/repo format. ONLY in the managed-settings policy lists (strictKnownMarketplaces / blockedMarketplaces) the owner-wildcard form \"owner/*\" matches every repository under exactly that owner. Everywhere else (marketplace add, extraKnownMarketplaces, known_marketplaces.json) the value must name a single repository — a wildcard is taken literally and fails to clone.", + "title": "Repo", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "skipLfs": { + "description": "Has no effect; accepted so existing settings keep working. Claude Code's own git never downloads Git LFS content: LFS-tracked files in the marketplace repository are checked out as pointer files whether or not this is set, and adding or updating the marketplace says how many were. To fetch their content, run `git lfs pull` in the marketplace's checkout under ~/.claude/plugins/marketplaces/.", + "title": "Skip Lfs", + "type": "boolean", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "github", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "sparsePaths": { + "description": "Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [\".claude-plugin\", \"plugins\"]. If omitted, the full repository is cloned.", + "items": { + "description": "Sparse Paths value configuration. See the linked native reference for semantics and availability.", + "title": "Sparse Paths value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Sparse Paths", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "repo" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "path": { + "description": "Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)", + "title": "Path", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "ref": { + "description": "Git branch or tag to use (e.g., \"main\", \"v1.0.0\"). Defaults to repository default branch.", + "title": "Ref", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "skipLfs": { + "description": "Has no effect; accepted so existing settings keep working. Claude Code's own git never downloads Git LFS content: LFS-tracked files in the marketplace repository are checked out as pointer files whether or not this is set, and adding or updating the marketplace says how many were. To fetch their content, run `git lfs pull` in the marketplace's checkout under ~/.claude/plugins/marketplaces/.", + "title": "Skip Lfs", + "type": "boolean", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "git", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "sparsePaths": { + "description": "Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [\".claude-plugin\", \"plugins\"]. If omitted, the full repository is cloned.", + "items": { + "description": "Sparse Paths value configuration. See the linked native reference for semantics and availability.", + "title": "Sparse Paths value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Sparse Paths", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "Full git repository URL", + "title": "Url", + "type": "string", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "url" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "package": { + "description": "npm package containing marketplace.json (e.g. \"\\@acme/claude-marketplace\"). In strictKnownMarketplaces / blockedMarketplaces an entry also governs plugins installed straight from the npm marketplace (`\u003cpackage\u003e\\@npm`): an exact package name matches that package, and \"\\@acme/*\" matches every package under the scope.", + "title": "Package", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "registry": { + "description": "Registry URL. When adding a marketplace: a one-off registry override (otherwise your npm configuration decides). In a policy entry: the origin and path prefix the package's RESOLVED tarball URL must fall under (e.g. \"https://npm.example.com/api/npm/internal/\").", + "title": "Registry", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "npm", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "version": { + "description": "Version or range to fetch (e.g. \"1.4.0\", \"^1.4\"); defaults to the latest dist-tag", + "title": "Version", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "package" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "path": { + "description": "Local file path to marketplace.json", + "title": "Path", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "file", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "path" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "path": { + "description": "Local directory containing .claude-plugin/marketplace.json", + "title": "Path", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "directory", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "path" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "source": { + "const": "skills-dir", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "hostPattern": { + "description": "Regex pattern to match the host/domain extracted from any marketplace source type. For github sources, matches against github.com. For git sources (SSH or HTTPS), extracts the hostname from the URL. Use in strictKnownMarketplaces to allow all marketplaces from a specific host (e.g., \"^github\\.mycompany\\.com$\").", + "title": "Host Pattern", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "hostPattern", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "hostPattern" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "pathPattern": { + "description": "Regex pattern matched against the .path field of file and directory sources. Use in strictKnownMarketplaces to allow filesystem-based marketplaces alongside hostPattern restrictions for network sources. Use \".*\" to allow all filesystem paths, or a narrower pattern (e.g., \"^/opt/approved/\") to restrict to specific directories.", + "title": "Path Pattern", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "pathPattern", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "pathPattern" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "name": { + "description": "Marketplace name. Must match the extraKnownMarketplaces key (enforced); the synthetic manifest is written under this name. Same validation as PluginMarketplaceSchema plus reserved-name rejection — validateOfficialNameSource runs after the disk write, too late to clean up.", + "title": "Name", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "owner": { + "additionalProperties": false, + "description": "Owner configuration. See the linked native reference for semantics and availability.", + "properties": { + "email": { + "description": "Contact email for support or feedback", + "title": "Email", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "name": { + "description": "Display name of the plugin author or organization", + "title": "Name", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "Website, GitHub profile, or organization URL", + "title": "Url", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "name" + ], + "title": "Owner", + "type": "object", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "plugins": { + "description": "Plugin entries declared inline in settings.json", + "items": { + "additionalProperties": false, + "description": "Plugins value configuration. See the linked native reference for semantics and availability.", + "properties": { + "description": { + "description": "Description configuration. See the linked native reference for semantics and availability.", + "title": "Description", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "headers": { + "additionalProperties": { + "description": "Headers value configuration. See the linked native reference for semantics and availability.", + "title": "Headers value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "HTTP headers sent when downloading this entry's `archive` source.", + "title": "Headers", + "type": "object", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "headersHelper": { + "description": "Command that prints a JSON object of HTTP headers for downloading this entry's `archive` source. Runs only when a user explicitly installs or updates this plugin. Unlike a catalog entry, an entry written here does not need `strict: false`: it is declared in a settings file, which has no manifest fields to inline. A declaration in project settings is not operator-authored, so request-routing and client-identity header names are still filtered there. Use an absolute path.", + "title": "Headers Helper", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "name": { + "description": "Plugin name as it appears in the target repository", + "title": "Name", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "anyOf": [ + { + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "package": { + "description": "Package name (or url, or local path, or anything else that can be passed to `npm` as a package)", + "title": "Package", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "registry": { + "description": "Custom NPM registry URL (defaults to using system default, likely npmjs.org)", + "title": "Registry", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "npm", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "version": { + "description": "Specific version or version range (e.g., ^1.0.0, ~2.1.0)", + "title": "Version", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "package" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "ref": { + "description": "Git branch or tag to use (e.g., \"main\", \"v1.0.0\"). Defaults to repository default branch.", + "title": "Ref", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "sha": { + "description": "Specific commit SHA to use", + "title": "Sha", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "url", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "Full git repository URL (https:// or git\\@)", + "title": "Url", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "url" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "ref": { + "description": "Git branch or tag to use (e.g., \"main\", \"v1.0.0\"). Defaults to repository default branch.", + "title": "Ref", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "repo": { + "description": "GitHub repository in owner/repo format", + "title": "Repo", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "sha": { + "description": "Specific commit SHA to use", + "title": "Sha", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "github", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "repo" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "path": { + "description": "Subdirectory within the repo containing the plugin (e.g., \"tools/claude-plugin\"). Cloned sparsely using partial clone (--filter=tree:0) to minimize bandwidth for monorepos.", + "title": "Path", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "ref": { + "description": "Git branch or tag to use (e.g., \"main\", \"v1.0.0\"). Defaults to repository default branch.", + "title": "Ref", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "sha": { + "description": "Specific commit SHA to use", + "title": "Sha", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "git-subdir", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "Git repository: GitHub owner/repo shorthand, https://, or git\\@ URL", + "title": "Url", + "type": "string", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "url", + "path" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "sha256": { + "description": "SHA-256 digest of the archive. When set, every download is verified against it and the install is refused on mismatch. It also serves as the version identity when neither plugin.json nor the marketplace entry declares a `version`. Recommended. Note the update signal is the version string (plugin.json version, else the entry version, else this digest) — changing only the digest while a version is declared does not trigger an update.", + "title": "Sha256", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "archive", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "HTTPS URL of a zip archive containing the plugin. The plugin root (the directory holding .claude-plugin/) may be at the top of the archive or nested one directory deep — a single wrapping directory is stripped.", + "title": "Url", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "url" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "command": { + "description": "Shell command that prints the absolute path of the plugin directory on stdout (exactly one line) and exits 0. It must leave a complete plugin in that directory before exiting; the directory is copied into the plugin cache, so the printed path may change between runs (it is re-resolved on every install and update, and once per session in the background). Runs through the platform shell (sh on macOS/Linux, cmd.exe on Windows) from the user's home directory with Claude Code's subprocess environment.", + "title": "Command", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "mode": { + "description": "copy (default): the printed directory is copied into the plugin cache and content-hashed, so it may be deleted afterwards. link: the cache entry links to the printed directory in place (no copy, no size limit; macOS/Linux) — for large exports; the directory must then stay valid while Claude Code runs, and a different printed path is what signals new content.", + "enum": [ + "copy", + "link" + ], + "title": "Mode", + "type": "string", + "x-clicky-order": 20, + "x-enum-display": "segmented", + "x-enum-labels": { + "copy": "Copy", + "link": "Link" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "command", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "timeout": { + "description": "Seconds to wait for the command before giving up (default: 60)", + "title": "Timeout", + "type": "number", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "command" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "error": { + "description": "Error configuration. See the linked native reference for semantics and availability.", + "title": "Error", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "unsupported", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + ], + "description": "Where to fetch the plugin from. Must be a remote source — relative paths have no marketplace repository to resolve against.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Source", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "strict": { + "description": "Strict configuration. See the linked native reference for semantics and availability.", + "title": "Strict", + "type": "boolean", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "version": { + "description": "Version configuration. See the linked native reference for semantics and availability.", + "title": "Version", + "type": "string", + "x-clicky-order": 70, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "name", + "source" + ], + "title": "Plugins value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Plugins", + "type": "array", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "settings", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "name", + "plugins" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + ], + "description": "Where to fetch the marketplace from", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Source", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source" + ], + "title": "Additional Marketplaces value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "Alias for extraKnownMarketplaces: this key is read exactly as if it were spelled extraKnownMarketplaces. Do not set both in one file — if both appear, this key is ignored with a warning. Claude Code may rewrite this key as extraKnownMarketplaces when it updates the file. Clients older than this alias ignore it, so prefer extraKnownMarketplaces while older Claude Code versions still share the same settings.", + "title": "Additional Marketplaces", + "type": "object", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "advisorModel": { + "description": "Advisor model for the server-side advisor tool.", + "title": "Advisor Model", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "agent": { + "description": "Name of an agent (built-in or custom) to use for the main thread. Applies the agent's system prompt, tool restrictions, and model.", + "title": "Agent", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "agentPushNotifEnabled": { + "description": "Allow Claude to push proactive mobile notifications", + "title": "Agent Push Notif Enabled", + "type": "boolean", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "allowAllClaudeAiMcps": { + "description": "When true (and set in managed settings), claude.ai cloud MCP connectors load alongside managed-mcp.json instead of being suppressed by its exclusive-control lockdown. Default off preserves the lockdown. Read from managed settings only.", + "title": "Allow All Claude Ai Mcps", + "type": "boolean", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "allowManagedHooksOnly": { + "description": "When true (and set in managed settings), only hooks from managed settings and from plugins that managed settings enable run. User, project, and local hooks and the hooks of plugins the user installed are ignored. Features built into Claude Code are not hooks in this sense and keep working.", + "title": "Allow Managed Hooks Only", + "type": "boolean", + "x-clicky-order": 70, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "allowManagedMcpServersOnly": { + "description": "When true (and set in managed settings), allowedMcpServers is only read from managed settings. deniedMcpServers still merges from all sources, so users can deny servers for themselves. Users can still add their own MCP servers, but only the admin-defined allowlist applies.", + "title": "Allow Managed MCP Servers Only", + "type": "boolean", + "x-clicky-order": 80, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "allowManagedPermissionRulesOnly": { + "description": "When true (and set in managed settings), permission rules from user, project, local, and --settings files and allow rules from --allowedTools are ignored; only managed settings can add allow rules through settings. --disallowedTools and other deny and ask rules from the command line or the current session still apply.", + "title": "Allow Managed Permission Rules Only", + "type": "boolean", + "x-clicky-order": 90, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "allowedChannelPlugins": { + "description": "Managed-org allowlist of channel plugins. When set, replaces the default Anthropic allowlist — admins decide which plugins may push inbound messages. Undefined falls back to the default. Requires channelsEnabled: true.", + "items": { + "additionalProperties": false, + "description": "Allowed Channel Plugins value configuration. See the linked native reference for semantics and availability.", + "properties": { + "marketplace": { + "description": "Marketplace configuration. See the linked native reference for semantics and availability.", + "title": "Marketplace", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "plugin": { + "description": "Plugin configuration. See the linked native reference for semantics and availability.", + "title": "Plugin", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "marketplace", + "plugin" + ], + "title": "Allowed Channel Plugins value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Allowed Channel Plugins", + "type": "array", + "x-clicky-order": 100, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "allowedHttpHookUrls": { + "description": "Allowlist of URL patterns that HTTP hooks may target. Supports * as a wildcard (e.g. \"https://hooks.example.com/*\"). When set, HTTP hooks with non-matching URLs are blocked. If undefined, all URLs are allowed. If empty array, no HTTP hooks are allowed. Arrays merge across settings sources (same semantics as allowedMcpServers).", + "items": { + "description": "Allowed HTTP Hook Urls value configuration. See the linked native reference for semantics and availability.", + "title": "Allowed HTTP Hook Urls value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Allowed HTTP Hook Urls", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 110, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "allowedMarketplaces": { + "description": "Alias for strictKnownMarketplaces (managed settings only): this key is read exactly as if it were spelled strictKnownMarketplaces. Do not set both in one file — if both appear, this key is ignored with a warning. Clients older than this alias ignore it, so keep using strictKnownMarketplaces when the allowlist must also bind older Claude Code versions.", + "items": { + "anyOf": [ + { + "additionalProperties": false, + "description": "Allowed Marketplaces value configuration. See the linked native reference for semantics and availability.", + "properties": { + "headers": { + "additionalProperties": { + "description": "Headers value configuration. See the linked native reference for semantics and availability.", + "title": "Headers value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "Custom HTTP headers (e.g., for authentication)", + "title": "Headers", + "type": "object", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "headersHelper": { + "description": "Command that prints a JSON object of HTTP headers (e.g. a short-lived auth token). Its output overrides `headers` and, like `headers`, is inherited by same-origin archive downloads from this marketplace. Runs from a fixed directory (the Claude config home, never the session's), so give a bare command found via PATH or an absolute path; it is re-run on later refreshes of this marketplace.", + "title": "Headers Helper", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "url", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "Direct URL to marketplace.json file", + "title": "Url", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "url" + ], + "title": "Allowed Marketplaces value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Allowed Marketplaces value configuration. See the linked native reference for semantics and availability.", + "properties": { + "path": { + "description": "Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)", + "title": "Path", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "ref": { + "description": "Git branch or tag to use (e.g., \"main\", \"v1.0.0\"). Defaults to repository default branch.", + "title": "Ref", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "repo": { + "description": "GitHub repository in owner/repo format. ONLY in the managed-settings policy lists (strictKnownMarketplaces / blockedMarketplaces) the owner-wildcard form \"owner/*\" matches every repository under exactly that owner. Everywhere else (marketplace add, extraKnownMarketplaces, known_marketplaces.json) the value must name a single repository — a wildcard is taken literally and fails to clone.", + "title": "Repo", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "skipLfs": { + "description": "Has no effect; accepted so existing settings keep working. Claude Code's own git never downloads Git LFS content: LFS-tracked files in the marketplace repository are checked out as pointer files whether or not this is set, and adding or updating the marketplace says how many were. To fetch their content, run `git lfs pull` in the marketplace's checkout under ~/.claude/plugins/marketplaces/.", + "title": "Skip Lfs", + "type": "boolean", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "github", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "sparsePaths": { + "description": "Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [\".claude-plugin\", \"plugins\"]. If omitted, the full repository is cloned.", + "items": { + "description": "Sparse Paths value configuration. See the linked native reference for semantics and availability.", + "title": "Sparse Paths value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Sparse Paths", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "repo" + ], + "title": "Allowed Marketplaces value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Allowed Marketplaces value configuration. See the linked native reference for semantics and availability.", + "properties": { + "path": { + "description": "Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)", + "title": "Path", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "ref": { + "description": "Git branch or tag to use (e.g., \"main\", \"v1.0.0\"). Defaults to repository default branch.", + "title": "Ref", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "skipLfs": { + "description": "Has no effect; accepted so existing settings keep working. Claude Code's own git never downloads Git LFS content: LFS-tracked files in the marketplace repository are checked out as pointer files whether or not this is set, and adding or updating the marketplace says how many were. To fetch their content, run `git lfs pull` in the marketplace's checkout under ~/.claude/plugins/marketplaces/.", + "title": "Skip Lfs", + "type": "boolean", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "git", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "sparsePaths": { + "description": "Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [\".claude-plugin\", \"plugins\"]. If omitted, the full repository is cloned.", + "items": { + "description": "Sparse Paths value configuration. See the linked native reference for semantics and availability.", + "title": "Sparse Paths value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Sparse Paths", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "Full git repository URL", + "title": "Url", + "type": "string", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "url" + ], + "title": "Allowed Marketplaces value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Allowed Marketplaces value configuration. See the linked native reference for semantics and availability.", + "properties": { + "package": { + "description": "npm package containing marketplace.json (e.g. \"\\@acme/claude-marketplace\"). In strictKnownMarketplaces / blockedMarketplaces an entry also governs plugins installed straight from the npm marketplace (`\u003cpackage\u003e\\@npm`): an exact package name matches that package, and \"\\@acme/*\" matches every package under the scope.", + "title": "Package", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "registry": { + "description": "Registry URL. When adding a marketplace: a one-off registry override (otherwise your npm configuration decides). In a policy entry: the origin and path prefix the package's RESOLVED tarball URL must fall under (e.g. \"https://npm.example.com/api/npm/internal/\").", + "title": "Registry", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "npm", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "version": { + "description": "Version or range to fetch (e.g. \"1.4.0\", \"^1.4\"); defaults to the latest dist-tag", + "title": "Version", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "package" + ], + "title": "Allowed Marketplaces value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Allowed Marketplaces value configuration. See the linked native reference for semantics and availability.", + "properties": { + "path": { + "description": "Local file path to marketplace.json", + "title": "Path", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "file", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "path" + ], + "title": "Allowed Marketplaces value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Allowed Marketplaces value configuration. See the linked native reference for semantics and availability.", + "properties": { + "path": { + "description": "Local directory containing .claude-plugin/marketplace.json", + "title": "Path", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "directory", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "path" + ], + "title": "Allowed Marketplaces value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Allowed Marketplaces value configuration. See the linked native reference for semantics and availability.", + "properties": { + "source": { + "const": "skills-dir", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source" + ], + "title": "Allowed Marketplaces value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Allowed Marketplaces value configuration. See the linked native reference for semantics and availability.", + "properties": { + "hostPattern": { + "description": "Regex pattern to match the host/domain extracted from any marketplace source type. For github sources, matches against github.com. For git sources (SSH or HTTPS), extracts the hostname from the URL. Use in strictKnownMarketplaces to allow all marketplaces from a specific host (e.g., \"^github\\.mycompany\\.com$\").", + "title": "Host Pattern", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "hostPattern", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "hostPattern" + ], + "title": "Allowed Marketplaces value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Allowed Marketplaces value configuration. See the linked native reference for semantics and availability.", + "properties": { + "pathPattern": { + "description": "Regex pattern matched against the .path field of file and directory sources. Use in strictKnownMarketplaces to allow filesystem-based marketplaces alongside hostPattern restrictions for network sources. Use \".*\" to allow all filesystem paths, or a narrower pattern (e.g., \"^/opt/approved/\") to restrict to specific directories.", + "title": "Path Pattern", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "pathPattern", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "pathPattern" + ], + "title": "Allowed Marketplaces value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Allowed Marketplaces value configuration. See the linked native reference for semantics and availability.", + "properties": { + "name": { + "description": "Marketplace name. Must match the extraKnownMarketplaces key (enforced); the synthetic manifest is written under this name. Same validation as PluginMarketplaceSchema plus reserved-name rejection — validateOfficialNameSource runs after the disk write, too late to clean up.", + "title": "Name", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "owner": { + "additionalProperties": false, + "description": "Owner configuration. See the linked native reference for semantics and availability.", + "properties": { + "email": { + "description": "Contact email for support or feedback", + "title": "Email", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "name": { + "description": "Display name of the plugin author or organization", + "title": "Name", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "Website, GitHub profile, or organization URL", + "title": "Url", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "name" + ], + "title": "Owner", + "type": "object", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "plugins": { + "description": "Plugin entries declared inline in settings.json", + "items": { + "additionalProperties": false, + "description": "Plugins value configuration. See the linked native reference for semantics and availability.", + "properties": { + "description": { + "description": "Description configuration. See the linked native reference for semantics and availability.", + "title": "Description", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "headers": { + "additionalProperties": { + "description": "Headers value configuration. See the linked native reference for semantics and availability.", + "title": "Headers value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "HTTP headers sent when downloading this entry's `archive` source.", + "title": "Headers", + "type": "object", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "headersHelper": { + "description": "Command that prints a JSON object of HTTP headers for downloading this entry's `archive` source. Runs only when a user explicitly installs or updates this plugin. Unlike a catalog entry, an entry written here does not need `strict: false`: it is declared in a settings file, which has no manifest fields to inline. A declaration in project settings is not operator-authored, so request-routing and client-identity header names are still filtered there. Use an absolute path.", + "title": "Headers Helper", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "name": { + "description": "Plugin name as it appears in the target repository", + "title": "Name", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "anyOf": [ + { + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "package": { + "description": "Package name (or url, or local path, or anything else that can be passed to `npm` as a package)", + "title": "Package", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "registry": { + "description": "Custom NPM registry URL (defaults to using system default, likely npmjs.org)", + "title": "Registry", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "npm", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "version": { + "description": "Specific version or version range (e.g., ^1.0.0, ~2.1.0)", + "title": "Version", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "package" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "ref": { + "description": "Git branch or tag to use (e.g., \"main\", \"v1.0.0\"). Defaults to repository default branch.", + "title": "Ref", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "sha": { + "description": "Specific commit SHA to use", + "title": "Sha", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "url", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "Full git repository URL (https:// or git\\@)", + "title": "Url", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "url" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "ref": { + "description": "Git branch or tag to use (e.g., \"main\", \"v1.0.0\"). Defaults to repository default branch.", + "title": "Ref", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "repo": { + "description": "GitHub repository in owner/repo format", + "title": "Repo", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "sha": { + "description": "Specific commit SHA to use", + "title": "Sha", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "github", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "repo" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "path": { + "description": "Subdirectory within the repo containing the plugin (e.g., \"tools/claude-plugin\"). Cloned sparsely using partial clone (--filter=tree:0) to minimize bandwidth for monorepos.", + "title": "Path", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "ref": { + "description": "Git branch or tag to use (e.g., \"main\", \"v1.0.0\"). Defaults to repository default branch.", + "title": "Ref", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "sha": { + "description": "Specific commit SHA to use", + "title": "Sha", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "git-subdir", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "Git repository: GitHub owner/repo shorthand, https://, or git\\@ URL", + "title": "Url", + "type": "string", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "url", + "path" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "sha256": { + "description": "SHA-256 digest of the archive. When set, every download is verified against it and the install is refused on mismatch. It also serves as the version identity when neither plugin.json nor the marketplace entry declares a `version`. Recommended. Note the update signal is the version string (plugin.json version, else the entry version, else this digest) — changing only the digest while a version is declared does not trigger an update.", + "title": "Sha256", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "archive", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "HTTPS URL of a zip archive containing the plugin. The plugin root (the directory holding .claude-plugin/) may be at the top of the archive or nested one directory deep — a single wrapping directory is stripped.", + "title": "Url", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "url" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "command": { + "description": "Shell command that prints the absolute path of the plugin directory on stdout (exactly one line) and exits 0. It must leave a complete plugin in that directory before exiting; the directory is copied into the plugin cache, so the printed path may change between runs (it is re-resolved on every install and update, and once per session in the background). Runs through the platform shell (sh on macOS/Linux, cmd.exe on Windows) from the user's home directory with Claude Code's subprocess environment.", + "title": "Command", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "mode": { + "description": "copy (default): the printed directory is copied into the plugin cache and content-hashed, so it may be deleted afterwards. link: the cache entry links to the printed directory in place (no copy, no size limit; macOS/Linux) — for large exports; the directory must then stay valid while Claude Code runs, and a different printed path is what signals new content.", + "enum": [ + "copy", + "link" + ], + "title": "Mode", + "type": "string", + "x-clicky-order": 20, + "x-enum-display": "segmented", + "x-enum-labels": { + "copy": "Copy", + "link": "Link" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "command", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "timeout": { + "description": "Seconds to wait for the command before giving up (default: 60)", + "title": "Timeout", + "type": "number", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "command" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "error": { + "description": "Error configuration. See the linked native reference for semantics and availability.", + "title": "Error", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "unsupported", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + ], + "description": "Where to fetch the plugin from. Must be a remote source — relative paths have no marketplace repository to resolve against.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Source", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "strict": { + "description": "Strict configuration. See the linked native reference for semantics and availability.", + "title": "Strict", + "type": "boolean", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "version": { + "description": "Version configuration. See the linked native reference for semantics and availability.", + "title": "Version", + "type": "string", + "x-clicky-order": 70, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "name", + "source" + ], + "title": "Plugins value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Plugins", + "type": "array", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "settings", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "name", + "plugins" + ], + "title": "Allowed Marketplaces value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + ], + "description": "Allowed Marketplaces value configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Allowed Marketplaces value", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Allowed Marketplaces", + "type": "array", + "x-clicky-order": 120, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "allowedMcpServers": { + "description": "Enterprise allowlist of the MCP servers users may use. Governs servers users add (user, project and local config, --mcp-config, agent frontmatter, plugins, claude.ai connectors); servers the organization itself delivers (managedMcpServers, and managed-mcp.json entries that use no ${VAR} expansion) are allowed without being listed; a managed-mcp.json entry that uses ${VAR} expansion is still checked against this list. If undefined, all servers are allowed. If empty array, users can use no servers of their own. Denylist takes precedence - if a server is on both lists, it is denied.", + "items": { + "additionalProperties": false, + "description": "Allowed MCP Servers value configuration. See the linked native reference for semantics and availability.", + "properties": { + "serverCommand": { + "description": "Command array [command, ...args] to match exactly for allowed stdio servers\n\n\\@minItems 1", + "items": { + "description": "Server Command value configuration. See the linked native reference for semantics and availability.", + "title": "Server Command value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "minItems": 1, + "title": "Server Command", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "serverName": { + "description": "Name of the MCP server that users are allowed to configure", + "title": "Server Name", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "serverUrl": { + "description": "URL pattern with wildcard support (e.g., \"https://*.example.com/*\") for allowed remote MCP servers", + "title": "Server Url", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "title": "Allowed MCP Servers value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Allowed MCP Servers", + "type": "array", + "x-clicky-order": 130, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "alwaysThinkingEnabled": { + "description": "When false, thinking is disabled. When absent or true, thinking is enabled automatically for supported models.", + "title": "Always Thinking Enabled", + "type": "boolean", + "x-clicky-order": 140, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "apiKeyHelper": { + "description": "Path to a script that outputs authentication values", + "title": "API Key Helper", + "type": "string", + "x-clicky-order": 150, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "appendPlugins": { + "description": "Managed plugins (plugin\\@marketplace ids that managed enabledPlugins sets true) whose hooks run last among plugins, innermost, in the listed order: the last id listed sits just above the built-in plugins and sees each event as every other plugin left it. Only honored from managed settings (or, on a machine with none, from user settings for your own plugins); ignored in project, local and --settings sources.", + "items": { + "description": "Append Plugins value configuration. See the linked native reference for semantics and availability.", + "title": "Append Plugins value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Append Plugins", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 160, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "askUserQuestionTimeout": { + "description": "Idle time before Claude's questions auto-continue with any answers selected so far. Defaults to never — auto-continue only runs when explicitly set to 60s/5m/10m.", + "enum": [ + "60s", + "5m", + "10m", + "never" + ], + "title": "Ask User Question Timeout", + "type": "string", + "x-clicky-order": 170, + "x-enum-display": "segmented", + "x-enum-labels": { + "10m": "10m", + "5m": "5m", + "60s": "60s", + "never": "Never" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "attribution": { + "additionalProperties": { + "description": "Attribution value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Attribution value", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "Customize attribution text for commits and PRs. Each field defaults to the standard Claude Code attribution if not set.", + "properties": { + "commit": { + "description": "Attribution text for git commits, including any trailers. Empty string hides attribution.", + "title": "Commit", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "pr": { + "description": "Attribution text for pull request descriptions. Empty string hides attribution.", + "title": "Pr", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "sessionUrl": { + "description": "Whether to append the claude.ai session link to commits and PRs created from web or Remote Control sessions (default: true). Set to false to omit the Claude-Session trailer and PR-body link.", + "title": "Session Url", + "type": "boolean", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "title": "Attribution", + "type": "object", + "x-clicky-order": 180, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "autoCompactEnabled": { + "description": "Automatically compact conversation when context fills", + "title": "Auto Compact Enabled", + "type": "boolean", + "x-clicky-order": 190, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "autoCompactWindow": { + "description": "Auto-compact window size", + "title": "Auto Compact Window", + "type": "number", + "x-clicky-order": 200, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "autoContinueAtUsageLimit": { + "description": "When a claude.ai usage limit stops your session, wait for the limit to reset and continue the task automatically. When off, the limit dialog offers the wait as a choice instead.", + "title": "Auto Continue At Usage Limit", + "type": "boolean", + "x-clicky-order": 210, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "autoDreamEnabled": { + "description": "Enable background memory consolidation (auto-dream). When set, overrides the server-side default.", + "title": "Auto Dream Enabled", + "type": "boolean", + "x-clicky-order": 220, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "autoMemoryDirectory": { + "description": "Custom directory path for auto-memory storage. Supports ~/ prefix for home directory expansion. Ignored if set in projectSettings (checked-in .claude/settings.json) for security. When unset, defaults to ~/.claude/projects/\u003csanitized-cwd\u003e/memory/.", + "title": "Auto Memory Directory", + "type": "string", + "x-clicky-order": 230, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "autoMemoryEnabled": { + "description": "Enable auto-memory for this project. When false, Claude will not read from or write to the auto-memory directory.", + "title": "Auto Memory Enabled", + "type": "boolean", + "x-clicky-order": 240, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "autoScrollEnabled": { + "description": "Auto-scroll the conversation view to bottom (fullscreen mode only)", + "title": "Auto Scroll Enabled", + "type": "boolean", + "x-clicky-order": 250, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "autoUpdatesChannel": { + "description": "Release channel for auto-updates (latest or stable)", + "enum": [ + "latest", + "stable", + "rc" + ], + "title": "Auto Updates Channel", + "type": "string", + "x-clicky-order": 260, + "x-enum-display": "segmented", + "x-enum-labels": { + "latest": "Latest", + "rc": "Rc", + "stable": "Stable" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "autoUploadSessions": { + "description": "Mirror local sessions to claude.ai as view-only (no remote control)", + "title": "Auto Upload Sessions", + "type": "boolean", + "x-clicky-order": 270, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "availableModels": { + "description": "Allowlist of models that users can select. Accepts family aliases (\"opus\" allows any opus version), version prefixes (\"opus-4-5\" allows only that version), and full model IDs. If undefined, all models are available. If empty array, only the default model is available. Typically set in managed settings by enterprise administrators.", + "items": { + "description": "Available Models value configuration. See the linked native reference for semantics and availability.", + "title": "Available Models value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Available Models", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 280, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "awsAuthRefresh": { + "description": "Path to a script that refreshes AWS authentication", + "title": "Aws Auth Refresh", + "type": "string", + "x-clicky-order": 290, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "awsCredentialExport": { + "description": "Path to a script that exports AWS credentials", + "title": "Aws Credential Export", + "type": "string", + "x-clicky-order": 300, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "bashEditDiffEnabled": { + "description": "Whether the Bash tool shows a diff of the files a Bash command changed (PostToolUse Bash hooks get the changed-file list in tool_response). Set to false to turn that off. Default: on when the Bash tool handles file edits. Only user, flag or policy settings can turn it on outside auto and bypassPermissions modes.", + "title": "Bash Edit Diff Enabled", + "type": "boolean", + "x-clicky-order": 310, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "bashOutputMaxChars": { + "description": "How many characters of a successful Bash or PowerShell command's output Claude receives inline (default 30000; values clamp to 4000-128000). Output past this is saved to a file and Claude receives a short preview plus the path. When set, this also replaces BASH_MAX_OUTPUT_LENGTH, which on its own only sizes the read-back window.", + "title": "Bash Output Max Chars", + "type": "number", + "x-clicky-order": 320, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "blockedMarketplaces": { + "description": "Enterprise blocklist of marketplace sources. When set in managed settings, these sources are blocked from being added as marketplaces. Entries match exactly, except that a github entry may use the owner-wildcard form {\"source\":\"github\",\"repo\":\"owner/*\"} to block every repository under that owner. The check happens BEFORE downloading, so blocked sources never touch the filesystem.", + "items": { + "anyOf": [ + { + "additionalProperties": false, + "description": "Blocked Marketplaces value configuration. See the linked native reference for semantics and availability.", + "properties": { + "headers": { + "additionalProperties": { + "description": "Headers value configuration. See the linked native reference for semantics and availability.", + "title": "Headers value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "Custom HTTP headers (e.g., for authentication)", + "title": "Headers", + "type": "object", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "headersHelper": { + "description": "Command that prints a JSON object of HTTP headers (e.g. a short-lived auth token). Its output overrides `headers` and, like `headers`, is inherited by same-origin archive downloads from this marketplace. Runs from a fixed directory (the Claude config home, never the session's), so give a bare command found via PATH or an absolute path; it is re-run on later refreshes of this marketplace.", + "title": "Headers Helper", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "url", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "Direct URL to marketplace.json file", + "title": "Url", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "url" + ], + "title": "Blocked Marketplaces value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Blocked Marketplaces value configuration. See the linked native reference for semantics and availability.", + "properties": { + "path": { + "description": "Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)", + "title": "Path", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "ref": { + "description": "Git branch or tag to use (e.g., \"main\", \"v1.0.0\"). Defaults to repository default branch.", + "title": "Ref", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "repo": { + "description": "GitHub repository in owner/repo format. ONLY in the managed-settings policy lists (strictKnownMarketplaces / blockedMarketplaces) the owner-wildcard form \"owner/*\" matches every repository under exactly that owner. Everywhere else (marketplace add, extraKnownMarketplaces, known_marketplaces.json) the value must name a single repository — a wildcard is taken literally and fails to clone.", + "title": "Repo", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "skipLfs": { + "description": "Has no effect; accepted so existing settings keep working. Claude Code's own git never downloads Git LFS content: LFS-tracked files in the marketplace repository are checked out as pointer files whether or not this is set, and adding or updating the marketplace says how many were. To fetch their content, run `git lfs pull` in the marketplace's checkout under ~/.claude/plugins/marketplaces/.", + "title": "Skip Lfs", + "type": "boolean", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "github", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "sparsePaths": { + "description": "Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [\".claude-plugin\", \"plugins\"]. If omitted, the full repository is cloned.", + "items": { + "description": "Sparse Paths value configuration. See the linked native reference for semantics and availability.", + "title": "Sparse Paths value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Sparse Paths", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "repo" + ], + "title": "Blocked Marketplaces value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Blocked Marketplaces value configuration. See the linked native reference for semantics and availability.", + "properties": { + "path": { + "description": "Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)", + "title": "Path", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "ref": { + "description": "Git branch or tag to use (e.g., \"main\", \"v1.0.0\"). Defaults to repository default branch.", + "title": "Ref", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "skipLfs": { + "description": "Has no effect; accepted so existing settings keep working. Claude Code's own git never downloads Git LFS content: LFS-tracked files in the marketplace repository are checked out as pointer files whether or not this is set, and adding or updating the marketplace says how many were. To fetch their content, run `git lfs pull` in the marketplace's checkout under ~/.claude/plugins/marketplaces/.", + "title": "Skip Lfs", + "type": "boolean", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "git", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "sparsePaths": { + "description": "Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [\".claude-plugin\", \"plugins\"]. If omitted, the full repository is cloned.", + "items": { + "description": "Sparse Paths value configuration. See the linked native reference for semantics and availability.", + "title": "Sparse Paths value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Sparse Paths", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "Full git repository URL", + "title": "Url", + "type": "string", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "url" + ], + "title": "Blocked Marketplaces value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Blocked Marketplaces value configuration. See the linked native reference for semantics and availability.", + "properties": { + "package": { + "description": "npm package containing marketplace.json (e.g. \"\\@acme/claude-marketplace\"). In strictKnownMarketplaces / blockedMarketplaces an entry also governs plugins installed straight from the npm marketplace (`\u003cpackage\u003e\\@npm`): an exact package name matches that package, and \"\\@acme/*\" matches every package under the scope.", + "title": "Package", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "registry": { + "description": "Registry URL. When adding a marketplace: a one-off registry override (otherwise your npm configuration decides). In a policy entry: the origin and path prefix the package's RESOLVED tarball URL must fall under (e.g. \"https://npm.example.com/api/npm/internal/\").", + "title": "Registry", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "npm", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "version": { + "description": "Version or range to fetch (e.g. \"1.4.0\", \"^1.4\"); defaults to the latest dist-tag", + "title": "Version", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "package" + ], + "title": "Blocked Marketplaces value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Blocked Marketplaces value configuration. See the linked native reference for semantics and availability.", + "properties": { + "path": { + "description": "Local file path to marketplace.json", + "title": "Path", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "file", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "path" + ], + "title": "Blocked Marketplaces value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Blocked Marketplaces value configuration. See the linked native reference for semantics and availability.", + "properties": { + "path": { + "description": "Local directory containing .claude-plugin/marketplace.json", + "title": "Path", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "directory", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "path" + ], + "title": "Blocked Marketplaces value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Blocked Marketplaces value configuration. See the linked native reference for semantics and availability.", + "properties": { + "source": { + "const": "skills-dir", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source" + ], + "title": "Blocked Marketplaces value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Blocked Marketplaces value configuration. See the linked native reference for semantics and availability.", + "properties": { + "hostPattern": { + "description": "Regex pattern to match the host/domain extracted from any marketplace source type. For github sources, matches against github.com. For git sources (SSH or HTTPS), extracts the hostname from the URL. Use in strictKnownMarketplaces to allow all marketplaces from a specific host (e.g., \"^github\\.mycompany\\.com$\").", + "title": "Host Pattern", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "hostPattern", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "hostPattern" + ], + "title": "Blocked Marketplaces value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Blocked Marketplaces value configuration. See the linked native reference for semantics and availability.", + "properties": { + "pathPattern": { + "description": "Regex pattern matched against the .path field of file and directory sources. Use in strictKnownMarketplaces to allow filesystem-based marketplaces alongside hostPattern restrictions for network sources. Use \".*\" to allow all filesystem paths, or a narrower pattern (e.g., \"^/opt/approved/\") to restrict to specific directories.", + "title": "Path Pattern", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "pathPattern", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "pathPattern" + ], + "title": "Blocked Marketplaces value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Blocked Marketplaces value configuration. See the linked native reference for semantics and availability.", + "properties": { + "name": { + "description": "Marketplace name. Must match the extraKnownMarketplaces key (enforced); the synthetic manifest is written under this name. Same validation as PluginMarketplaceSchema plus reserved-name rejection — validateOfficialNameSource runs after the disk write, too late to clean up.", + "title": "Name", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "owner": { + "additionalProperties": false, + "description": "Owner configuration. See the linked native reference for semantics and availability.", + "properties": { + "email": { + "description": "Contact email for support or feedback", + "title": "Email", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "name": { + "description": "Display name of the plugin author or organization", + "title": "Name", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "Website, GitHub profile, or organization URL", + "title": "Url", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "name" + ], + "title": "Owner", + "type": "object", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "plugins": { + "description": "Plugin entries declared inline in settings.json", + "items": { + "additionalProperties": false, + "description": "Plugins value configuration. See the linked native reference for semantics and availability.", + "properties": { + "description": { + "description": "Description configuration. See the linked native reference for semantics and availability.", + "title": "Description", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "headers": { + "additionalProperties": { + "description": "Headers value configuration. See the linked native reference for semantics and availability.", + "title": "Headers value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "HTTP headers sent when downloading this entry's `archive` source.", + "title": "Headers", + "type": "object", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "headersHelper": { + "description": "Command that prints a JSON object of HTTP headers for downloading this entry's `archive` source. Runs only when a user explicitly installs or updates this plugin. Unlike a catalog entry, an entry written here does not need `strict: false`: it is declared in a settings file, which has no manifest fields to inline. A declaration in project settings is not operator-authored, so request-routing and client-identity header names are still filtered there. Use an absolute path.", + "title": "Headers Helper", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "name": { + "description": "Plugin name as it appears in the target repository", + "title": "Name", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "anyOf": [ + { + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "package": { + "description": "Package name (or url, or local path, or anything else that can be passed to `npm` as a package)", + "title": "Package", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "registry": { + "description": "Custom NPM registry URL (defaults to using system default, likely npmjs.org)", + "title": "Registry", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "npm", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "version": { + "description": "Specific version or version range (e.g., ^1.0.0, ~2.1.0)", + "title": "Version", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "package" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "ref": { + "description": "Git branch or tag to use (e.g., \"main\", \"v1.0.0\"). Defaults to repository default branch.", + "title": "Ref", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "sha": { + "description": "Specific commit SHA to use", + "title": "Sha", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "url", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "Full git repository URL (https:// or git\\@)", + "title": "Url", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "url" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "ref": { + "description": "Git branch or tag to use (e.g., \"main\", \"v1.0.0\"). Defaults to repository default branch.", + "title": "Ref", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "repo": { + "description": "GitHub repository in owner/repo format", + "title": "Repo", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "sha": { + "description": "Specific commit SHA to use", + "title": "Sha", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "github", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "repo" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "path": { + "description": "Subdirectory within the repo containing the plugin (e.g., \"tools/claude-plugin\"). Cloned sparsely using partial clone (--filter=tree:0) to minimize bandwidth for monorepos.", + "title": "Path", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "ref": { + "description": "Git branch or tag to use (e.g., \"main\", \"v1.0.0\"). Defaults to repository default branch.", + "title": "Ref", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "sha": { + "description": "Specific commit SHA to use", + "title": "Sha", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "git-subdir", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "Git repository: GitHub owner/repo shorthand, https://, or git\\@ URL", + "title": "Url", + "type": "string", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "url", + "path" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "sha256": { + "description": "SHA-256 digest of the archive. When set, every download is verified against it and the install is refused on mismatch. It also serves as the version identity when neither plugin.json nor the marketplace entry declares a `version`. Recommended. Note the update signal is the version string (plugin.json version, else the entry version, else this digest) — changing only the digest while a version is declared does not trigger an update.", + "title": "Sha256", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "archive", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "HTTPS URL of a zip archive containing the plugin. The plugin root (the directory holding .claude-plugin/) may be at the top of the archive or nested one directory deep — a single wrapping directory is stripped.", + "title": "Url", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "url" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "command": { + "description": "Shell command that prints the absolute path of the plugin directory on stdout (exactly one line) and exits 0. It must leave a complete plugin in that directory before exiting; the directory is copied into the plugin cache, so the printed path may change between runs (it is re-resolved on every install and update, and once per session in the background). Runs through the platform shell (sh on macOS/Linux, cmd.exe on Windows) from the user's home directory with Claude Code's subprocess environment.", + "title": "Command", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "mode": { + "description": "copy (default): the printed directory is copied into the plugin cache and content-hashed, so it may be deleted afterwards. link: the cache entry links to the printed directory in place (no copy, no size limit; macOS/Linux) — for large exports; the directory must then stay valid while Claude Code runs, and a different printed path is what signals new content.", + "enum": [ + "copy", + "link" + ], + "title": "Mode", + "type": "string", + "x-clicky-order": 20, + "x-enum-display": "segmented", + "x-enum-labels": { + "copy": "Copy", + "link": "Link" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "command", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "timeout": { + "description": "Seconds to wait for the command before giving up (default: 60)", + "title": "Timeout", + "type": "number", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "command" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "error": { + "description": "Error configuration. See the linked native reference for semantics and availability.", + "title": "Error", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "unsupported", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + ], + "description": "Where to fetch the plugin from. Must be a remote source — relative paths have no marketplace repository to resolve against.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Source", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "strict": { + "description": "Strict configuration. See the linked native reference for semantics and availability.", + "title": "Strict", + "type": "boolean", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "version": { + "description": "Version configuration. See the linked native reference for semantics and availability.", + "title": "Version", + "type": "string", + "x-clicky-order": 70, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "name", + "source" + ], + "title": "Plugins value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Plugins", + "type": "array", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "settings", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "name", + "plugins" + ], + "title": "Blocked Marketplaces value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + ], + "description": "Blocked Marketplaces value configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Blocked Marketplaces value", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Blocked Marketplaces", + "type": "array", + "x-clicky-order": 330, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "channelsEnabled": { + "description": "Managed-org opt-in for channel notifications (MCP servers with the claude/channel capability pushing inbound messages). claude.ai Teams/Enterprise: default off. Console: default on unless managed settings exist. Set true to allow; users then select servers via --channels.", + "title": "Channels Enabled", + "type": "boolean", + "x-clicky-order": 340, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "claudeMd": { + "description": "CLAUDE.md-style instructions injected as organization-managed memory. Only honored from managed/policy settings.", + "title": "Claude Md", + "type": "string", + "x-clicky-order": 350, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "claudeMdExcludes": { + "description": "Glob patterns or absolute paths of CLAUDE.md files to exclude from loading. Patterns are matched against absolute file paths using picomatch. Only applies to User, Project, and Local memory types (Managed/policy files cannot be excluded). Examples: \"/home/user/monorepo/CLAUDE.md\", \"** /code/CLAUDE.md\", \"** /some-dir/.claude/rules/**\"", + "items": { + "description": "Claude Md Excludes value configuration. See the linked native reference for semantics and availability.", + "title": "Claude Md Excludes value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Claude Md Excludes", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 360, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "cleanupPeriodDays": { + "description": "Number of days to retain chat transcripts before automatic cleanup (default: 30). Minimum 1. Use a large value for long retention; use --no-session-persistence to disable transcript writes entirely.", + "title": "Cleanup Period Days", + "type": "number", + "x-clicky-order": 370, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "companyAnnouncements": { + "description": "Company announcements to display at startup (one will be randomly selected if multiple are provided)", + "items": { + "description": "Company Announcements value configuration. See the linked native reference for semantics and availability.", + "title": "Company Announcements value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Company Announcements", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 380, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "crossSessionInbound": { + "description": "Inbound cross-session peer messages (SendMessage from your other sessions): 'accept' delivers them, 'hold' parks them for your review without letting Claude act, 'refuse' opts this session out. An explicit value always wins. Unset (mode parity): a message auto-delivers only when the sending session's permission-mode class matches yours (bypass↔bypass or prompting↔prompting); a mismatched sender's message is held for your approval; a sender that asserts no class is held only while this session bypasses permission prompts.", + "enum": [ + "accept", + "hold", + "refuse" + ], + "title": "Cross Session Inbound", + "type": "string", + "x-clicky-order": 390, + "x-enum-display": "segmented", + "x-enum-labels": { + "accept": "Accept", + "hold": "Hold", + "refuse": "Refuse" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "daemonColdStart": { + "description": "When no background service is running: 'transient' spawns one for this login session; 'ask' offers to install it persistently", + "enum": [ + "transient", + "ask" + ], + "title": "Daemon Cold Start", + "type": "string", + "x-clicky-order": 400, + "x-enum-display": "segmented", + "x-enum-labels": { + "ask": "Ask", + "transient": "Transient" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "defaultShell": { + "description": "Default shell for input-box ! commands. Defaults to 'bash' on all platforms (no Windows auto-flip).", + "enum": [ + "bash", + "powershell" + ], + "title": "Default Shell", + "type": "string", + "x-clicky-order": 410, + "x-enum-display": "segmented", + "x-enum-labels": { + "bash": "Bash", + "powershell": "Powershell" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "defaultView": { + "description": "Default transcript view: chat (SendUserMessage checkpoints only) or transcript (full)", + "enum": [ + "chat", + "transcript" + ], + "title": "Default View", + "type": "string", + "x-clicky-order": 420, + "x-enum-display": "segmented", + "x-enum-labels": { + "chat": "Chat", + "transcript": "Transcript" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "deniedMcpServers": { + "description": "Enterprise denylist of MCP servers that are explicitly blocked. If a server is on the denylist, it will be blocked across all scopes including enterprise. Denylist takes precedence over allowlist - if a server is on both lists, it is denied.", + "items": { + "additionalProperties": false, + "description": "Denied MCP Servers value configuration. See the linked native reference for semantics and availability.", + "properties": { + "serverCommand": { + "description": "Command array [command, ...args] to match exactly for blocked stdio servers\n\n\\@minItems 1", + "items": { + "description": "Server Command value configuration. See the linked native reference for semantics and availability.", + "title": "Server Command value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "minItems": 1, + "title": "Server Command", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "serverName": { + "description": "Name of the MCP server that is explicitly blocked", + "title": "Server Name", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "serverUrl": { + "description": "URL pattern with wildcard support (e.g., \"https://*.example.com/*\") for blocked remote MCP servers", + "title": "Server Url", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "title": "Denied MCP Servers value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Denied MCP Servers", + "type": "array", + "x-clicky-order": 430, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "desktopSessionCleanupPeriodDays": { + "description": "Retention ceiling in days for session transcripts created or last written by a desktop-host surface (Claude Desktop, Cowork), which are otherwise exempt from the cleanupPeriodDays sweep. 0 (the default) means no ceiling: such transcripts are kept until deleted another way. Unlike cleanupPeriodDays, 0 is allowed because this setting never disables writes — it only bounds an exemption from deletion. The ceiling is a hard cap: it also bounds an active archive grace, so the grace window of a release marker never keeps files past the ceiling. Ignored when cleanupPeriodDays is managed by org policy. A ceiling at or below cleanupPeriodDays effectively disables the exemption: those transcripts age out on the regular cleanupPeriodDays schedule, so the effective retention is whichever of the two periods is longer.", + "title": "Desktop Session Cleanup Period Days", + "type": "number", + "x-clicky-order": 440, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "dialogExpiry": { + "description": "Max time a permission/user dialog forwarded to a remote client stays parked awaiting an answer, and how long a HELD cross-session message awaits approval, before either resolves to its safe no-action default (cancelled / dropped-with-denial). Defaults to 5m to match the long-standing remote-dialog deadline; \"never\" disables the deadline. Local-only permission prompts (no remote client) are unaffected. The CLAUDE_CODE_USER_DIALOG_TIMEOUT_MS env var, when set, overrides this. Read from trusted sources only (never a checked-in repo settings file).", + "enum": [ + "60s", + "5m", + "10m", + "never" + ], + "title": "Dialog Expiry", + "type": "string", + "x-clicky-order": 450, + "x-enum-display": "segmented", + "x-enum-labels": { + "10m": "10m", + "5m": "5m", + "60s": "60s", + "never": "Never" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "disableAgentView": { + "description": "Disable agent view (`claude agents`, `--bg`, /background, the on-demand daemon). Typically set in managed settings. Equivalent to CLAUDE_CODE_DISABLE_AGENT_VIEW=1.", + "title": "Disable Agent View", + "type": "boolean", + "x-clicky-order": 460, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "disableAllHooks": { + "description": "Disable all hooks and statusLine execution: the hooks defined in settings files and by installed plugins. Features built into Claude Code are not hooks in this sense and keep working; each has its own switch.", + "title": "Disable All Hooks", + "type": "boolean", + "x-clicky-order": 470, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "disableArtifact": { + "description": "Deprecated: use enableArtifact: false. Still honored — true disables the Artifact tool; false is ignored.", + "title": "Disable Artifact", + "type": "boolean", + "x-clicky-order": 480, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "disableAutoMode": { + "const": "disable", + "description": "Disable auto mode", + "title": "Disable Auto Mode", + "type": "string", + "x-clicky-order": 490, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "disableBundledSkills": { + "description": "Disable the skills and workflows that ship with Claude Code: bundled skills and workflows are removed entirely; built-in slash commands stay typable but are hidden from the model. Plugins, .claude/skills/, and .claude/commands/ are unaffected. Equivalent to CLAUDE_CODE_DISABLE_BUNDLED_SKILLS=1.", + "title": "Disable Bundled Skills", + "type": "boolean", + "x-clicky-order": 500, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "disableClaudeAiConnectors": { + "description": "When true in any settings source, claude.ai MCP cloud connectors are not auto-fetched or connected. Only gates auto-fetched connectors — a claudeai-proxy server passed explicitly (e.g. via --mcp-config or the SDK mcpServers option) still follows the normal MCP config trust flow. Any-source-true wins: a project can opt out, but a project-level false cannot override a user-level true.", + "title": "Disable Claude Ai Connectors", + "type": "boolean", + "x-clicky-order": 510, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "disableCommandPluginSources": { + "description": "Controls the `command` plugin source, whose plugin directory is produced by running a marketplace-declared command on this machine. true: command-sourced plugins are never installed, updated, or re-resolved (the command never runs). false: explicitly allowed. Unset: follows allowManagedHooksOnly — an org that restricts hook execution to managed settings gets command sources disabled too. Only honored from managed settings.", + "title": "Disable Command Plugin Sources", + "type": "boolean", + "x-clicky-order": 520, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "disableDeepLinkRegistration": { + "const": "disable", + "description": "Prevent claude-cli:// protocol handler registration with the OS", + "title": "Disable Deep Link Registration", + "type": "string", + "x-clicky-order": 530, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "disableRemoteControl": { + "description": "Disable Remote Control (claude.ai/code, `claude remote-control`, `--remote-control`/`--rc`, auto-start, and the in-session toggle). Typically set in managed settings.", + "title": "Disable Remote Control", + "type": "boolean", + "x-clicky-order": 540, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "disableSideloadFlags": { + "description": "When true (and set in managed settings), rejects the --plugin-dir, --plugin-url, --agents, and non-sdk --mcp-config CLI flags at startup. Closes the CLI-flag bypass of strictKnownMarketplaces. Pair with allowedMcpServers for per-server MCP control; this setting does not gate other MCP entry points (SDK setMcpServers, claude mcp add, .mcp.json). Also blocks surfaces that spawn the CLI with these flags internally (see settings documentation). Only honored from managed settings; ignored in user/project/local settings.", + "title": "Disable Sideload Flags", + "type": "boolean", + "x-clicky-order": 550, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "disableSkillShellExecution": { + "description": "Disable inline shell execution in skills and custom slash commands from user, project, or plugin sources. Commands are replaced with a placeholder instead of being run.", + "title": "Disable Skill Shell Execution", + "type": "boolean", + "x-clicky-order": 560, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "disableWorkflows": { + "description": "Disable the Workflows feature (also via CLAUDE_CODE_DISABLE_WORKFLOWS).", + "title": "Disable Workflows", + "type": "boolean", + "x-clicky-order": 570, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "disabledMcpjsonServers": { + "description": "List of rejected MCP servers from .mcp.json", + "items": { + "description": "Disabled Mcpjson Servers value configuration. See the linked native reference for semantics and availability.", + "title": "Disabled Mcpjson Servers value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Disabled Mcpjson Servers", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 580, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "editorMode": { + "description": "Key binding mode for the prompt input", + "enum": [ + "normal", + "vim" + ], + "title": "Editor Mode", + "type": "string", + "x-clicky-order": 590, + "x-enum-display": "segmented", + "x-enum-labels": { + "normal": "Normal", + "vim": "Vim" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "effortLevel": { + "description": "Persisted effort level for supported models.", + "enum": [ + "low", + "medium", + "high", + "xhigh" + ], + "title": "Effort Level", + "type": "string", + "x-clicky-order": 600, + "x-enum-display": "segmented", + "x-enum-labels": { + "high": "High", + "low": "Low", + "medium": "Medium", + "xhigh": "Xhigh" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "emojiCompletionEnabled": { + "description": "When false, the :emoji: shortcode typeahead (the suggestion popup and the :name: inline replacement) is disabled. When absent or true, it is enabled.", + "title": "Emoji Completion Enabled", + "type": "boolean", + "x-clicky-order": 610, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "enableAllProjectMcpServers": { + "description": "Whether to automatically approve all MCP servers in the project", + "title": "Enable All Project MCP Servers", + "type": "boolean", + "x-clicky-order": 620, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "enableArtifact": { + "description": "Turn the Artifact tool on or off. Off in any of managed, --settings, or user settings wins; project and local settings can only turn it off. Unset defaults to on once the feature is available.", + "title": "Enable Artifact", + "type": "boolean", + "x-clicky-order": 630, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "enableWorkflows": { + "description": "Enable or disable the Workflows feature for this user. Unset = default by plan once the feature is available.", + "title": "Enable Workflows", + "type": "boolean", + "x-clicky-order": 640, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "enabledMcpjsonServers": { + "description": "List of approved MCP servers from .mcp.json", + "items": { + "description": "Enabled Mcpjson Servers value configuration. See the linked native reference for semantics and availability.", + "title": "Enabled Mcpjson Servers value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Enabled Mcpjson Servers", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 650, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "enabledPlugins": { + "additionalProperties": { + "anyOf": [ + { + "description": "Enabled Plugins value configuration. See the linked native reference for semantics and availability.", + "items": { + "description": "Enabled Plugins value value configuration. See the linked native reference for semantics and availability.", + "title": "Enabled Plugins value value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Enabled Plugins value", + "type": "array", + "x-array-display": "list", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "description": "Enabled Plugins value configuration. See the linked native reference for semantics and availability.", + "title": "Enabled Plugins value", + "type": "boolean", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": { + "description": "Enabled Plugins value value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Enabled Plugins value value", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "Enabled Plugins value configuration. See the linked native reference for semantics and availability.", + "title": "Enabled Plugins value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + ], + "description": "Enabled Plugins value configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Enabled Plugins value", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "Enabled plugins using plugin-id\\@marketplace-id format. Example: { \"formatter\\@anthropic-tools\": true }. Also supports extended format with version constraints. Settings precedence is user \u003c project \u003c local \u003c flag \u003c policy, so to disable a plugin that project settings enable, set it to false in .claude/settings.local.json — setting false in ~/.claude/settings.json is overridden by the project.", + "title": "Enabled Plugins", + "type": "object", + "x-clicky-order": 660, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "enforceAvailableModels": { + "description": "When true and availableModels is a non-empty array, the Default model selection is also constrained: if the default model for the user tier is not in availableModels, Default resolves to the first allowed availableModels entry instead. Has no effect when availableModels is unset or an empty array. Typically set in managed settings by enterprise administrators.", + "title": "Enforce Available Models", + "type": "boolean", + "x-clicky-order": 670, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "env": { + "additionalProperties": { + "description": "Env value configuration. See the linked native reference for semantics and availability.", + "title": "Env value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "Environment variables to set for Claude Code sessions", + "title": "Env", + "type": "object", + "x-clicky-order": 680, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "extraKnownMarketplaces": { + "additionalProperties": { + "additionalProperties": false, + "description": "Extra Known Marketplaces value configuration. See the linked native reference for semantics and availability.", + "properties": { + "autoUpdate": { + "description": "Whether to automatically update this marketplace and its installed plugins on startup", + "title": "Auto Update", + "type": "boolean", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "installLocation": { + "description": "Local cache path where marketplace manifest is stored (auto-generated if not provided)", + "title": "Install Location", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "anyOf": [ + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "headers": { + "additionalProperties": { + "description": "Headers value configuration. See the linked native reference for semantics and availability.", + "title": "Headers value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "Custom HTTP headers (e.g., for authentication)", + "title": "Headers", + "type": "object", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "headersHelper": { + "description": "Command that prints a JSON object of HTTP headers (e.g. a short-lived auth token). Its output overrides `headers` and, like `headers`, is inherited by same-origin archive downloads from this marketplace. Runs from a fixed directory (the Claude config home, never the session's), so give a bare command found via PATH or an absolute path; it is re-run on later refreshes of this marketplace.", + "title": "Headers Helper", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "url", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "Direct URL to marketplace.json file", + "title": "Url", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "url" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "path": { + "description": "Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)", + "title": "Path", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "ref": { + "description": "Git branch or tag to use (e.g., \"main\", \"v1.0.0\"). Defaults to repository default branch.", + "title": "Ref", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "repo": { + "description": "GitHub repository in owner/repo format. ONLY in the managed-settings policy lists (strictKnownMarketplaces / blockedMarketplaces) the owner-wildcard form \"owner/*\" matches every repository under exactly that owner. Everywhere else (marketplace add, extraKnownMarketplaces, known_marketplaces.json) the value must name a single repository — a wildcard is taken literally and fails to clone.", + "title": "Repo", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "skipLfs": { + "description": "Has no effect; accepted so existing settings keep working. Claude Code's own git never downloads Git LFS content: LFS-tracked files in the marketplace repository are checked out as pointer files whether or not this is set, and adding or updating the marketplace says how many were. To fetch their content, run `git lfs pull` in the marketplace's checkout under ~/.claude/plugins/marketplaces/.", + "title": "Skip Lfs", + "type": "boolean", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "github", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "sparsePaths": { + "description": "Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [\".claude-plugin\", \"plugins\"]. If omitted, the full repository is cloned.", + "items": { + "description": "Sparse Paths value configuration. See the linked native reference for semantics and availability.", + "title": "Sparse Paths value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Sparse Paths", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "repo" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "path": { + "description": "Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)", + "title": "Path", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "ref": { + "description": "Git branch or tag to use (e.g., \"main\", \"v1.0.0\"). Defaults to repository default branch.", + "title": "Ref", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "skipLfs": { + "description": "Has no effect; accepted so existing settings keep working. Claude Code's own git never downloads Git LFS content: LFS-tracked files in the marketplace repository are checked out as pointer files whether or not this is set, and adding or updating the marketplace says how many were. To fetch their content, run `git lfs pull` in the marketplace's checkout under ~/.claude/plugins/marketplaces/.", + "title": "Skip Lfs", + "type": "boolean", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "git", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "sparsePaths": { + "description": "Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [\".claude-plugin\", \"plugins\"]. If omitted, the full repository is cloned.", + "items": { + "description": "Sparse Paths value configuration. See the linked native reference for semantics and availability.", + "title": "Sparse Paths value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Sparse Paths", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "Full git repository URL", + "title": "Url", + "type": "string", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "url" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "package": { + "description": "npm package containing marketplace.json (e.g. \"\\@acme/claude-marketplace\"). In strictKnownMarketplaces / blockedMarketplaces an entry also governs plugins installed straight from the npm marketplace (`\u003cpackage\u003e\\@npm`): an exact package name matches that package, and \"\\@acme/*\" matches every package under the scope.", + "title": "Package", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "registry": { + "description": "Registry URL. When adding a marketplace: a one-off registry override (otherwise your npm configuration decides). In a policy entry: the origin and path prefix the package's RESOLVED tarball URL must fall under (e.g. \"https://npm.example.com/api/npm/internal/\").", + "title": "Registry", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "npm", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "version": { + "description": "Version or range to fetch (e.g. \"1.4.0\", \"^1.4\"); defaults to the latest dist-tag", + "title": "Version", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "package" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "path": { + "description": "Local file path to marketplace.json", + "title": "Path", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "file", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "path" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "path": { + "description": "Local directory containing .claude-plugin/marketplace.json", + "title": "Path", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "directory", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "path" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "source": { + "const": "skills-dir", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "hostPattern": { + "description": "Regex pattern to match the host/domain extracted from any marketplace source type. For github sources, matches against github.com. For git sources (SSH or HTTPS), extracts the hostname from the URL. Use in strictKnownMarketplaces to allow all marketplaces from a specific host (e.g., \"^github\\.mycompany\\.com$\").", + "title": "Host Pattern", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "hostPattern", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "hostPattern" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "pathPattern": { + "description": "Regex pattern matched against the .path field of file and directory sources. Use in strictKnownMarketplaces to allow filesystem-based marketplaces alongside hostPattern restrictions for network sources. Use \".*\" to allow all filesystem paths, or a narrower pattern (e.g., \"^/opt/approved/\") to restrict to specific directories.", + "title": "Path Pattern", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "pathPattern", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "pathPattern" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "name": { + "description": "Marketplace name. Must match the extraKnownMarketplaces key (enforced); the synthetic manifest is written under this name. Same validation as PluginMarketplaceSchema plus reserved-name rejection — validateOfficialNameSource runs after the disk write, too late to clean up.", + "title": "Name", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "owner": { + "additionalProperties": false, + "description": "Owner configuration. See the linked native reference for semantics and availability.", + "properties": { + "email": { + "description": "Contact email for support or feedback", + "title": "Email", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "name": { + "description": "Display name of the plugin author or organization", + "title": "Name", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "Website, GitHub profile, or organization URL", + "title": "Url", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "name" + ], + "title": "Owner", + "type": "object", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "plugins": { + "description": "Plugin entries declared inline in settings.json", + "items": { + "additionalProperties": false, + "description": "Plugins value configuration. See the linked native reference for semantics and availability.", + "properties": { + "description": { + "description": "Description configuration. See the linked native reference for semantics and availability.", + "title": "Description", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "headers": { + "additionalProperties": { + "description": "Headers value configuration. See the linked native reference for semantics and availability.", + "title": "Headers value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "HTTP headers sent when downloading this entry's `archive` source.", + "title": "Headers", + "type": "object", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "headersHelper": { + "description": "Command that prints a JSON object of HTTP headers for downloading this entry's `archive` source. Runs only when a user explicitly installs or updates this plugin. Unlike a catalog entry, an entry written here does not need `strict: false`: it is declared in a settings file, which has no manifest fields to inline. A declaration in project settings is not operator-authored, so request-routing and client-identity header names are still filtered there. Use an absolute path.", + "title": "Headers Helper", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "name": { + "description": "Plugin name as it appears in the target repository", + "title": "Name", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "anyOf": [ + { + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "package": { + "description": "Package name (or url, or local path, or anything else that can be passed to `npm` as a package)", + "title": "Package", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "registry": { + "description": "Custom NPM registry URL (defaults to using system default, likely npmjs.org)", + "title": "Registry", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "npm", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "version": { + "description": "Specific version or version range (e.g., ^1.0.0, ~2.1.0)", + "title": "Version", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "package" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "ref": { + "description": "Git branch or tag to use (e.g., \"main\", \"v1.0.0\"). Defaults to repository default branch.", + "title": "Ref", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "sha": { + "description": "Specific commit SHA to use", + "title": "Sha", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "url", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "Full git repository URL (https:// or git\\@)", + "title": "Url", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "url" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "ref": { + "description": "Git branch or tag to use (e.g., \"main\", \"v1.0.0\"). Defaults to repository default branch.", + "title": "Ref", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "repo": { + "description": "GitHub repository in owner/repo format", + "title": "Repo", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "sha": { + "description": "Specific commit SHA to use", + "title": "Sha", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "github", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "repo" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "path": { + "description": "Subdirectory within the repo containing the plugin (e.g., \"tools/claude-plugin\"). Cloned sparsely using partial clone (--filter=tree:0) to minimize bandwidth for monorepos.", + "title": "Path", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "ref": { + "description": "Git branch or tag to use (e.g., \"main\", \"v1.0.0\"). Defaults to repository default branch.", + "title": "Ref", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "sha": { + "description": "Specific commit SHA to use", + "title": "Sha", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "git-subdir", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "Git repository: GitHub owner/repo shorthand, https://, or git\\@ URL", + "title": "Url", + "type": "string", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "url", + "path" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "sha256": { + "description": "SHA-256 digest of the archive. When set, every download is verified against it and the install is refused on mismatch. It also serves as the version identity when neither plugin.json nor the marketplace entry declares a `version`. Recommended. Note the update signal is the version string (plugin.json version, else the entry version, else this digest) — changing only the digest while a version is declared does not trigger an update.", + "title": "Sha256", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "archive", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "HTTPS URL of a zip archive containing the plugin. The plugin root (the directory holding .claude-plugin/) may be at the top of the archive or nested one directory deep — a single wrapping directory is stripped.", + "title": "Url", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "url" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "command": { + "description": "Shell command that prints the absolute path of the plugin directory on stdout (exactly one line) and exits 0. It must leave a complete plugin in that directory before exiting; the directory is copied into the plugin cache, so the printed path may change between runs (it is re-resolved on every install and update, and once per session in the background). Runs through the platform shell (sh on macOS/Linux, cmd.exe on Windows) from the user's home directory with Claude Code's subprocess environment.", + "title": "Command", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "mode": { + "description": "copy (default): the printed directory is copied into the plugin cache and content-hashed, so it may be deleted afterwards. link: the cache entry links to the printed directory in place (no copy, no size limit; macOS/Linux) — for large exports; the directory must then stay valid while Claude Code runs, and a different printed path is what signals new content.", + "enum": [ + "copy", + "link" + ], + "title": "Mode", + "type": "string", + "x-clicky-order": 20, + "x-enum-display": "segmented", + "x-enum-labels": { + "copy": "Copy", + "link": "Link" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "command", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "timeout": { + "description": "Seconds to wait for the command before giving up (default: 60)", + "title": "Timeout", + "type": "number", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "command" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "error": { + "description": "Error configuration. See the linked native reference for semantics and availability.", + "title": "Error", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "unsupported", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + ], + "description": "Where to fetch the plugin from. Must be a remote source — relative paths have no marketplace repository to resolve against.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Source", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "strict": { + "description": "Strict configuration. See the linked native reference for semantics and availability.", + "title": "Strict", + "type": "boolean", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "version": { + "description": "Version configuration. See the linked native reference for semantics and availability.", + "title": "Version", + "type": "string", + "x-clicky-order": 70, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "name", + "source" + ], + "title": "Plugins value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Plugins", + "type": "array", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "settings", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "name", + "plugins" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + ], + "description": "Where to fetch the marketplace from", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Source", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source" + ], + "title": "Extra Known Marketplaces value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "Additional marketplaces to make available for this repository. Typically used in repository .claude/settings.json to ensure team members have required plugin sources.", + "title": "Extra Known Marketplaces", + "type": "object", + "x-clicky-order": 690, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "fallbackModel": { + "description": "Fallback model(s) tried in order when the primary model is overloaded or unavailable. Each element accepts a model name or alias; \"default\" expands to the default model. CLI --fallback-model takes precedence.", + "items": { + "description": "Fallback Model value configuration. See the linked native reference for semantics and availability.", + "title": "Fallback Model value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Fallback Model", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 700, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "fastMode": { + "description": "When true, fast mode is enabled. When absent or false, fast mode is off.", + "title": "Fast Mode", + "type": "boolean", + "x-clicky-order": 710, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "fastModePerSessionOptIn": { + "description": "When true, fast mode does not persist across sessions. Each session starts with fast mode off.", + "title": "Fast Mode Per Session Opt In", + "type": "boolean", + "x-clicky-order": 720, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "feedbackDrafts": { + "description": "Model-drafted feedback (the SendFeedback tool). \"notify\" (default) shows a one-line notice when a draft is queued; \"quiet\" shows only the footer counter; \"off\" disables the tool entirely so drafts are never queued.", + "enum": [ + "notify", + "quiet", + "off" + ], + "title": "Feedback Drafts", + "type": "string", + "x-clicky-order": 730, + "x-enum-display": "segmented", + "x-enum-labels": { + "notify": "Notify", + "off": "Off", + "quiet": "Quiet" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "feedbackSurveyRate": { + "description": "Probability (0–1) that the session quality survey appears when eligible. 0.05 is a reasonable starting point.", + "title": "Feedback Survey Rate", + "type": "number", + "x-clicky-order": 740, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "fileCheckpointingEnabled": { + "description": "Snapshot files before edits so /rewind can restore them", + "title": "File Checkpointing Enabled", + "type": "boolean", + "x-clicky-order": 750, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "fileSuggestion": { + "additionalProperties": false, + "description": "Custom file suggestion configuration for \\@ mentions", + "properties": { + "command": { + "description": "Command configuration. See the linked native reference for semantics and availability.", + "title": "Command", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "command", + "description": "Type configuration. See the linked native reference for semantics and availability.", + "title": "Type", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type", + "command" + ], + "title": "File Suggestion", + "type": "object", + "x-clicky-order": 760, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "footerLinksRegexes": { + "description": "Extra clickable footer badges that appear when a regex matches turn output (tool results and assistant responses). Read from user, flag, and managed settings only; ignored in project .claude/settings.json and local .claude/settings.local.json. At most 5 badges render; the oldest is displaced by newer matches and /clear removes them. Use to surface IDs printed by project CLIs as session links.", + "items": { + "anyOf": [ + { + "additionalProperties": { + "description": "Footer Links Regexes value value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Footer Links Regexes value value", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "Footer Links Regexes value configuration. See the linked native reference for semantics and availability.", + "properties": { + "label": { + "description": "Badge text. {name} placeholders filled from named capture groups; defaults to the full match.", + "title": "Label", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "pattern": { + "description": "Regex matched against turn output (tool results and assistant text)", + "title": "Pattern", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "regex", + "description": "Config variant. This client understands \"regex\": matches turn output and builds a URL from named capture groups. Entries with other variants are preserved but skipped at runtime.", + "title": "Type", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "Link target. {name} placeholders are filled from named regex capture groups, e.g. (?\u003cid\u003e...) -\u003e {id}. Values are URL-encoded; the origin must be literal in the template. The scheme must be https, http, or a recognized editor or workspace deep-link scheme: vscode, vscode-insiders, cursor, windsurf, zed, jetbrains, idea, slack, linear, notion, figma.", + "title": "Url", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type", + "pattern", + "url" + ], + "title": "Footer Links Regexes value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": { + "description": "Footer Links Regexes value value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Footer Links Regexes value value", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "Footer Links Regexes value configuration. See the linked native reference for semantics and availability.", + "properties": { + "type": { + "description": "Config variant discriminator for entries this client does not understand; the entry is preserved as-is and skipped at runtime.", + "title": "Type", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type" + ], + "title": "Footer Links Regexes value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + ], + "description": "Footer Links Regexes value configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Footer Links Regexes value", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Footer Links Regexes", + "type": "array", + "x-clicky-order": 770, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "forceLoginGatewayUrl": { + "description": "Cloud gateway URL to pre-fill and auto-connect to during login, alongside forceLoginMethod: \"gateway\". Honored only from admin-controlled managed settings (MDM / managed-settings.json / policy helper); ignored in user, project, and remote-delivered settings.", + "title": "Force Login Gateway Url", + "type": "string", + "x-clicky-order": 780, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "forceLoginMethod": { + "description": "Force a specific login method: \"claudeai\" for Claude Pro/Max, \"console\" for Console billing, \"gateway\" for the Cloud gateway OIDC device flow", + "enum": [ + "claudeai", + "console", + "gateway" + ], + "title": "Force Login Method", + "type": "string", + "x-clicky-order": 790, + "x-enum-display": "segmented", + "x-enum-labels": { + "claudeai": "Claudeai", + "console": "Console", + "gateway": "Gateway" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "forceLoginOrgUUID": { + "anyOf": [ + { + "description": "Force Login Org UUID configuration. See the linked native reference for semantics and availability.", + "title": "Force Login Org UUID", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "description": "Force Login Org UUID configuration. See the linked native reference for semantics and availability.", + "items": { + "description": "Force Login Org UUID value configuration. See the linked native reference for semantics and availability.", + "title": "Force Login Org UUID value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Force Login Org UUID", + "type": "array", + "x-array-display": "list", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + ], + "description": "Organization UUID to require for OAuth login. Accepts a single UUID string or an array of UUIDs (any one is permitted). When set in managed settings, login fails if the authenticated account does not belong to a listed organization.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Force Login Org UUID", + "x-clicky-order": 800, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "forceRemoteSettingsRefresh": { + "description": "When set in managed settings, the CLI blocks startup until remote managed settings are freshly fetched, and exits if the fetch fails", + "title": "Force Remote Settings Refresh", + "type": "boolean", + "x-clicky-order": 810, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "gatewayInternalNetworks": { + "description": "IPv4 CIDR blocks (at most 4, each /8 to /32, not overlapping) your Cloud gateway sits in: the public block your organization numbers its internal network from, which lets /login reach a gateway there. A block must lie entirely outside private space, where /login accepts a gateway without this key. /login accepts a gateway inside a listed block over a direct connection only, and only when this machine's own address on that connection is inside the same block, so /login must happen from a machine whose own address is inside the block (not through a proxy, VPN pool, container or NAT segment outside it). A bar against copied settings files, not proof of location. Honored only from admin-controlled managed settings (MDM / managed-settings.json / policy helper); ignored in user, project, and remote-delivered settings.", + "items": { + "description": "Gateway Internal Networks value configuration. See the linked native reference for semantics and availability.", + "title": "Gateway Internal Networks value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Gateway Internal Networks", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 820, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "gcpAuthRefresh": { + "description": "Command to refresh GCP authentication (e.g., gcloud auth application-default login)", + "title": "Gcp Auth Refresh", + "type": "string", + "x-clicky-order": 830, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "hooks": { + "additionalProperties": { + "description": "Hooks value configuration. See the linked native reference for semantics and availability.", + "items": { + "additionalProperties": false, + "description": "Hooks value value configuration. See the linked native reference for semantics and availability.", + "properties": { + "hooks": { + "description": "List of hooks to execute when the matcher matches", + "items": { + "anyOf": [ + { + "additionalProperties": false, + "description": "Hooks value configuration. See the linked native reference for semantics and availability.", + "properties": { + "args": { + "description": "Argument list for exec form. When present, `command` is resolved as an executable and spawned directly with these arguments — no shell. Path placeholders like ${CLAUDE_PLUGIN_ROOT} are substituted per-element as plain strings, so paths with quotes, $, or backticks never reach a shell parser. When absent, `command` runs through a shell (bash on POSIX, PowerShell on Windows without Git Bash).", + "items": { + "description": "Args value configuration. See the linked native reference for semantics and availability.", + "title": "Args value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Args", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "async": { + "description": "If true, hook runs in background without blocking", + "title": "Async", + "type": "boolean", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "asyncRewake": { + "description": "If true, hook runs in background and wakes the model on exit code 2 (blocking error). Implies async.", + "title": "Async Rewake", + "type": "boolean", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "command": { + "description": "Shell command to execute", + "title": "Command", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "if": { + "description": "Permission rule syntax to filter when this hook runs (e.g., \"Bash(git *)\"). Only runs if the tool call matches the pattern. Avoids spawning hooks for non-matching commands.", + "title": "If", + "type": "string", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "once": { + "description": "If true, hook runs once and is removed after execution", + "title": "Once", + "type": "boolean", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "shell": { + "description": "Shell interpreter. 'bash' uses your $SHELL (bash/zsh/sh); 'powershell' uses pwsh. Defaults to bash (powershell on Windows without Git Bash).", + "enum": [ + "bash", + "powershell" + ], + "title": "Shell", + "type": "string", + "x-clicky-order": 70, + "x-enum-display": "segmented", + "x-enum-labels": { + "bash": "Bash", + "powershell": "Powershell" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "statusMessage": { + "description": "Custom status message to display in spinner while hook runs", + "title": "Status Message", + "type": "string", + "x-clicky-order": 80, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "timeout": { + "description": "Timeout in seconds for this specific command", + "title": "Timeout", + "type": "number", + "x-clicky-order": 90, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "command", + "description": "Shell command hook type", + "title": "Type", + "type": "string", + "x-clicky-order": 100, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type", + "command" + ], + "title": "Hooks value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Hooks value configuration. See the linked native reference for semantics and availability.", + "properties": { + "continueOnBlock": { + "description": "Sets the continue value for the decision:\"block\" produced when ok is false. Default false (turn ends). Whether continue:true lets the turn proceed depends on the event's decision:\"block\" semantics. On PostToolUse, the reason is fed back to Claude and the turn continues.", + "title": "Continue On Block", + "type": "boolean", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "if": { + "description": "Permission rule syntax to filter when this hook runs (e.g., \"Bash(git *)\"). Only runs if the tool call matches the pattern. Avoids spawning hooks for non-matching commands.", + "title": "If", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "model": { + "description": "Model to use for this prompt hook (e.g., \"claude-sonnet-5\"). If not specified, uses the default small fast model.", + "title": "Model", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "once": { + "description": "If true, hook runs once and is removed after execution", + "title": "Once", + "type": "boolean", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "prompt": { + "description": "Prompt to evaluate with LLM. Use $ARGUMENTS placeholder for hook input JSON.", + "title": "Prompt", + "type": "string", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "statusMessage": { + "description": "Custom status message to display in spinner while hook runs", + "title": "Status Message", + "type": "string", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "timeout": { + "description": "Timeout in seconds for this specific prompt evaluation", + "title": "Timeout", + "type": "number", + "x-clicky-order": 70, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "prompt", + "description": "LLM prompt hook type", + "title": "Type", + "type": "string", + "x-clicky-order": 80, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type", + "prompt" + ], + "title": "Hooks value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Hooks value configuration. See the linked native reference for semantics and availability.", + "properties": { + "if": { + "description": "Permission rule syntax to filter when this hook runs (e.g., \"Bash(git *)\"). Only runs if the tool call matches the pattern. Avoids spawning hooks for non-matching commands.", + "title": "If", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "model": { + "description": "Model to use for this agent hook (e.g., \"claude-sonnet-5\"). If not specified, uses Haiku.", + "title": "Model", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "once": { + "description": "If true, hook runs once and is removed after execution", + "title": "Once", + "type": "boolean", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "prompt": { + "description": "Prompt describing what to verify (e.g. \"Verify that unit tests ran and passed.\"). Use $ARGUMENTS placeholder for hook input JSON.", + "title": "Prompt", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "statusMessage": { + "description": "Custom status message to display in spinner while hook runs", + "title": "Status Message", + "type": "string", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "timeout": { + "description": "Timeout in seconds for agent execution (default 60)", + "title": "Timeout", + "type": "number", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "agent", + "description": "Agentic verifier hook type", + "title": "Type", + "type": "string", + "x-clicky-order": 70, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type", + "prompt" + ], + "title": "Hooks value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Hooks value configuration. See the linked native reference for semantics and availability.", + "properties": { + "allowedEnvVars": { + "description": "Explicit list of environment variable names that may be interpolated in header values. Only variables listed here will be resolved; all other $VAR references are left as empty strings. Required for env var interpolation to work.", + "items": { + "description": "Allowed Env Vars value configuration. See the linked native reference for semantics and availability.", + "title": "Allowed Env Vars value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Allowed Env Vars", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "headers": { + "additionalProperties": { + "description": "Headers value configuration. See the linked native reference for semantics and availability.", + "title": "Headers value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "Additional headers to include in the request. Values may reference environment variables using $VAR_NAME or ${VAR_NAME} syntax (e.g., \"Authorization\": \"Bearer $MY_TOKEN\"). Only variables listed in allowedEnvVars will be interpolated.", + "title": "Headers", + "type": "object", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "if": { + "description": "Permission rule syntax to filter when this hook runs (e.g., \"Bash(git *)\"). Only runs if the tool call matches the pattern. Avoids spawning hooks for non-matching commands.", + "title": "If", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "once": { + "description": "If true, hook runs once and is removed after execution", + "title": "Once", + "type": "boolean", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "statusMessage": { + "description": "Custom status message to display in spinner while hook runs", + "title": "Status Message", + "type": "string", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "timeout": { + "description": "Timeout in seconds for this specific request", + "title": "Timeout", + "type": "number", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "http", + "description": "HTTP hook type", + "title": "Type", + "type": "string", + "x-clicky-order": 70, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "URL to POST the hook input JSON to", + "title": "Url", + "type": "string", + "x-clicky-order": 80, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type", + "url" + ], + "title": "Hooks value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Hooks value configuration. See the linked native reference for semantics and availability.", + "properties": { + "if": { + "description": "Permission rule syntax to filter when this hook runs (e.g., \"Bash(git *)\"). Only runs if the tool call matches the pattern. Avoids spawning hooks for non-matching commands.", + "title": "If", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "input": { + "additionalProperties": { + "description": "Input value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Input value", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "Arguments passed to the MCP tool. String values support ${path} interpolation from the hook input JSON (e.g. \"${tool_input.file_path}\").", + "title": "Input", + "type": "object", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "once": { + "description": "If true, hook runs once and is removed after execution", + "title": "Once", + "type": "boolean", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "server": { + "description": "Name of an already-configured MCP server to invoke", + "title": "Server", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "statusMessage": { + "description": "Custom status message to display in spinner while hook runs", + "title": "Status Message", + "type": "string", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "timeout": { + "description": "Timeout in seconds for this specific tool call", + "title": "Timeout", + "type": "number", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "tool": { + "description": "Name of the tool on that server to call", + "title": "Tool", + "type": "string", + "x-clicky-order": 70, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "mcp_tool", + "description": "MCP tool hook type", + "title": "Type", + "type": "string", + "x-clicky-order": 80, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type", + "server", + "tool" + ], + "title": "Hooks value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + ], + "description": "Hooks value configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Hooks value", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Hooks", + "type": "array", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "matcher": { + "description": "String pattern to match (e.g. tool names like \"Write\")", + "title": "Matcher", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "hooks" + ], + "title": "Hooks value value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Hooks value", + "type": "array", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "Custom commands to run before/after tool executions", + "title": "Hooks", + "type": "object", + "x-clicky-order": 840, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "httpHookAllowedEnvVars": { + "description": "Allowlist of environment variable names HTTP hooks may interpolate into headers. When set, each hook's effective allowedEnvVars is the intersection with this list. If undefined, no restriction is applied. Arrays merge across settings sources (same semantics as allowedMcpServers).", + "items": { + "description": "HTTP Hook Allowed Env Vars value configuration. See the linked native reference for semantics and availability.", + "title": "HTTP Hook Allowed Env Vars value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "HTTP Hook Allowed Env Vars", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 850, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "includeCoAuthoredBy": { + "description": "Deprecated: Use attribution instead. Whether to include Claude's co-authored by attribution in commits and PRs (defaults to true)", + "title": "Include Co Authored By", + "type": "boolean", + "x-clicky-order": 860, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "includeGitInstructions": { + "description": "Include built-in commit and PR workflow instructions in Claude's system prompt (default: true)", + "title": "Include Git Instructions", + "type": "boolean", + "x-clicky-order": 870, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "inputNeededNotifEnabled": { + "description": "Push to mobile when a permission prompt or question is waiting", + "title": "Input Needed Notif Enabled", + "type": "boolean", + "x-clicky-order": 880, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "isolatePeerMachines": { + "description": "Require explicit approval before SendMessage can reach a peer session on another machine via Remote Control", + "title": "Isolate Peer Machines", + "type": "boolean", + "x-clicky-order": 890, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "keybindingFlavor": { + "description": "Deprecated: no longer has any effect. The prompt's word-editing keys always follow Bash (readline) conventions.", + "enum": [ + "classic", + "readline" + ], + "title": "Keybinding Flavor", + "type": "string", + "x-clicky-order": 900, + "x-enum-display": "segmented", + "x-enum-labels": { + "classic": "Classic", + "readline": "Readline" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "language": { + "description": "Preferred language for Claude responses and voice dictation (e.g., \"japanese\", \"spanish\")", + "title": "Language", + "type": "string", + "x-clicky-order": 910, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "managedMcpServers": { + "additionalProperties": { + "additionalProperties": { + "description": "Managed MCP Servers value value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Managed MCP Servers value value", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "Managed MCP Servers value configuration. See the linked native reference for semantics and availability.", + "title": "Managed MCP Servers value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "MCP servers the organization provides to every user, keyed by server name, each with the .mcp.json entry shape; only \"http\" and \"sse\" servers are accepted (nothing that names a program to run, no ${VAR} references). Honored from managed settings only; users cannot remove them, deniedMcpServers still applies, and they need no allowedMcpServers entry. Not read in Claude Desktop's Code tab on a third-party deployment or in Cowork sessions, where Claude Desktop supplies and locks the session's MCP servers itself.", + "title": "Managed MCP Servers", + "type": "object", + "x-clicky-order": 920, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "managedSourcesBehavior": { + "description": "Controls how the managed settings sources compose. \"first-wins\" (default): the highest-priority source present (server-managed \u003e MDM (managed plist / HKLM) \u003e managed-settings.json) is the managed tier alone. \"merge\": every present source deep-merges with fixed precedence server-managed \u003e MDM \u003e managed-settings.json — scalars take the highest source's value (a restrictive boolean or enum — the allowManaged*Only locks, the disable* switches, the sandbox lock family — takes the strictest value any source sets) and arrays union, except fallbackModel, the restriction allowlists allowedMcpServers, availableModels, strictKnownMarketplaces and allowedChannelPlugins, and sandbox.credentials.awsPairs and sandbox.ripgrep (the highest source that sets one owns it whole), modelOverrides (the whole map of the highest source that sets it, dropped when that source sits below the one that sets availableModels), managedMcpServers (server names union; a name set by two sources takes the higher source's whole entry), and the keys taken from the highest source only: the auth pins forceLoginOrgUUID, forceLoginMethod, forceLoginGatewayUrl and gatewayInternalNetworks, the credential helpers apiKeyHelper, awsAuthRefresh, awsCredentialExport, gcpAuthRefresh, otelHeadersHelper and proxyAuthHelper, modelPicker, permissions.defaultMode, parentSettingsBehavior and the policyHelper configuration (env keeps its own per-key union). Honored only from the highest-priority source present; enable it only when every lower source is admin-controlled, since lower sources then contribute entries such as permissions.allow. HKCU and --managed-settings never take part in the merge.", + "enum": [ + "first-wins", + "merge" + ], + "title": "Managed Sources Behavior", + "type": "string", + "x-clicky-order": 930, + "x-enum-display": "segmented", + "x-enum-labels": { + "first-wins": "First wins", + "merge": "Merge" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "maxEffortLevel": { + "description": "Maximum effort level. Anything above it (an /effort or /model pick, --effort, CLAUDE_CODE_EFFORT_LEVEL, a model default) is clamped to it, on every provider including Bedrock, Vertex and Foundry. Combines with an organization's per-model effort cap by taking the lower of the two; across settings files the lowest value wins, and modelSettings.\u003cmodel\u003e.maxEffortLevel replaces it per model. Enforced client-side: an effort supplied through CLAUDE_CODE_EXTRA_BODY is not clamped.", + "enum": [ + "low", + "medium", + "high", + "xhigh", + "max" + ], + "title": "Max Effort Level", + "type": "string", + "x-clicky-order": 940, + "x-enum-display": "combobox", + "x-enum-labels": { + "high": "High", + "low": "Low", + "max": "Max", + "medium": "Medium", + "xhigh": "Xhigh" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "minimumVersion": { + "description": "Minimum version to stay on - prevents downgrades when switching to stable channel", + "title": "Minimum Version", + "type": "string", + "x-clicky-order": 950, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "model": { + "description": "Override the default model used by Claude Code", + "title": "Model", + "type": "string", + "x-clicky-order": 960, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "modelOverrides": { + "additionalProperties": { + "description": "Model Overrides value configuration. See the linked native reference for semantics and availability.", + "title": "Model Overrides value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "Override mapping from Anthropic model ID (e.g. \"claude-opus-4-6\") to provider-specific model ID (e.g. a Bedrock inference profile ARN). Typically set in managed settings by enterprise administrators.", + "title": "Model Overrides", + "type": "object", + "x-clicky-order": 970, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "modelPicker": { + "additionalProperties": false, + "description": "Curate the /model picker: an ordered list of models with your own labels, independent of the built-in lineup and of Claude Code releases. availableModels still applies to these rows. Honored from managed, --settings/SDK, and user settings only (not from a project checkout); the highest-precedence of those that defines modelPicker wins outright (no merging across sources). Typically set in managed settings by enterprise administrators.", + "properties": { + "options": { + "description": "Rows to show in the /model picker, in order.", + "items": { + "additionalProperties": false, + "description": "Options value configuration. See the linked native reference for semantics and availability.", + "properties": { + "behavesAs": { + "description": "For a model this version of Claude Code does not know: the ID of a model it does know (e.g. \"claude-opus-4-8\") whose client-side handling — prompt profile, capability and effort defaults — applies to it. Changes neither the row's label nor the model ID sent. Without it, a model-catalog row for a model this version does not know is not offered until Claude Code is updated.", + "title": "Behaves As", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": { + "description": "Row subtitle. Defaults to a generic description.", + "title": "Description", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "label": { + "description": "Row title. Defaults to the model name.", + "title": "Label", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "model": { + "description": "Model to select, taken verbatim: an alias (\"opus\"), an Anthropic model ID, or a provider-format ID (Vertex, Bedrock, gateway). Same values --model accepts.", + "title": "Model", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "model" + ], + "title": "Options value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Options", + "type": "array", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "replaceBuiltInOptions": { + "description": "When true, the picker shows only the Default row and these options — the built-in lineup, gateway-discovered models and ANTHROPIC_CUSTOM_MODEL_OPTION are hidden. When false or unset, these options are added after the built-in lineup.", + "title": "Replace Built In Options", + "type": "boolean", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "options" + ], + "title": "Model Picker", + "type": "object", + "x-clicky-order": 980, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "modelPricing": { + "additionalProperties": false, + "description": "Price usage at your organization's contracted rates instead of list price. Affects every spend figure Claude Code reports — /cost, the status line, the SDK total_cost_usd, --max-budget-usd, and the OpenTelemetry cost metric and events — which remain USD estimates, not an invoice (the per-Mtok price labels in /model stay at list). \"overrides\" maps a model ID to its USD-per-million-token rates (input, output, cacheRead, cacheWrite — all four required, each 0 to 10000; cacheWrite prices both 5-minute and 1-hour cache writes). A matching row is charged exactly as written; fast-mode and US-data-residency surcharges are not added on top. A key Claude Code itself uses for a built-in model — its ID such as \"claude-sonnet-4-6\", or its first-party, Bedrock (any or no region prefix), Vertex or Foundry ID — covers every dated and provider form of that model; any other key — a gateway model alias, or a spelling Claude Code does not itself use — matches that model ID only (case-insensitive), and such an exact match wins over a built-in row. On Bedrock an application inference profile is matched by its backing model. An invalid row or multiplier is reported and skipped; the rest still apply. \"multiplier\" in (0, 10] scales every computed cost, overridden or not (0.85 = 85% of the price, 1.2 = 120%). Only honored from managed settings (server-managed, MDM / OS policy, or managed-settings.json), or — when none of those sets it — when supplied by a host application that manages the model provider; ignored in user, project, local and --settings sources.", + "properties": { + "multiplier": { + "description": "Multiplier configuration. See the linked native reference for semantics and availability.", + "title": "Multiplier", + "type": "number", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "overrides": { + "additionalProperties": { + "additionalProperties": false, + "description": "Overrides value configuration. See the linked native reference for semantics and availability.", + "properties": { + "cacheRead": { + "description": "Cache Read configuration. See the linked native reference for semantics and availability.", + "title": "Cache Read", + "type": "number", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "cacheWrite": { + "description": "Cache Write configuration. See the linked native reference for semantics and availability.", + "title": "Cache Write", + "type": "number", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "input": { + "description": "Input configuration. See the linked native reference for semantics and availability.", + "title": "Input", + "type": "number", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "output": { + "description": "Output configuration. See the linked native reference for semantics and availability.", + "title": "Output", + "type": "number", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "input", + "output", + "cacheRead", + "cacheWrite" + ], + "title": "Overrides value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "Overrides configuration. See the linked native reference for semantics and availability.", + "title": "Overrides", + "type": "object", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "title": "Model Pricing", + "type": "object", + "x-clicky-order": 990, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "modelSettings": { + "additionalProperties": { + "additionalProperties": { + "description": "Model Settings value value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Model Settings value value", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "Model Settings value configuration. See the linked native reference for semantics and availability.", + "properties": { + "effortLevel": { + "description": "Persisted effort level for this model.", + "enum": [ + "low", + "medium", + "high", + "xhigh" + ], + "title": "Effort Level", + "type": "string", + "x-clicky-order": 10, + "x-enum-display": "segmented", + "x-enum-labels": { + "high": "High", + "low": "Low", + "medium": "Medium", + "xhigh": "Xhigh" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "maxEffortLevel": { + "description": "Maximum effort level for this model. Within one settings file it replaces the top-level maxEffortLevel for the model (\"max\" exempts it); across settings files the lowest applicable value wins. Keyed like effortLevel: the canonical model name also matches its dated, [1m], Bedrock and Vertex spellings.", + "enum": [ + "low", + "medium", + "high", + "xhigh", + "max" + ], + "title": "Max Effort Level", + "type": "string", + "x-clicky-order": 20, + "x-enum-display": "combobox", + "x-enum-labels": { + "high": "High", + "low": "Low", + "max": "Max", + "medium": "Medium", + "xhigh": "Xhigh" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "title": "Model Settings value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "Per-model settings keyed by canonical model name.", + "title": "Model Settings", + "type": "object", + "x-clicky-order": 1000, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "otelHeadersHelper": { + "description": "Path to a script that outputs OpenTelemetry headers", + "title": "Otel Headers Helper", + "type": "string", + "x-clicky-order": 1010, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "outputStyle": { + "description": "Controls the output style for assistant responses", + "title": "Output Style", + "type": "string", + "x-clicky-order": 1020, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "parentSettingsBehavior": { + "description": "Controls whether the SDK parent tier (Options.managedSettings / --managed-settings) layers under this admin tier. \"first-wins\" (default): parent is dropped — admin tiers are the only policy source. \"merge\": parent's restrictive-only-filtered settings union under the admin winner. Has no effect when no admin tier exists (parent applies as the sole policy tier, still filtered restrictive-only).", + "enum": [ + "first-wins", + "merge" + ], + "title": "Parent Settings Behavior", + "type": "string", + "x-clicky-order": 1030, + "x-enum-display": "segmented", + "x-enum-labels": { + "first-wins": "First wins", + "merge": "Merge" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "permissions": { + "additionalProperties": { + "description": "Permissions value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Permissions value", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "Tool usage permissions configuration", + "properties": { + "additionalDirectories": { + "description": "Additional directories to include in the permission scope", + "items": { + "description": "Additional Directories value configuration. See the linked native reference for semantics and availability.", + "title": "Additional Directories value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Additional Directories", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "allow": { + "description": "List of permission rules for allowed operations", + "items": { + "description": "Allow value configuration. See the linked native reference for semantics and availability.", + "title": "Allow value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Allow", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "ask": { + "description": "List of permission rules that should always prompt for confirmation", + "items": { + "description": "Ask value configuration. See the linked native reference for semantics and availability.", + "title": "Ask value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Ask", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "blockReadsOutsideWorkingDirectories": { + "description": "Refuse file-tool reads (Read, Grep, Glob, LSP) outside the working directories in every permission mode; true in any settings source wins. Also set when the user picks \"block\" on the one-time auto-mode prompt for a read outside the working directories.", + "title": "Block Reads Outside Working Directories", + "type": "boolean", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "defaultMode": { + "description": "Default permission mode when Claude Code needs access ('manual' is accepted as an alias for 'default')", + "enum": [ + "acceptEdits", + "auto", + "bypassPermissions", + "default", + "dontAsk", + "plan" + ], + "title": "Default Mode", + "type": "string", + "x-clicky-order": 50, + "x-enum-display": "combobox", + "x-enum-icons": { + "acceptEdits": "folder", + "auto": "sparkles", + "bypassPermissions": "lock-open", + "default": "shield", + "dontAsk": "prohibit", + "plan": "list-dashes" + }, + "x-enum-labels": { + "acceptEdits": "Accept Edits", + "auto": "Auto", + "bypassPermissions": "Bypass Permissions", + "default": "Default", + "dontAsk": "Dont Ask", + "plan": "Plan" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "deny": { + "description": "List of permission rules for denied operations", + "items": { + "description": "Deny value configuration. See the linked native reference for semantics and availability.", + "title": "Deny value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Deny", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "disableBypassPermissionsMode": { + "const": "disable", + "description": "Disable the ability to bypass permission prompts", + "title": "Disable Bypass Permissions Mode", + "type": "string", + "x-clicky-order": 70, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "title": "Permissions", + "type": "object", + "x-clicky-order": 1040, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "plansDirectory": { + "description": "Custom directory for plan files, relative to project root. If not set, defaults to ~/.claude/plans/", + "title": "Plans Directory", + "type": "string", + "x-clicky-order": 1050, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "pluginConfigs": { + "additionalProperties": { + "anyOf": [ + { + "additionalProperties": false, + "description": "Plugin Configs value configuration. See the linked native reference for semantics and availability.", + "properties": { + "mcpServers": { + "additionalProperties": { + "additionalProperties": { + "anyOf": [ + { + "description": "MCP Servers value value configuration. See the linked native reference for semantics and availability.", + "title": "MCP Servers value value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "description": "MCP Servers value value configuration. See the linked native reference for semantics and availability.", + "title": "MCP Servers value value", + "type": "number", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "description": "MCP Servers value value configuration. See the linked native reference for semantics and availability.", + "title": "MCP Servers value value", + "type": "boolean", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "description": "MCP Servers value value configuration. See the linked native reference for semantics and availability.", + "items": { + "description": "MCP Servers value value value configuration. See the linked native reference for semantics and availability.", + "title": "MCP Servers value value value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "MCP Servers value value", + "type": "array", + "x-array-display": "list", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + ], + "description": "MCP Servers value value configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "MCP Servers value value", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "MCP Servers value configuration. See the linked native reference for semantics and availability.", + "title": "MCP Servers value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "User configuration values for MCP servers keyed by server name", + "title": "MCP Servers", + "type": "object", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "options": { + "additionalProperties": { + "anyOf": [ + { + "description": "Options value configuration. See the linked native reference for semantics and availability.", + "title": "Options value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "description": "Options value configuration. See the linked native reference for semantics and availability.", + "title": "Options value", + "type": "number", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "description": "Options value configuration. See the linked native reference for semantics and availability.", + "title": "Options value", + "type": "boolean", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "description": "Options value configuration. See the linked native reference for semantics and availability.", + "items": { + "description": "Options value value configuration. See the linked native reference for semantics and availability.", + "title": "Options value value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Options value", + "type": "array", + "x-array-display": "list", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + ], + "description": "Options value configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Options value", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "Non-sensitive option values from plugin manifest userConfig, keyed by option name. Sensitive values go to secure storage instead.", + "title": "Options", + "type": "object", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "title": "Plugin Configs value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": { + "description": "Plugin Configs value value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Plugin Configs value value", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "Plugin Configs value configuration. See the linked native reference for semantics and availability.", + "title": "Plugin Configs value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + ], + "description": "Plugin Configs value configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Plugin Configs value", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "Per-plugin configuration including MCP server user configs, keyed by plugin ID (plugin\\@marketplace format)", + "title": "Plugin Configs", + "type": "object", + "x-clicky-order": 1060, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "pluginSuggestionMarketplaces": { + "description": "Marketplace names whose plugins may surface as contextual install suggestions (relevance-based tips). No marketplace-declared suggestions surface without this allowlist; the built-in first-party frontend-design tip is unaffected. Only honored when set in managed settings (policy scope); the key is ignored in user, project, and local settings. A name only takes effect when the marketplace is registered on the machine AND its registered source is also declared in managed settings, either as the extraKnownMarketplaces entry for that name or as an entry of strictKnownMarketplaces. A marketplace registered from a different source under an allowlisted name is ignored. The official marketplace is exempt from the source requirement: allowlisting its name alone suffices, since that name can only register from the official Anthropic source.", + "items": { + "description": "Plugin Suggestion Marketplaces value configuration. See the linked native reference for semantics and availability.", + "title": "Plugin Suggestion Marketplaces value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Plugin Suggestion Marketplaces", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 1070, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "pluginTrustMessage": { + "description": "Custom message to append to the plugin trust warning shown before installation. Only read from policy settings (managed-settings.json / MDM). Useful for enterprise administrators to add organization-specific context (e.g., \"All plugins from our internal marketplace are vetted and approved.\").", + "title": "Plugin Trust Message", + "type": "string", + "x-clicky-order": 1080, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "policyHelper": { + "additionalProperties": false, + "description": "Executable that computes managed settings at startup. Honored only from admin-controlled policy sources.", + "properties": { + "path": { + "description": "Absolute path to the helper executable", + "title": "Path", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "refreshIntervalMs": { + "anyOf": [ + { + "const": 0, + "description": "Refresh Interval Ms configuration. See the linked native reference for semantics and availability.", + "title": "Refresh Interval Ms", + "type": "number", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "description": "Refresh Interval Ms configuration. See the linked native reference for semantics and availability.", + "title": "Refresh Interval Ms", + "type": "number", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + ], + "description": "Refresh Interval Ms configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Refresh Interval Ms", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "timeoutMs": { + "description": "Timeout Ms configuration. See the linked native reference for semantics and availability.", + "title": "Timeout Ms", + "type": "number", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "path" + ], + "title": "Policy Helper", + "type": "object", + "x-clicky-order": 1090, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "prUrlTemplate": { + "description": "URL template for PR links in the footer link badges and inline messages. The detected git PR is rendered as the first footer-link badge. Placeholders: {host} {owner} {repo} {number} {url}. Example: \"https://reviews.example.com/{owner}/{repo}/pull/{number}\"", + "title": "Pr Url Template", + "type": "string", + "x-clicky-order": 1100, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "precomputeCompactionEnabled": { + "description": "Precompute the compaction summary in the background before it is needed. Only applies when auto-compact is on.", + "title": "Precompute Compaction Enabled", + "type": "boolean", + "x-clicky-order": 1110, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "preferredNotifChannel": { + "description": "Preferred OS notification channel", + "enum": [ + "auto", + "iterm2", + "terminal_bell", + "iterm2_with_bell", + "kitty", + "ghostty", + "notifications_disabled" + ], + "title": "Preferred Notif Channel", + "type": "string", + "x-clicky-order": 1120, + "x-enum-display": "combobox", + "x-enum-labels": { + "auto": "Auto", + "ghostty": "Ghostty", + "iterm2": "Iterm2", + "iterm2_with_bell": "Iterm2 with bell", + "kitty": "Kitty", + "notifications_disabled": "Notifications disabled", + "terminal_bell": "Terminal bell" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "prefersReducedMotion": { + "description": "Reduce or disable animations for accessibility (spinner shimmer, flash effects, etc.)", + "title": "Prefers Reduced Motion", + "type": "boolean", + "x-clicky-order": 1130, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "prependPlugins": { + "description": "Managed plugins (plugin\\@marketplace ids that managed enabledPlugins sets true) whose hooks run first, outermost, in the listed order: the first id listed sees every event before any other plugin and every result after it. Managed plugins not listed here or in appendPlugins follow the listed ones; user, project and marketplace plugins come after those; then appendPlugins; then the built-in plugins. The bundled sec-default\\@builtin seats itself outermost (on a machine with managed settings and for Team and Enterprise organizations) unless this list is set, in which case list sec-default\\@builtin where it should sit or leave it out. Any other id that is not an enabled managed plugin is skipped; an id listed in both keys is prepended. Only honored from managed settings (or, on a machine with none, from user settings for your own plugins); ignored in project, local and --settings sources.", + "items": { + "description": "Prepend Plugins value configuration. See the linked native reference for semantics and availability.", + "title": "Prepend Plugins value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Prepend Plugins", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 1140, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "processWrapper": { + "description": "Corporate launcher argv prefix for the background-agent supervisor, the sessions and workers it hosts, and the other covered background processes listed in the Claude Code corporate-launcher documentation. Equivalent to the CLAUDE_CODE_PROCESS_WRAPPER environment variable, which takes precedence when set. Honored from managed settings, a --settings/SDK-supplied settings file, and user settings, in that precedence order; project and local settings are ignored.", + "title": "Process Wrapper", + "type": "string", + "x-clicky-order": 1150, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "promptCacheTtl": { + "description": "Prompt cache TTL for the main conversation (interactive, -p and SDK turns, plus the helpers that run inline with it): \"5m\" or \"1h\". Unset = automatic: 1 hour on a Claude subscription within its usage limits, 5 minutes on an API key, Bedrock, Vertex or Foundry. 1-hour cache writes are billed at a higher rate; the cache stays warm across longer breaks. The CLAUDE_CODE_PROMPT_CACHE_TTL environment variable takes precedence.", + "enum": [ + "5m", + "1h" + ], + "title": "Prompt Cache Ttl", + "type": "string", + "x-clicky-order": 1160, + "x-enum-display": "segmented", + "x-enum-labels": { + "1h": "1h", + "5m": "5m" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "promptSuggestionEnabled": { + "description": "When false, prompt suggestions are disabled. When absent or true, prompt suggestions are enabled.", + "title": "Prompt Suggestion Enabled", + "type": "boolean", + "x-clicky-order": 1170, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "proxyAuthHelper": { + "description": "Shell command that outputs a Proxy-Authorization header value (EAP)", + "title": "Proxy Auth Helper", + "type": "string", + "x-clicky-order": 1180, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "remote": { + "additionalProperties": false, + "description": "Cloud session configuration", + "properties": { + "defaultEnvironmentId": { + "description": "Default environment ID to use for cloud sessions", + "title": "Default Environment Id", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "title": "Remote", + "type": "object", + "x-clicky-order": 1190, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "remoteControlAtStartup": { + "description": "Start Remote Control bridge automatically each session", + "title": "Remote Control At Startup", + "type": "boolean", + "x-clicky-order": 1200, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "requiredMaximumVersion": { + "description": "Maximum Claude Code version allowed to start. If the running version is newer, Claude Code exits at startup with instructions to install an approved version. Only enforced from managed (policy) settings.", + "title": "Required Maximum Version", + "type": "string", + "x-clicky-order": 1210, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "requiredMinimumVersion": { + "description": "Minimum Claude Code version required to start. If the running version is older, Claude Code exits at startup with instructions to update. Only enforced from managed (policy) settings.", + "title": "Required Minimum Version", + "type": "string", + "x-clicky-order": 1220, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "respectGitignore": { + "description": "Whether file picker should respect .gitignore files (default: true). Note: .ignore files are always respected.", + "title": "Respect Gitignore", + "type": "boolean", + "x-clicky-order": 1230, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "respondToBashCommands": { + "description": "Whether Claude responds after an input-box ! bash command runs. Set to false to add the command output to context without a response. Default: true.", + "title": "Respond To Bash Commands", + "type": "boolean", + "x-clicky-order": 1240, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "sandbox": { + "additionalProperties": { + "description": "Sandbox value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Sandbox value", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "Sandbox configuration. See the linked native reference for semantics and availability.", + "properties": { + "allowAppleEvents": { + "description": "macOS only: Allow sandboxed commands to send Apple Events (and look up the appleeventsd Mach service). Needed for `open`, `osascript`, and browser-based auth flows that open URLs. **Removes code-execution isolation** — sandboxed commands can launch other applications unsandboxed with no user prompt, and can script running apps (e.g. Terminal) subject to the user's per-app TCC automation consent. Only honored from user, managed/policy, or CLI (--settings) settings — project settings (.claude/settings.json and .claude/settings.local.json) are ignored. Default: false", + "title": "Allow Apple Events", + "type": "boolean", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "allowUnsandboxedCommands": { + "description": "Allow commands to run outside the sandbox via the dangerouslyDisableSandbox parameter. When false, the dangerouslyDisableSandbox parameter is completely ignored and all commands must run sandboxed. Default: true.", + "title": "Allow Unsandboxed Commands", + "type": "boolean", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "autoAllowBashIfSandboxed": { + "description": "Auto Allow Bash If Sandboxed configuration. See the linked native reference for semantics and availability.", + "title": "Auto Allow Bash If Sandboxed", + "type": "boolean", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "bwrapPath": { + "description": "Linux/WSL only: Absolute path to the bwrap (bubblewrap) binary. Overrides auto-detection via PATH. Only honored from admin-controlled managed settings.", + "title": "Bwrap Path", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "credentials": { + "additionalProperties": false, + "description": "Credentials configuration. See the linked native reference for semantics and availability.", + "properties": { + "allowPlaintextInject": { + "description": "Allow sentinel→real substitution on the plain-HTTP proxy path. Defaults to false: without TLS termination the upstream identity is unverified and the credential travels in cleartext. Set only for trusted-network test fixtures. Only honored from user, managed/policy, or CLI (`--settings`) settings — project settings (.claude/settings.json and .claude/settings.local.json) are ignored.", + "title": "Allow Plaintext Inject", + "type": "boolean", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "awsPairs": { + "description": "Explicit groupings of masked env vars into AWS credential pairs for SigV4 re-signing, for non-standard variable names. The conventional AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY / AWS_SESSION_TOKEN trio is paired automatically when masked. Only honored from user, managed/policy, or CLI (`--settings`) settings — project settings (.claude/settings.json and .claude/settings.local.json) are ignored. A member is only usable when its env var is forwarded as a whole-value `mask` entry (an entry carrying `extract` or `decode` does not qualify — re-signing needs the whole real value). A pair whose key id or secret member is unusable never re-signs: it is dropped, unless it names a conventional AWS variable, in which case it is forwarded as an inert suppressor so implicit auto-pairing stays overridden. A pair whose ONLY unusable member is the session token still re-signs, without an x-amz-security-token (temporary-credential requests fail upstream until the entry is fixed).", + "items": { + "additionalProperties": false, + "description": "Aws Pairs value configuration. See the linked native reference for semantics and availability.", + "properties": { + "accessKeyIdVar": { + "description": "Name of the masked env var holding the AWS access key id.", + "title": "Access Key Id Var", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "secretAccessKeyVar": { + "description": "Name of the masked env var holding the AWS secret access key.", + "title": "Secret Access Key Var", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "sessionTokenVar": { + "description": "Optional name of the masked env var holding the AWS session token (temporary credentials). When set, the proxy sends the real token as x-amz-security-token on re-signed requests and adds it to the signed header set if the client did not.", + "title": "Session Token Var", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "accessKeyIdVar", + "secretAccessKeyVar" + ], + "title": "Aws Pairs value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Aws Pairs", + "type": "array", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "envVars": { + "description": "Environment variables to protect. `deny` unsets the variable for sandboxed commands; `mask` substitutes a sentinel inside the sandbox and injects the real value at the proxy.", + "items": { + "additionalProperties": false, + "description": "Env Vars value configuration. See the linked native reference for semantics and availability.", + "properties": { + "decode": { + "const": "jwt", + "description": "Optional encoded-credential format for `mask` mode. `jwt`: the variable's whole value is verified to actually be a JWT and replaced with a structurally valid fake JWT so client-side token parsing inside the sandbox keeps working; the proxy swaps the whole fake token on egress. If the value does not verify, the variable is left unmasked with a stderr warning (fail-open). Cannot be combined with `extract` — the decode path never consults it. Accepted but ignored for `deny`.", + "title": "Decode", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "extract": { + "description": "Optional regex for structured masking when mode is `mask`. Applied globally to the value; capture group 1 of each match is a credential value, and only those captured spans are replaced with sentinels — the rest of the value is preserved so a tool that parses it (a `DATABASE_URL` connection string, a composite `KEY:SECRET` pair) still succeeds inside the sandbox. Without `extract`, the entire value is replaced with one sentinel (whole-value masking, suited to bare tokens). If the regex matches nothing, behavior is governed by `onExtractNoMatch` (default `warn`). Cannot be combined with `decode` (the decode path never consults it). Accepted but ignored for `deny`.", + "title": "Extract", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "injectHosts": { + "description": "Optional narrowing of where the proxy substitutes this credential. Only meaningful when mode is `mask`; accepted but ignored for `deny`. If unset, defaults to `network.allowedDomains` — the credential is injected at every reachable host. Each entry must be reachable via `network.allowedDomains` (sandbox-runtime validates this).", + "items": { + "description": "Inject Hosts value configuration. See the linked native reference for semantics and availability.", + "title": "Inject Hosts value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Inject Hosts", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "maskClaims": { + "description": "Names of top-level payload claims to mask inside the decoded value, instead of replacing the whole token. Each named claim present with a string value gets its own sentinel and the token is rebuilt around the modified payload; all other claims are preserved so claim-reading clients keep working. Requires `decode`. If no named claim matches, the variable is left unmasked with a stderr warning (fail-open). Only meaningful when mode is `mask`; accepted but ignored for `deny`.", + "items": { + "description": "Mask Claims value configuration. See the linked native reference for semantics and availability.", + "title": "Mask Claims value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Mask Claims", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "mode": { + "description": "Access mode for this environment variable. `deny` unsets the variable for sandboxed commands; `mask` shows sandboxed commands a sentinel value and the host proxy swaps sentinel→real on egress to `injectHosts`.", + "enum": [ + "deny", + "mask" + ], + "title": "Mode", + "type": "string", + "x-clicky-order": 50, + "x-enum-display": "segmented", + "x-enum-labels": { + "deny": "Deny", + "mask": "Mask" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "name": { + "description": "Environment variable name.", + "title": "Name", + "type": "string", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "onExtractNoMatch": { + "description": "What to do when `extract` matches nothing in the value. `warn` (default) emits a stderr warning and lets the variable pass through unmasked (fail-open, for credentials that may be legitimately absent); `deny` unsets the variable inside the sandbox (fail-closed); `error` aborts at sandbox setup so nothing runs until the config is fixed. Only meaningful when mode is `mask` and `extract` is set without `decode`. On a mask entry with `decode`, the runtime takes the decode path and never consults this field, so a fail-closed setting cannot be honored — `deny` and `error` are rejected there; only `warn` is accepted. In all other shapes the field is accepted but ignored.", + "enum": [ + "warn", + "deny", + "error" + ], + "title": "On Extract No Match", + "type": "string", + "x-clicky-order": 70, + "x-enum-display": "segmented", + "x-enum-labels": { + "deny": "Deny", + "error": "Error", + "warn": "Warn" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "name", + "mode" + ], + "title": "Env Vars value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Env Vars", + "type": "array", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "files": { + "description": "Credential files or directories to protect. `deny` blocks reads inside the sandbox; `mask` substitutes a sentinel inside the sandbox (whole-file, or per-`extract` capture) and injects the real value at the proxy. On macOS and Windows `mask` degrades to `deny`.", + "items": { + "additionalProperties": false, + "description": "Files value configuration. See the linked native reference for semantics and availability.", + "properties": { + "decode": { + "const": "jwt", + "description": "Optional encoded-credential format for `mask` mode. `jwt`: candidates are located with a built-in JWT regex (or the explicit `extract` pattern, if set), verified to actually be JWTs before masking, and replaced with a structurally valid fake JWT so client-side token parsing inside the sandbox keeps working. If no candidate verifies, behavior is governed by `onExtractNoMatch` (default `warn`). Accepted but ignored for `deny`.", + "title": "Decode", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "extract": { + "description": "Optional regex for structured masking when mode is `mask`. Applied globally to the file; capture group 1 of each match is a credential value, and only those captured spans are replaced with sentinels — the rest of the file is preserved so a tool that parses it (.netrc, JSON, YAML) still succeeds. Without `extract`, the entire file content is replaced with one sentinel (whole-file masking, suited to single-secret files). If the regex matches nothing, behavior is governed by `onExtractNoMatch` (default `warn`). Accepted but ignored for `deny`.", + "title": "Extract", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "injectHosts": { + "description": "Optional narrowing of where the proxy substitutes this credential. Only meaningful when mode is `mask`; accepted but ignored for `deny`. If unset, defaults to `network.allowedDomains` — the credential is injected at every reachable host. Each entry must be reachable via `network.allowedDomains` (sandbox-runtime validates this).", + "items": { + "description": "Inject Hosts value configuration. See the linked native reference for semantics and availability.", + "title": "Inject Hosts value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Inject Hosts", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "maskClaims": { + "description": "Names of top-level payload claims to mask inside each decoded value, instead of replacing the whole token. Each named claim present with a string value gets its own sentinel and the token is rebuilt around the modified payload; all other claims are preserved so a tool that decodes the token and reads a non-secret claim keeps working. Requires `decode`. If no named claim matches in any verified token, behavior is governed by `onExtractNoMatch` (default `warn`). Only meaningful when mode is `mask`; accepted but ignored for `deny`.", + "items": { + "description": "Mask Claims value configuration. See the linked native reference for semantics and availability.", + "title": "Mask Claims value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Mask Claims", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "maskDuplicates": { + "description": "If true, verbatim occurrences of each captured credential value outside the regex-matched spans are also replaced with the corresponding sentinel — for a secret repeated where the regex does not reach (e.g. pasted into a comment). Matches raw substrings, so short or common values may corrupt unrelated content; intended for long, high-entropy secrets. Defaults to false. Only meaningful when mode is `mask` and `extract` or `decode` is set; accepted but ignored otherwise.", + "title": "Mask Duplicates", + "type": "boolean", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "mode": { + "description": "Access mode for this path. `deny` blocks reads inside the sandbox; `mask` shows sandboxed commands a sentinel-substituted copy (whole-file, or only the spans captured by `extract`) and the host proxy swaps sentinel→real on egress to `injectHosts`. On macOS and Windows `mask` currently degrades to `deny`.", + "enum": [ + "deny", + "mask" + ], + "title": "Mode", + "type": "string", + "x-clicky-order": 60, + "x-enum-display": "segmented", + "x-enum-labels": { + "deny": "Deny", + "mask": "Mask" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "onExtractNoMatch": { + "description": "What to do when `extract` matches nothing in the file — or, with `decode`, when no candidate survives verification. `warn` (default) emits a stderr warning and leaves the file readable as-is inside the sandbox (fail-open, for credentials that may be legitimately absent); `deny` degrades the entry to mode `deny` so the file is unreadable (fail-closed) — under `sandbox.filesystem.disabled` it is treated as `error`, since read-denies are dropped in that mode; `error` aborts at sandbox setup so nothing runs until the config is fixed. Only meaningful when mode is `mask` and `extract` or `decode` is set; accepted but ignored otherwise.", + "enum": [ + "warn", + "deny", + "error" + ], + "title": "On Extract No Match", + "type": "string", + "x-clicky-order": 70, + "x-enum-display": "segmented", + "x-enum-labels": { + "deny": "Deny", + "error": "Error", + "warn": "Warn" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "path": { + "description": "Path to a credential file or directory. Same resolution as sandbox.filesystem.* paths: absolute, ~ expanded, or relative to the settings file root (project root for project settings, ~/.claude for user settings).", + "title": "Path", + "type": "string", + "x-clicky-order": 80, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "path", + "mode" + ], + "title": "Files value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Files", + "type": "array", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "sigv4": { + "additionalProperties": false, + "description": "Policies for AWS SigV4 request shapes the proxy cannot re-sign (streaming, presigned, sigv4a) when they reference a masked credential pair: `deny` (default) or `passthrough`. Only honored from user, managed/policy, or CLI (`--settings`) settings — project settings (.claude/settings.json and .claude/settings.local.json) are ignored.", + "properties": { + "presigned": { + "description": "Policy for presigned URLs (X-Amz-Algorithm/X-Amz-Signature in the query, no Authorization header): the signature lives in the URL itself. `deny` (default) or `passthrough`.", + "enum": [ + "deny", + "passthrough" + ], + "title": "Presigned", + "type": "string", + "x-clicky-order": 10, + "x-enum-display": "segmented", + "x-enum-labels": { + "deny": "Deny", + "passthrough": "Passthrough" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "sigv4a": { + "description": "Policy for SigV4A (AWS4-ECDSA-P256-SHA256) asymmetric signatures: there is no shared-key HMAC to recompute. `deny` (default) or `passthrough`.", + "enum": [ + "deny", + "passthrough" + ], + "title": "Sigv4a", + "type": "string", + "x-clicky-order": 20, + "x-enum-display": "segmented", + "x-enum-labels": { + "deny": "Deny", + "passthrough": "Passthrough" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "streaming": { + "description": "Policy for aws-chunked streaming uploads (x-amz-content-sha256: STREAMING-*): per-chunk signatures chain off the seed signature, so re-signing would require rewriting the body. `deny` (default) fails closed with a 403; `passthrough` forwards the request unre-signed (the upstream will reject its signature).", + "enum": [ + "deny", + "passthrough" + ], + "title": "Streaming", + "type": "string", + "x-clicky-order": 30, + "x-enum-display": "segmented", + "x-enum-labels": { + "deny": "Deny", + "passthrough": "Passthrough" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "title": "Sigv4", + "type": "object", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "title": "Credentials", + "type": "object", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "enableWeakerNestedSandbox": { + "description": "Enable Weaker Nested Sandbox configuration. See the linked native reference for semantics and availability.", + "title": "Enable Weaker Nested Sandbox", + "type": "boolean", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "enableWeakerNetworkIsolation": { + "description": "macOS only: Allow access to com.apple.trustd.agent in the sandbox. Needed for Go-based CLI tools (gh, gcloud, terraform, etc.) to verify TLS certificates when using httpProxyPort with a MITM proxy and custom CA. **Reduces security** — opens a potential data exfiltration vector through the trustd service. Default: false", + "title": "Enable Weaker Network Isolation", + "type": "boolean", + "x-clicky-order": 70, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "enabled": { + "description": "Enabled configuration. See the linked native reference for semantics and availability.", + "title": "Enabled", + "type": "boolean", + "x-clicky-order": 80, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "excludedCommands": { + "description": "Excluded Commands configuration. See the linked native reference for semantics and availability.", + "items": { + "description": "Excluded Commands value configuration. See the linked native reference for semantics and availability.", + "title": "Excluded Commands value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Excluded Commands", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 90, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "failIfUnavailable": { + "description": "Exit with an error at startup if sandbox.enabled is true but the sandbox cannot start (missing dependencies or unsupported platform). When false (default), a warning is shown and commands run unsandboxed. Intended for managed-settings deployments that require sandboxing as a hard gate.", + "title": "Fail If Unavailable", + "type": "boolean", + "x-clicky-order": 100, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "filesystem": { + "additionalProperties": false, + "description": "Filesystem configuration. See the linked native reference for semantics and availability.", + "properties": { + "allowManagedReadPathsOnly": { + "description": "When true (set in managed settings), only allowRead paths from policySettings are used.", + "title": "Allow Managed Read Paths Only", + "type": "boolean", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "allowRead": { + "description": "Paths to re-allow reading within denyRead regions. Takes precedence over denyRead for matching paths.", + "items": { + "description": "Allow Read value configuration. See the linked native reference for semantics and availability.", + "title": "Allow Read value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Allow Read", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "allowWrite": { + "description": "Additional paths to allow writing within the sandbox. Merged with paths from Edit(...) allow permission rules.", + "items": { + "description": "Allow Write value configuration. See the linked native reference for semantics and availability.", + "title": "Allow Write value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Allow Write", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "denyRead": { + "description": "Additional paths to deny reading within the sandbox. Merged with paths from Read(...) deny permission rules.", + "items": { + "description": "Deny Read value configuration. See the linked native reference for semantics and availability.", + "title": "Deny Read value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Deny Read", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "denyWrite": { + "description": "Additional paths to deny writing within the sandbox. Merged with paths from Edit(...) deny permission rules.", + "items": { + "description": "Deny Write value configuration. See the linked native reference for semantics and availability.", + "title": "Deny Write value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Deny Write", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "disabled": { + "description": "macOS and Linux/WSL only: skip filesystem isolation entirely while keeping network and seccomp isolation. Ignored on native Windows, where the sandboxed process runs as a separate user with no inherent rights, so skipping the filesystem rules would withhold every access grant rather than loosen them — filesystem isolation stays on there. Sandboxed commands get unrestricted read/write access to the host filesystem; network egress is still confined to network.allowedDomains. Intended for deployments whose goal is egress control rather than filesystem containment. Does not change Bash prompting: sandbox.autoAllowBashIfSandboxed is independent and still defaults to true, so set it to false to keep prompting for sandboxed commands. Drops the read protection from filesystem.denyRead and credentials.files deny entries for sandboxed commands, since both are enforced by the filesystem layer this turns off; credentials.files mask entries (sentinel binds) and credentials.envVars deny/mask are unaffected. Only honored from user, managed/policy, or CLI (`--settings`) settings — project settings (.claude/settings.json and .claude/settings.local.json) are ignored. If managed settings configure sandbox.filesystem at all, or list any sandbox.credentials.files deny entry, only managed settings can set this: an admin who deployed filesystem restrictions must not have them switched off by a user-writable file. (sandbox.credentials.envVars and credentials.files mask entries do not pin it — env scrubbing and sentinel binds are independent of the filesystem layer and survive this setting.) When unset, filesystem isolation stays on.", + "title": "Disabled", + "type": "boolean", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "title": "Filesystem", + "type": "object", + "x-clicky-order": 110, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "ignoreViolations": { + "additionalProperties": { + "description": "Ignore Violations value configuration. See the linked native reference for semantics and availability.", + "items": { + "description": "Ignore Violations value value configuration. See the linked native reference for semantics and availability.", + "title": "Ignore Violations value value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Ignore Violations value", + "type": "array", + "x-array-display": "list", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "Ignore Violations configuration. See the linked native reference for semantics and availability.", + "title": "Ignore Violations", + "type": "object", + "x-clicky-order": 120, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "network": { + "additionalProperties": false, + "description": "Network configuration. See the linked native reference for semantics and availability.", + "properties": { + "allowAllUnixSockets": { + "description": "If true, allow all Unix sockets (disables blocking on both platforms).", + "title": "Allow All Unix Sockets", + "type": "boolean", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "allowLocalBinding": { + "description": "Allow Local Binding configuration. See the linked native reference for semantics and availability.", + "title": "Allow Local Binding", + "type": "boolean", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "allowMachLookup": { + "description": "macOS only: Additional XPC/Mach service names to allow looking up. Supports trailing-wildcard prefix matching (e.g., \"com.apple.coresimulator.*\"). Needed for tools that communicate via XPC such as the iOS Simulator or Playwright.", + "items": { + "description": "Allow Mach Lookup value configuration. See the linked native reference for semantics and availability.", + "title": "Allow Mach Lookup value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Allow Mach Lookup", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "allowManagedDomainsOnly": { + "description": "When true (and set in managed settings), only allowedDomains and WebFetch(domain:...) allow rules from managed settings are respected. User, project, local, and flag settings domains are ignored. Denied domains are still respected from all sources.", + "title": "Allow Managed Domains Only", + "type": "boolean", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "allowUnixSockets": { + "description": "macOS only: Unix socket paths to allow. Ignored on Linux (seccomp cannot filter by path).", + "items": { + "description": "Allow Unix Sockets value configuration. See the linked native reference for semantics and availability.", + "title": "Allow Unix Sockets value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Allow Unix Sockets", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "allowedDomains": { + "description": "Allowed Domains configuration. See the linked native reference for semantics and availability.", + "items": { + "description": "Allowed Domains value configuration. See the linked native reference for semantics and availability.", + "title": "Allowed Domains value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Allowed Domains", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "deniedDomains": { + "description": "Domains that are always blocked, even if matched by allowedDomains. Supports the same wildcard syntax as allowedDomains. Merged from all settings sources regardless of allowManagedDomainsOnly.", + "items": { + "description": "Denied Domains value configuration. See the linked native reference for semantics and availability.", + "title": "Denied Domains value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Denied Domains", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 70, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "httpProxyPort": { + "description": "HTTP Proxy Port configuration. See the linked native reference for semantics and availability.", + "title": "HTTP Proxy Port", + "type": "number", + "x-clicky-order": 80, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "socksProxyPort": { + "description": "Socks Proxy Port configuration. See the linked native reference for semantics and availability.", + "title": "Socks Proxy Port", + "type": "number", + "x-clicky-order": 90, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "strictAllowlist": { + "description": "When true, the sandbox runtime deterministically denies hosts not in allowedDomains instead of prompting. Enforced for sandboxed commands only — in-process tools such as WebFetch are not gated by this setting. Only honored from user, managed/policy, or CLI (--settings) settings — project settings (.claude/settings.json and .claude/settings.local.json) are ignored.", + "title": "Strict Allowlist", + "type": "boolean", + "x-clicky-order": 100, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "tlsTerminate": { + "additionalProperties": false, + "description": "[EXPERIMENTAL] Enable in-process TLS termination so the per-request filter can see HTTPS request bodies. Provide a CA cert+key, or omit both to have sandbox-runtime generate an ephemeral one for the session. On native Windows an ephemeral CA cannot pass the sandbox trust check, so omitting the paths uses a persistent CA managed by the sandbox runtime (set up and trusted via /sandbox install); configured paths are passed to the sandbox runtime verbatim, which rejects a bad or incomplete pair at sandbox initialization. Only honored from user, managed/policy, or CLI (`--settings`) settings — project settings (.claude/settings.json and .claude/settings.local.json) are ignored.", + "properties": { + "caCertPath": { + "description": "Ca Cert Path configuration. See the linked native reference for semantics and availability.", + "title": "Ca Cert Path", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "caKeyPath": { + "description": "Ca Key Path configuration. See the linked native reference for semantics and availability.", + "title": "Ca Key Path", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "title": "Tls Terminate", + "type": "object", + "x-clicky-order": 110, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "title": "Network", + "type": "object", + "x-clicky-order": 130, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "ripgrep": { + "additionalProperties": false, + "description": "Custom ripgrep configuration for bundled ripgrep support. Only honored from user, managed/policy, or CLI (--settings) settings — project settings (.claude/settings.json and .claude/settings.local.json) are ignored.", + "properties": { + "args": { + "description": "Args configuration. See the linked native reference for semantics and availability.", + "items": { + "description": "Args value configuration. See the linked native reference for semantics and availability.", + "title": "Args value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Args", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "command": { + "description": "Command configuration. See the linked native reference for semantics and availability.", + "title": "Command", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "command" + ], + "title": "Ripgrep", + "type": "object", + "x-clicky-order": 140, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "socatPath": { + "description": "Linux/WSL only: Absolute path to the socat binary used for the sandbox network proxy. Overrides auto-detection via PATH. Only honored from admin-controlled managed settings.", + "title": "Socat Path", + "type": "string", + "x-clicky-order": 150, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "title": "Sandbox", + "type": "object", + "x-clicky-order": 1250, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "showClearContextOnPlanAccept": { + "description": "When true, the plan-approval dialog offers a \"clear context\" option. Defaults to false.", + "title": "Show Clear Context On Plan Accept", + "type": "boolean", + "x-clicky-order": 1260, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "showMessageTimestamps": { + "description": "Stamp each message with its arrival time", + "title": "Show Message Timestamps", + "type": "boolean", + "x-clicky-order": 1270, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "showThinkingSummaries": { + "description": "Request API-side thinking summaries and show them in the conversation and in the transcript view (ctrl+o). Set explicitly to override the default for your install.", + "title": "Show Thinking Summaries", + "type": "boolean", + "x-clicky-order": 1280, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "showTurnDuration": { + "description": "Show \"Cooked for Nm Ns\" after each assistant turn", + "title": "Show Turn Duration", + "type": "boolean", + "x-clicky-order": 1290, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "skillListingBudgetFraction": { + "description": "Fraction of the context window (in characters) reserved for the skill listing sent to Claude (default: 0.01 = 1%). When the listing exceeds this, descriptions are shortened to fit. Raise to opt in to higher per-turn context cost.", + "title": "Skill Listing Budget Fraction", + "type": "number", + "x-clicky-order": 1300, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "skillListingMaxDescChars": { + "description": "Per-skill description character cap in the skill listing sent to Claude (default: 1536). Descriptions longer than this are truncated. Raise to opt in to higher per-turn context cost.", + "title": "Skill Listing Max Desc Chars", + "type": "number", + "x-clicky-order": 1310, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "skillOverrides": { + "additionalProperties": { + "description": "Skill Overrides value configuration. See the linked native reference for semantics and availability.", + "enum": [ + "on", + "name-only", + "user-invocable-only", + "off" + ], + "title": "Skill Overrides value", + "type": "string", + "x-enum-display": "segmented", + "x-enum-labels": { + "name-only": "Name only", + "off": "Off", + "on": "On", + "user-invocable-only": "User invocable only" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "Per-skill listing overrides keyed by skill name. \"name-only\" lists the skill without its description; \"user-invocable-only\" hides it from the model but keeps /name; \"off\" hides it from both. Absent = on.", + "title": "Skill Overrides", + "type": "object", + "x-clicky-order": 1320, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "skipDangerousModePermissionPrompt": { + "description": "Whether the user has accepted the bypass permissions mode dialog", + "title": "Skip Dangerous Mode Permission Prompt", + "type": "boolean", + "x-clicky-order": 1330, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "skipWebFetchPreflight": { + "description": "Skip the WebFetch blocklist check for enterprise environments with restrictive security policies", + "title": "Skip Web Fetch Preflight", + "type": "boolean", + "x-clicky-order": 1340, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "spellcheck": { + "additionalProperties": { + "description": "Spellcheck value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Spellcheck value", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "Underline misspelled words in the prompt input as you type, using an installed aspell, hunspell or ispell (off unless \"enabled\" is true; does nothing if none is installed). Read from user, flag and managed settings only (the whole block from the highest-precedence of those applies); ignored in project .claude/settings.json and .claude/settings.local.json.", + "properties": { + "checker": { + "description": "Which spell checker to run: \"aspell\", \"hunspell\", \"ispell\", or \"auto\" (default) for the first of those found on PATH", + "title": "Checker", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "color": { + "description": "Color of misspelled words (they are also underlined): a terminal color name such as \"red\" or \"magenta\", \"#rrggbb\", \"rgb(r,g,b)\", \"ansi256(n)\" or \"ansi:\u003cname\u003e\". Default: the theme's error color", + "title": "Color", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "enabled": { + "description": "Turn on spell checking of the prompt input (default: false)", + "title": "Enabled", + "type": "boolean", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "language": { + "description": "Dictionary to use, passed to the checker as-is (aspell --lang, hunspell -d, ispell -d), e.g. \"en_GB\"; names are checker-specific (letters, digits and _ - . , only). Default: the checker's own default", + "title": "Language", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "title": "Spellcheck", + "type": "object", + "x-clicky-order": 1350, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "spinnerTipsEnabled": { + "description": "Whether to show tips in the spinner", + "title": "Spinner Tips Enabled", + "type": "boolean", + "x-clicky-order": 1360, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "spinnerTipsOverride": { + "additionalProperties": { + "description": "Spinner Tips Override value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Spinner Tips Override value", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "Add your organization's own tips to the spinner tip rotation. tips: strings or {id, text, cooldownSessions?, priority?} objects; tipsFile: a JSON file of the same; label: prefix shown before your tips; excludeDefault: if true, only show your tips (default: false).", + "properties": { + "excludeDefault": { + "description": "Exclude Default configuration. See the linked native reference for semantics and availability.", + "title": "Exclude Default", + "type": "boolean", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "label": { + "description": "Prefix shown before your tips in the spinner (default \"Tip\")", + "title": "Label", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "tips": { + "description": "Tips configuration. See the linked native reference for semantics and availability.", + "items": { + "anyOf": [ + { + "description": "Tips value configuration. See the linked native reference for semantics and availability.", + "title": "Tips value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": { + "description": "Tips value value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Tips value value", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "Tips value configuration. See the linked native reference for semantics and availability.", + "title": "Tips value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + ], + "description": "Tips value configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Tips value", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Tips", + "type": "array", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "tipsFile": { + "description": "Absolute or ~/ local path to a JSON file holding an array of tips (same shapes as `tips`); honored from user, --settings and on-disk managed settings only. Read once per CLI process (restart to pick up edits).", + "title": "Tips File", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "title": "Spinner Tips Override", + "type": "object", + "x-clicky-order": 1370, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "spinnerVerbs": { + "additionalProperties": false, + "description": "Customize spinner verbs. mode: \"append\" adds verbs to defaults, \"replace\" uses only your verbs.", + "properties": { + "mode": { + "description": "Mode configuration. See the linked native reference for semantics and availability.", + "enum": [ + "append", + "replace" + ], + "title": "Mode", + "type": "string", + "x-clicky-order": 10, + "x-enum-display": "segmented", + "x-enum-labels": { + "append": "Append", + "replace": "Replace" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "verbs": { + "description": "Verbs configuration. See the linked native reference for semantics and availability.", + "items": { + "description": "Verbs value configuration. See the linked native reference for semantics and availability.", + "title": "Verbs value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Verbs", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "mode", + "verbs" + ], + "title": "Spinner Verbs", + "type": "object", + "x-clicky-order": 1380, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "sshConfigs": { + "description": "SSH connection configurations for remote environments. Typically set in managed settings by enterprise administrators to pre-configure SSH connections for team members.", + "items": { + "additionalProperties": false, + "description": "Ssh Configs value configuration. See the linked native reference for semantics and availability.", + "properties": { + "id": { + "description": "Unique identifier for this SSH config. Used to match configs across settings sources.", + "title": "Id", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "name": { + "description": "Display name for the SSH connection", + "title": "Name", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "sshHost": { + "description": "SSH host in format \"user\\@hostname\" or \"hostname\", or a host alias from ~/.ssh/config", + "title": "Ssh Host", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "sshIdentityFile": { + "description": "Path to SSH identity file (private key)", + "title": "Ssh Identity File", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "sshPort": { + "description": "SSH port (default: 22)", + "title": "Ssh Port", + "type": "number", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "startDirectory": { + "description": "Default working directory on the remote host. Supports tilde expansion (e.g. ~/projects). If not specified, defaults to the remote user home directory. Can be overridden by the [dir] positional argument in `claude ssh \u003cconfig\u003e [dir]`.", + "title": "Start Directory", + "type": "string", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "id", + "name", + "sshHost" + ], + "title": "Ssh Configs value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Ssh Configs", + "type": "array", + "x-clicky-order": 1390, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "statusLine": { + "additionalProperties": false, + "description": "Custom status line display configuration", + "properties": { + "command": { + "description": "Command configuration. See the linked native reference for semantics and availability.", + "title": "Command", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "hideVimModeIndicator": { + "description": "Hide the built-in `-- INSERT --` / `-- VISUAL --` indicator below the prompt. Use this when your status line script renders `vim.mode` itself.", + "title": "Hide Vim Mode Indicator", + "type": "boolean", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "padding": { + "description": "Padding configuration. See the linked native reference for semantics and availability.", + "title": "Padding", + "type": "number", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "refreshInterval": { + "description": "Re-run the status line command every N seconds in addition to event-driven updates", + "title": "Refresh Interval", + "type": "number", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "command", + "description": "Type configuration. See the linked native reference for semantics and availability.", + "title": "Type", + "type": "string", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type", + "command" + ], + "title": "Status Line", + "type": "object", + "x-clicky-order": 1400, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "strictKnownMarketplaces": { + "description": "Enterprise strict list of allowed marketplace sources. When set in managed settings, ONLY these sources can be added as marketplaces. Entries match exactly, except that a github entry may use the owner-wildcard form {\"source\":\"github\",\"repo\":\"owner/*\"} to allow every repository under that owner. The check happens BEFORE downloading, so blocked sources never touch the filesystem. Note: this is a policy gate only — it does NOT register marketplaces. To pre-register allowed marketplaces for users, also set extraKnownMarketplaces.", + "items": { + "anyOf": [ + { + "additionalProperties": false, + "description": "Strict Known Marketplaces value configuration. See the linked native reference for semantics and availability.", + "properties": { + "headers": { + "additionalProperties": { + "description": "Headers value configuration. See the linked native reference for semantics and availability.", + "title": "Headers value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "Custom HTTP headers (e.g., for authentication)", + "title": "Headers", + "type": "object", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "headersHelper": { + "description": "Command that prints a JSON object of HTTP headers (e.g. a short-lived auth token). Its output overrides `headers` and, like `headers`, is inherited by same-origin archive downloads from this marketplace. Runs from a fixed directory (the Claude config home, never the session's), so give a bare command found via PATH or an absolute path; it is re-run on later refreshes of this marketplace.", + "title": "Headers Helper", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "url", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "Direct URL to marketplace.json file", + "title": "Url", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "url" + ], + "title": "Strict Known Marketplaces value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Strict Known Marketplaces value configuration. See the linked native reference for semantics and availability.", + "properties": { + "path": { + "description": "Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)", + "title": "Path", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "ref": { + "description": "Git branch or tag to use (e.g., \"main\", \"v1.0.0\"). Defaults to repository default branch.", + "title": "Ref", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "repo": { + "description": "GitHub repository in owner/repo format. ONLY in the managed-settings policy lists (strictKnownMarketplaces / blockedMarketplaces) the owner-wildcard form \"owner/*\" matches every repository under exactly that owner. Everywhere else (marketplace add, extraKnownMarketplaces, known_marketplaces.json) the value must name a single repository — a wildcard is taken literally and fails to clone.", + "title": "Repo", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "skipLfs": { + "description": "Has no effect; accepted so existing settings keep working. Claude Code's own git never downloads Git LFS content: LFS-tracked files in the marketplace repository are checked out as pointer files whether or not this is set, and adding or updating the marketplace says how many were. To fetch their content, run `git lfs pull` in the marketplace's checkout under ~/.claude/plugins/marketplaces/.", + "title": "Skip Lfs", + "type": "boolean", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "github", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "sparsePaths": { + "description": "Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [\".claude-plugin\", \"plugins\"]. If omitted, the full repository is cloned.", + "items": { + "description": "Sparse Paths value configuration. See the linked native reference for semantics and availability.", + "title": "Sparse Paths value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Sparse Paths", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "repo" + ], + "title": "Strict Known Marketplaces value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Strict Known Marketplaces value configuration. See the linked native reference for semantics and availability.", + "properties": { + "path": { + "description": "Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)", + "title": "Path", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "ref": { + "description": "Git branch or tag to use (e.g., \"main\", \"v1.0.0\"). Defaults to repository default branch.", + "title": "Ref", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "skipLfs": { + "description": "Has no effect; accepted so existing settings keep working. Claude Code's own git never downloads Git LFS content: LFS-tracked files in the marketplace repository are checked out as pointer files whether or not this is set, and adding or updating the marketplace says how many were. To fetch their content, run `git lfs pull` in the marketplace's checkout under ~/.claude/plugins/marketplaces/.", + "title": "Skip Lfs", + "type": "boolean", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "git", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "sparsePaths": { + "description": "Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [\".claude-plugin\", \"plugins\"]. If omitted, the full repository is cloned.", + "items": { + "description": "Sparse Paths value configuration. See the linked native reference for semantics and availability.", + "title": "Sparse Paths value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Sparse Paths", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "Full git repository URL", + "title": "Url", + "type": "string", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "url" + ], + "title": "Strict Known Marketplaces value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Strict Known Marketplaces value configuration. See the linked native reference for semantics and availability.", + "properties": { + "package": { + "description": "npm package containing marketplace.json (e.g. \"\\@acme/claude-marketplace\"). In strictKnownMarketplaces / blockedMarketplaces an entry also governs plugins installed straight from the npm marketplace (`\u003cpackage\u003e\\@npm`): an exact package name matches that package, and \"\\@acme/*\" matches every package under the scope.", + "title": "Package", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "registry": { + "description": "Registry URL. When adding a marketplace: a one-off registry override (otherwise your npm configuration decides). In a policy entry: the origin and path prefix the package's RESOLVED tarball URL must fall under (e.g. \"https://npm.example.com/api/npm/internal/\").", + "title": "Registry", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "npm", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "version": { + "description": "Version or range to fetch (e.g. \"1.4.0\", \"^1.4\"); defaults to the latest dist-tag", + "title": "Version", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "package" + ], + "title": "Strict Known Marketplaces value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Strict Known Marketplaces value configuration. See the linked native reference for semantics and availability.", + "properties": { + "path": { + "description": "Local file path to marketplace.json", + "title": "Path", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "file", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "path" + ], + "title": "Strict Known Marketplaces value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Strict Known Marketplaces value configuration. See the linked native reference for semantics and availability.", + "properties": { + "path": { + "description": "Local directory containing .claude-plugin/marketplace.json", + "title": "Path", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "directory", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "path" + ], + "title": "Strict Known Marketplaces value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Strict Known Marketplaces value configuration. See the linked native reference for semantics and availability.", + "properties": { + "source": { + "const": "skills-dir", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source" + ], + "title": "Strict Known Marketplaces value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Strict Known Marketplaces value configuration. See the linked native reference for semantics and availability.", + "properties": { + "hostPattern": { + "description": "Regex pattern to match the host/domain extracted from any marketplace source type. For github sources, matches against github.com. For git sources (SSH or HTTPS), extracts the hostname from the URL. Use in strictKnownMarketplaces to allow all marketplaces from a specific host (e.g., \"^github\\.mycompany\\.com$\").", + "title": "Host Pattern", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "hostPattern", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "hostPattern" + ], + "title": "Strict Known Marketplaces value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Strict Known Marketplaces value configuration. See the linked native reference for semantics and availability.", + "properties": { + "pathPattern": { + "description": "Regex pattern matched against the .path field of file and directory sources. Use in strictKnownMarketplaces to allow filesystem-based marketplaces alongside hostPattern restrictions for network sources. Use \".*\" to allow all filesystem paths, or a narrower pattern (e.g., \"^/opt/approved/\") to restrict to specific directories.", + "title": "Path Pattern", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "pathPattern", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "pathPattern" + ], + "title": "Strict Known Marketplaces value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Strict Known Marketplaces value configuration. See the linked native reference for semantics and availability.", + "properties": { + "name": { + "description": "Marketplace name. Must match the extraKnownMarketplaces key (enforced); the synthetic manifest is written under this name. Same validation as PluginMarketplaceSchema plus reserved-name rejection — validateOfficialNameSource runs after the disk write, too late to clean up.", + "title": "Name", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "owner": { + "additionalProperties": false, + "description": "Owner configuration. See the linked native reference for semantics and availability.", + "properties": { + "email": { + "description": "Contact email for support or feedback", + "title": "Email", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "name": { + "description": "Display name of the plugin author or organization", + "title": "Name", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "Website, GitHub profile, or organization URL", + "title": "Url", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "name" + ], + "title": "Owner", + "type": "object", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "plugins": { + "description": "Plugin entries declared inline in settings.json", + "items": { + "additionalProperties": false, + "description": "Plugins value configuration. See the linked native reference for semantics and availability.", + "properties": { + "description": { + "description": "Description configuration. See the linked native reference for semantics and availability.", + "title": "Description", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "headers": { + "additionalProperties": { + "description": "Headers value configuration. See the linked native reference for semantics and availability.", + "title": "Headers value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "HTTP headers sent when downloading this entry's `archive` source.", + "title": "Headers", + "type": "object", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "headersHelper": { + "description": "Command that prints a JSON object of HTTP headers for downloading this entry's `archive` source. Runs only when a user explicitly installs or updates this plugin. Unlike a catalog entry, an entry written here does not need `strict: false`: it is declared in a settings file, which has no manifest fields to inline. A declaration in project settings is not operator-authored, so request-routing and client-identity header names are still filtered there. Use an absolute path.", + "title": "Headers Helper", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "name": { + "description": "Plugin name as it appears in the target repository", + "title": "Name", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "anyOf": [ + { + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "package": { + "description": "Package name (or url, or local path, or anything else that can be passed to `npm` as a package)", + "title": "Package", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "registry": { + "description": "Custom NPM registry URL (defaults to using system default, likely npmjs.org)", + "title": "Registry", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "npm", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "version": { + "description": "Specific version or version range (e.g., ^1.0.0, ~2.1.0)", + "title": "Version", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "package" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "ref": { + "description": "Git branch or tag to use (e.g., \"main\", \"v1.0.0\"). Defaults to repository default branch.", + "title": "Ref", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "sha": { + "description": "Specific commit SHA to use", + "title": "Sha", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "url", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "Full git repository URL (https:// or git\\@)", + "title": "Url", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "url" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "ref": { + "description": "Git branch or tag to use (e.g., \"main\", \"v1.0.0\"). Defaults to repository default branch.", + "title": "Ref", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "repo": { + "description": "GitHub repository in owner/repo format", + "title": "Repo", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "sha": { + "description": "Specific commit SHA to use", + "title": "Sha", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "github", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "repo" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "path": { + "description": "Subdirectory within the repo containing the plugin (e.g., \"tools/claude-plugin\"). Cloned sparsely using partial clone (--filter=tree:0) to minimize bandwidth for monorepos.", + "title": "Path", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "ref": { + "description": "Git branch or tag to use (e.g., \"main\", \"v1.0.0\"). Defaults to repository default branch.", + "title": "Ref", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "sha": { + "description": "Specific commit SHA to use", + "title": "Sha", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "git-subdir", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "Git repository: GitHub owner/repo shorthand, https://, or git\\@ URL", + "title": "Url", + "type": "string", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "url", + "path" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "sha256": { + "description": "SHA-256 digest of the archive. When set, every download is verified against it and the install is refused on mismatch. It also serves as the version identity when neither plugin.json nor the marketplace entry declares a `version`. Recommended. Note the update signal is the version string (plugin.json version, else the entry version, else this digest) — changing only the digest while a version is declared does not trigger an update.", + "title": "Sha256", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "archive", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "HTTPS URL of a zip archive containing the plugin. The plugin root (the directory holding .claude-plugin/) may be at the top of the archive or nested one directory deep — a single wrapping directory is stripped.", + "title": "Url", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "url" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "command": { + "description": "Shell command that prints the absolute path of the plugin directory on stdout (exactly one line) and exits 0. It must leave a complete plugin in that directory before exiting; the directory is copied into the plugin cache, so the printed path may change between runs (it is re-resolved on every install and update, and once per session in the background). Runs through the platform shell (sh on macOS/Linux, cmd.exe on Windows) from the user's home directory with Claude Code's subprocess environment.", + "title": "Command", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "mode": { + "description": "copy (default): the printed directory is copied into the plugin cache and content-hashed, so it may be deleted afterwards. link: the cache entry links to the printed directory in place (no copy, no size limit; macOS/Linux) — for large exports; the directory must then stay valid while Claude Code runs, and a different printed path is what signals new content.", + "enum": [ + "copy", + "link" + ], + "title": "Mode", + "type": "string", + "x-clicky-order": 20, + "x-enum-display": "segmented", + "x-enum-labels": { + "copy": "Copy", + "link": "Link" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "command", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "timeout": { + "description": "Seconds to wait for the command before giving up (default: 60)", + "title": "Timeout", + "type": "number", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "command" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Source configuration. See the linked native reference for semantics and availability.", + "properties": { + "error": { + "description": "Error configuration. See the linked native reference for semantics and availability.", + "title": "Error", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "unsupported", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source" + ], + "title": "Source", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + ], + "description": "Where to fetch the plugin from. Must be a remote source — relative paths have no marketplace repository to resolve against.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Source", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "strict": { + "description": "Strict configuration. See the linked native reference for semantics and availability.", + "title": "Strict", + "type": "boolean", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "version": { + "description": "Version configuration. See the linked native reference for semantics and availability.", + "title": "Version", + "type": "string", + "x-clicky-order": 70, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "name", + "source" + ], + "title": "Plugins value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Plugins", + "type": "array", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "source": { + "const": "settings", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "name", + "plugins" + ], + "title": "Strict Known Marketplaces value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + ], + "description": "Strict Known Marketplaces value configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Strict Known Marketplaces value", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Strict Known Marketplaces", + "type": "array", + "x-clicky-order": 1410, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "strictPluginOnlyCustomization": { + "anyOf": [ + { + "description": "Strict Plugin Only Customization configuration. See the linked native reference for semantics and availability.", + "title": "Strict Plugin Only Customization", + "type": "boolean", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "description": "Strict Plugin Only Customization configuration. See the linked native reference for semantics and availability.", + "items": { + "description": "Strict Plugin Only Customization value configuration. See the linked native reference for semantics and availability.", + "enum": [ + "skills", + "agents", + "hooks", + "mcp" + ], + "title": "Strict Plugin Only Customization value", + "type": "string", + "x-enum-display": "segmented", + "x-enum-labels": { + "agents": "Agents", + "hooks": "Hooks", + "mcp": "MCP", + "skills": "Skills" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Strict Plugin Only Customization", + "type": "array", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + ], + "description": "When set in managed settings, blocks non-plugin customization sources for the listed surfaces. Array form locks specific surfaces (e.g. [\"skills\", \"hooks\"]); `true` locks all four; `false` is an explicit no-op. Blocked: ~/.claude/{surface}/, .claude/{surface}/ (project), settings.json hooks, .mcp.json. NOT blocked: managed (policySettings) sources, plugin-provided customizations. Composes with strictKnownMarketplaces for end-to-end admin control — plugins gated by marketplace allowlist, everything else blocked here.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Strict Plugin Only Customization", + "x-clicky-order": 1420, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "subagentPromptCacheTtl": { + "description": "Prompt cache TTL for everything outside the main conversation — subagents, workflows, background and helper requests: \"5m\" or \"1h\". Unset = automatic (5 minutes unless ENABLE_PROMPT_CACHING_1H=1). The CLAUDE_CODE_SUBAGENT_PROMPT_CACHE_TTL environment variable takes precedence.", + "enum": [ + "5m", + "1h" + ], + "title": "Subagent Prompt Cache Ttl", + "type": "string", + "x-clicky-order": 1430, + "x-enum-display": "segmented", + "x-enum-labels": { + "1h": "1h", + "5m": "5m" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "subagentStatusLine": { + "additionalProperties": false, + "description": "Custom per-subagent status line shown in the agent panel; receives row context as JSON on stdin", + "properties": { + "command": { + "description": "Command configuration. See the linked native reference for semantics and availability.", + "title": "Command", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "command", + "description": "Type configuration. See the linked native reference for semantics and availability.", + "title": "Type", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type", + "command" + ], + "title": "Subagent Status Line", + "type": "object", + "x-clicky-order": 1440, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "switchModelsOnFlag": { + "description": "When safeguards flag a message, automatically switch to a different model to keep chatting. When off, your session will pause instead.", + "title": "Switch Models On Flag", + "type": "boolean", + "x-clicky-order": 1450, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "syncClaudeAiPlugins": { + "description": "Set to false to turn off syncing of the plugins you have enabled on claude.ai. In your user settings (or managed settings): nothing more is downloaded, previously synced plugins (~/.claude/plugins/synced) are hidden from every session started afterwards and moved to ~/.claude/plugins/.trash at the next launch (deleted after cleanupPeriodDays; re-downloaded, not restored, if you re-enable). In .claude/settings.local.json or --settings: downloads stop and synced plugins are hidden for sessions in that workspace or invocation only (nothing is moved). Not read from project settings (.claude/settings.json). Only false is honored — the feature is enabled server-side for your account, so setting true does not turn it on early. While it is on, synced plugins load in every session like plugins you installed yourself (a plugin you installed with the same name takes precedence), are re-synced at each launch, and are removed when you disable them on claude.ai. Only applies when signed in with your Claude account.", + "title": "Sync Claude Ai Plugins", + "type": "boolean", + "x-clicky-order": 1460, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "syncClaudeAiSkills": { + "description": "Set to false to turn off syncing of the skills you have enabled on claude.ai. In your user settings (or managed settings): nothing more is downloaded, previously synced skills (~/.claude/skills/synced) can no longer be run, are hidden from every session started afterwards, and are moved to ~/.claude/skills/.trash at the next launch (deleted after cleanupPeriodDays; re-downloaded, not restored, if you re-enable). In .claude/settings.local.json or --settings: downloads stop and synced skills are blocked and hidden for sessions in that workspace or invocation only (nothing is moved). Not read from project settings (.claude/settings.json). Only false is honored — the feature is enabled server-side for your account, so setting true does not turn it on early. While it is on, synced skills are available in every session, re-synced every 10 minutes, and removed when you disable them on claude.ai. Only applies when signed in with your Claude account.", + "title": "Sync Claude Ai Skills", + "type": "boolean", + "x-clicky-order": 1470, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "syntaxHighlightingDisabled": { + "description": "Whether to disable syntax highlighting in diffs", + "title": "Syntax Highlighting Disabled", + "type": "boolean", + "x-clicky-order": 1480, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "taskOutputMaxChars": { + "description": "Deprecated: no longer has any effect (the TaskOutput tool was removed). Read a background task's output file with the Read tool instead.", + "title": "Task Output Max Chars", + "type": "number", + "x-clicky-order": 1490, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "teammateMode": { + "description": "How spawned teammates execute (tmux, iterm2, in-process, auto)", + "enum": [ + "auto", + "tmux", + "iterm2", + "in-process" + ], + "title": "Teammate Mode", + "type": "string", + "x-clicky-order": 1500, + "x-enum-display": "segmented", + "x-enum-labels": { + "auto": "Auto", + "in-process": "In process", + "iterm2": "Iterm2", + "tmux": "Tmux" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "terminalProgressBarEnabled": { + "description": "Emit OSC 9;4 progress sequences during long operations", + "title": "Terminal Progress Bar Enabled", + "type": "boolean", + "x-clicky-order": 1510, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "terminalTitleFromRename": { + "description": "Whether /rename updates the terminal tab title (defaults to true). Set to false to keep auto-generated topic titles.", + "title": "Terminal Title From Rename", + "type": "boolean", + "x-clicky-order": 1520, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "theme": { + "description": "Color theme for the UI", + "title": "Theme", + "type": "string", + "x-clicky-order": 1530, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "timeFormat": { + "description": "Clock format for times shown in the UI: \"auto\" (default, follows the locale), \"12-hour\", \"24-hour\", \"24-hour-utc\" (\"18:05Z\"), or a strftime pattern such as \"%H:%M\" (any value containing \"%\"; other values read as \"auto\"). A pattern replaces the time everywhere; message timestamps show only the pattern, so include %Y-%m-%d for the date. /config offers the presets; a pattern is set here.", + "title": "Time Format", + "type": "string", + "x-clicky-order": 1540, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "timeZone": { + "description": "IANA time zone for times shown in the UI, e.g. \"UTC\" or \"Europe/Dublin\". Default: the system time zone. An unknown name falls back to the system time zone.", + "title": "Time Zone", + "type": "string", + "x-clicky-order": 1550, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "todoFeatureEnabled": { + "description": "Enable the todo / task tracking panel", + "title": "Todo Feature Enabled", + "type": "boolean", + "x-clicky-order": 1560, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "tui": { + "description": "Terminal UI renderer. \"fullscreen\" uses the flicker-free alt-screen renderer with virtualized scrollback (equivalent to CLAUDE_CODE_NO_FLICKER=1). \"default\" uses the classic main-screen renderer.", + "enum": [ + "default", + "fullscreen" + ], + "title": "Tui", + "type": "string", + "x-clicky-order": 1570, + "x-enum-display": "segmented", + "x-enum-labels": { + "default": "Default", + "fullscreen": "Fullscreen" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "ultracode": { + "description": "Enable ultracode for the session: xhigh effort plus standing dynamic-workflow orchestration. Session-scoped — typically provided via --settings or the apply_flag_settings control request; interactive toggles never persist it. Requires workflows to be enabled and an xhigh-capable model.", + "title": "Ultracode", + "type": "boolean", + "x-clicky-order": 1580, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "verbose": { + "description": "Show full tool output instead of truncated summaries", + "title": "Verbose", + "type": "boolean", + "x-clicky-order": 1590, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "viewMode": { + "description": "Default transcript view mode on startup", + "enum": [ + "default", + "verbose", + "focus" + ], + "title": "View Mode", + "type": "string", + "x-clicky-order": 1600, + "x-enum-display": "segmented", + "x-enum-labels": { + "default": "Default", + "focus": "Focus", + "verbose": "Verbose" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "vimInsertModeRemaps": { + "additionalProperties": { + "description": "Vim Insert Mode Remaps value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Vim Insert Mode Remaps value", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "Vim INSERT-mode key-sequence remaps, e.g. {\"jj\": \"\u003cEsc\u003e\"}. Each key is exactly two printable characters typed in sequence; \"\u003cEsc\u003e\" (return to NORMAL mode) is the only supported target. Applies when editorMode is \"vim\".", + "title": "Vim Insert Mode Remaps", + "type": "object", + "x-clicky-order": 1610, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "voice": { + "additionalProperties": false, + "description": "Voice mode settings (hold-to-talk / tap-to-toggle dictation)", + "properties": { + "autoSubmit": { + "description": "Submit the prompt when hold-to-talk is released (hold mode only)", + "title": "Auto Submit", + "type": "boolean", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "enabled": { + "description": "Enabled configuration. See the linked native reference for semantics and availability.", + "title": "Enabled", + "type": "boolean", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "mode": { + "description": "'hold' (default): hold to talk. 'tap': tap to start, tap to stop+submit.", + "enum": [ + "hold", + "tap" + ], + "title": "Mode", + "type": "string", + "x-clicky-order": 30, + "x-enum-display": "segmented", + "x-enum-labels": { + "hold": "Hold", + "tap": "Tap" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "title": "Voice", + "type": "object", + "x-clicky-order": 1620, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "voiceEnabled": { + "description": "Enable voice mode (hold-to-talk dictation)", + "title": "Voice Enabled", + "type": "boolean", + "x-clicky-order": 1630, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "wheelScrollAccelerationEnabled": { + "description": "Ramp mouse-wheel scroll speed during fast scrolls (fullscreen mode only)", + "title": "Wheel Scroll Acceleration Enabled", + "type": "boolean", + "x-clicky-order": 1640, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "workflowKeywordTriggerEnabled": { + "description": "Enable the \"ultracode\" keyword trigger: including the keyword in a prompt opts that turn into the Workflow tool. Set to false to disable the trigger. Default: true.", + "title": "Workflow Keyword Trigger Enabled", + "type": "boolean", + "x-clicky-order": 1650, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "workflowSizeGuideline": { + "description": "Advisory size guideline for the dynamic workflows Claude writes: \"small\" aims for fewer than 5 agents, \"medium\" fewer than 10, \"large\" fewer than 50, and \"unrestricted\" sends no guideline. Unset defaults to \"medium\", or \"small\" on Pro plans. A value here — including from managed settings — takes precedence over the \"Dynamic workflow size\" choice in /config, and that /config row is hidden while a settings file provides the key. This is a guideline, not an enforced limit.", + "enum": [ + "unrestricted", + "small", + "medium", + "large" + ], + "title": "Workflow Size Guideline", + "type": "string", + "x-clicky-order": 1660, + "x-enum-display": "segmented", + "x-enum-labels": { + "large": "Large", + "medium": "Medium", + "small": "Small", + "unrestricted": "Unrestricted" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "worktree": { + "additionalProperties": false, + "description": "Git worktree configuration: the CLI --worktree flag, EnterWorktree and agent isolation, plus the location Claude Code Desktop uses for SSH-session worktrees on this machine.", + "properties": { + "baseRef": { + "description": "Which ref new worktrees branch from. 'fresh' (default) branches from origin/\u003cdefault-branch\u003e for a clean tree. 'head' branches from your current local HEAD so unpushed commits and feature-branch state are present. Applies to --worktree, EnterWorktree, and agent isolation.", + "enum": [ + "fresh", + "head" + ], + "title": "Base Ref", + "type": "string", + "x-clicky-order": 10, + "x-enum-display": "segmented", + "x-enum-labels": { + "fresh": "Fresh", + "head": "Head" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "bgIsolation": { + "description": "Isolation mode for background sessions in this repo. 'worktree' (default) blocks Edit/Write in the main checkout until EnterWorktree is called. 'none' lets background jobs edit the working copy directly.", + "enum": [ + "worktree", + "none" + ], + "title": "Bg Isolation", + "type": "string", + "x-clicky-order": 20, + "x-enum-display": "segmented", + "x-enum-labels": { + "none": "None", + "worktree": "Worktree" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "location": { + "description": "Directory under which Claude Code Desktop creates the worktrees of SSH sessions that run on this machine (an absolute path or one starting with ~/), instead of \u003cproject\u003e/.claude/worktrees. Read by the desktop app from the SSH host user settings; a location chosen in the desktop app's SSH connection settings takes precedence. The CLI (--worktree, EnterWorktree, agent isolation) does not read it yet.", + "title": "Location", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "sparsePaths": { + "description": "Directories to include when creating worktrees, via git sparse-checkout (cone mode). Dramatically faster in large monorepos — only the listed paths are written to disk.", + "items": { + "description": "Sparse Paths value configuration. See the linked native reference for semantics and availability.", + "title": "Sparse Paths value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Sparse Paths", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "symlinkDirectories": { + "description": "Directories to symlink from main repository to worktrees to avoid disk bloat. Must be explicitly configured - no directories are symlinked by default. Common examples: \"node_modules\", \".cache\", \".bin\"", + "items": { + "description": "Symlink Directories value configuration. See the linked native reference for semantics and availability.", + "title": "Symlink Directories value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Symlink Directories", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "title": "Worktree", + "type": "object", + "x-clicky-order": 1670, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "wslInheritsWindowsSettings": { + "description": "When set to true in either admin-only Windows source — the HKLM SOFTWARE/Policies/ClaudeCode registry key or C:/Program Files/ClaudeCode/managed-settings.json — WSL reads managed settings from the full Windows policy chain (HKLM, C:/Program Files/ClaudeCode via DrvFs, HKCU) in addition to /etc/claude-code. Windows sources take priority. The flag is also required in HKCU itself for HKCU policy to apply on WSL (double opt-in: admin enables the chain, user confirms HKCU). On native Windows the flag has no effect.", + "title": "Wsl Inherits Windows Settings", + "type": "boolean", + "x-clicky-order": 1680, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "title": "Settings", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "description": "Native Claude Agent SDK options and Captain bridge arguments used by the Anthropic agent runtime.", + "properties": { + "abortController": { + "additionalProperties": { + "description": "Abort Controller value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Abort Controller value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "description": "JavaScript AbortController used to cancel an SDK query.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "readOnly": true, + "title": "Abort controller", + "type": "object", + "x-captain-option": { + "nativeName": "abortController", + "note": "Captain cancels through its bridge protocol instead of accepting a JavaScript object.", + "support": "unsupported" + }, + "x-clicky-order": 260, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "promptText": { - "title": "Prompt text", "description": "Text sent in a Captain bridge prompt request.", - "type": "string", "x-clicky-section": "prompt", "x-clicky-order": 160, - "x-captain-option": {"nativeName": "prompt.text", "support": "mapped", "specPath": "prompt.user"} + "additionalDirectories": { + "description": "Directories outside cwd that Claude's tools may access.", + "items": { + "description": "Additional Directories value configuration. See the linked native reference for semantics and availability.", + "format": "path", + "title": "Additional Directories value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "title": "Additional directories", + "type": "array", + "x-array-display": "list", + "x-captain-option": { + "nativeName": "additionalDirectories", + "specPath": "permissions.directories", + "support": "mapped" + }, + "x-clicky-order": 80, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "promptAttachments": { - "title": "Prompt attachments", "description": "File and image attachments sent in a Captain bridge prompt request.", - "type": "array", "items": {"type": "object", "additionalProperties": true}, "x-clicky-section": "prompt", "x-clicky-order": 170, "x-array-display": "stacked", - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "prompt.attachments", "support": "mapped", "specPath": "prompt.attachments"} + "agent": { + "description": "Named SDK agent selected as the main execution agent.", + "readOnly": true, + "title": "Agent", + "type": "string", + "x-captain-option": { + "nativeName": "agent", + "note": "Captain does not select a named Claude Agent SDK agent.", + "support": "unsupported" + }, + "x-clicky-order": 270, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "approvalMode": { - "title": "Bridge approval mode", "description": "Whether the bridge asks Captain to broker each caller-tool decision.", - "type": "string", "enum": ["auto", "ask"], "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 180, "x-enum-display": "segmented", - "x-captain-option": {"nativeName": "initialize.approvalMode", "support": "managed", "note": "Captain selects ask only when a caller-tool approval broker is active."} + "agentProgressSummaries": { + "description": "Whether progress summaries are generated for long-running agent work.", + "readOnly": true, + "title": "Agent progress summaries", + "type": "boolean", + "x-captain-option": { + "nativeName": "agentProgressSummaries", + "note": "Captain does not enable native SDK progress summaries.", + "support": "unsupported" + }, + "x-clicky-order": 590, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "mcpServers": { - "title": "MCP servers", "description": "Agent SDK MCP server definitions injected for Captain caller tools.", - "type": "object", "additionalProperties": true, "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 190, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "mcpServers", "support": "managed", "note": "Captain builds an HTTP MCP server entry for the active caller-tool endpoint."} + "agents": { + "additionalProperties": { + "$ref": "#/$defs/AnthropicAgentAgentDefinition", + "description": "Agents value configuration. See the linked native reference for semantics and availability.", + "title": "Agents value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "description": "Named subagent definitions made available to Claude.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "readOnly": true, + "title": "Agent definitions", + "type": "object", + "x-captain-option": { + "nativeName": "agents", + "note": "Captain does not expose inline Claude Agent SDK agent definitions.", + "support": "unsupported" + }, + "x-clicky-order": 280, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "canUseTool": { - "title": "Tool permission callback", "description": "Agent SDK callback used to ask Captain for a tool-use decision.", - "type": "object", "additionalProperties": true, "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 200, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "canUseTool", "support": "managed", "note": "The TypeScript bridge installs a callback backed by the host protocol."} + "allowDangerouslySkipPermissions": { + "description": "Required Agent SDK acknowledgement before bypassPermissions may be used.", + "readOnly": true, + "title": "Allow bypass permissions", + "type": "boolean", + "x-captain-option": { + "nativeName": "allowDangerouslySkipPermissions", + "note": "The bridge enables this acknowledgement only for Captain's explicit bypass permission mode.", + "support": "managed" + }, + "x-clicky-order": 240, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "hooks": { - "title": "Hooks", "description": "Claude lifecycle and tool hooks installed for monitoring and caller-tool correlation.", - "type": "object", "additionalProperties": true, "readOnly": true, "x-clicky-section": "environment", "x-clicky-order": 210, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "hooks", "support": "managed", "note": "Captain's bridge installs monitoring and caller-tool hooks when their endpoints are active."} + "allowedTools": { + "description": "Tool names the Agent SDK may use without being denied by Captain's policy.", + "items": { + "description": "Allowed Tools value configuration. See the linked native reference for semantics and availability.", + "title": "Allowed Tools value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "title": "Allowed tools", + "type": "array", + "x-array-display": "list", + "x-captain-option": { + "nativeName": "allowedTools", + "specPath": "permissions.tools.allow", + "support": "mapped" + }, + "x-clicky-order": 60, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "monitorUrl": { - "title": "Monitor URL", "description": "Captain bridge URL receiving SDK lifecycle hook events.", - "type": "string", "format": "uri", "readOnly": true, "x-clicky-section": "environment", "x-clicky-order": 220, - "x-captain-option": {"nativeName": "initialize.monitorUrl", "support": "managed", "note": "Captain derives the monitor endpoint from its local serve configuration."} + "appendSystemPrompt": { + "description": "Captain bridge text appended to the Agent SDK system prompt.", + "title": "Append system prompt", + "type": "string", + "x-captain-option": { + "nativeName": "initialize.appendSystemPrompt", + "specPath": "prompt.appendSystem", + "support": "mapped" + }, + "x-clicky-order": 50, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "approvalMode": { + "description": "Whether the bridge asks Captain to broker each caller-tool decision.", + "enum": [ + "auto", + "ask" + ], + "readOnly": true, + "title": "Bridge approval mode", + "type": "string", + "x-captain-option": { + "nativeName": "initialize.approvalMode", + "note": "Captain selects ask only when a caller-tool approval broker is active.", + "support": "managed" + }, + "x-clicky-order": 180, + "x-clicky-section": "permissions", + "x-enum-display": "segmented", + "x-enum-icons": { + "ask": "question", + "auto": "sparkles" + }, + "x-enum-labels": { + "ask": "Ask", + "auto": "Auto" + }, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "betas": { + "description": "Anthropic beta feature identifiers enabled for the SDK query.", + "items": { + "description": "Betas value configuration. See the linked native reference for semantics and availability.", + "title": "Betas value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "readOnly": true, + "title": "Beta features", + "type": "array", + "x-array-display": "list", + "x-captain-option": { + "nativeName": "betas", + "note": "Captain does not expose per-query Anthropic beta headers.", + "support": "unsupported" + }, + "x-clicky-order": 400, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, "callerToolUseIDKey": { - "title": "Caller tool use ID key", "description": "Reserved metadata key correlating MCP tool calls with SDK hook events.", - "type": "string", "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 230, - "x-captain-option": {"nativeName": "initialize.callerToolUseIDKey", "support": "managed", "note": "Captain injects its reserved correlation key when caller tools are enabled."} + "description": "Reserved metadata key correlating MCP tool calls with SDK hook events.", + "readOnly": true, + "title": "Caller tool use ID key", + "type": "string", + "x-captain-option": { + "nativeName": "initialize.callerToolUseIDKey", + "note": "Captain injects its reserved correlation key when caller tools are enabled.", + "support": "managed" + }, + "x-clicky-order": 230, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "allowDangerouslySkipPermissions": { - "title": "Allow bypass permissions", "description": "Required Agent SDK acknowledgement before bypassPermissions may be used.", - "type": "boolean", "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 240, - "x-captain-option": {"nativeName": "allowDangerouslySkipPermissions", "support": "managed", "note": "The bridge enables this acknowledgement only for Captain's explicit bypass permission mode."} + "canUseTool": { + "additionalProperties": { + "description": "Can Use Tool value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Can Use Tool value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "description": "Agent SDK callback used to ask Captain for a tool-use decision.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "readOnly": true, + "title": "Tool permission callback", + "type": "object", + "x-captain-option": { + "nativeName": "canUseTool", + "note": "The TypeScript bridge installs a callback backed by the host protocol.", + "support": "managed" + }, + "x-clicky-order": 200, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "stderr": { - "title": "Standard error handler", "description": "Agent SDK callback forwarding child-process diagnostics to Captain.", - "type": "object", "additionalProperties": true, "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 250, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "stderr", "support": "managed", "note": "The bridge owns stderr forwarding over the host protocol."} + "continue": { + "description": "Whether the SDK continues the most recent conversation in cwd.", + "readOnly": true, + "title": "Continue recent session", + "type": "boolean", + "x-captain-option": { + "nativeName": "continue", + "note": "Captain resumes only an explicit session identifier.", + "support": "unsupported" + }, + "x-clicky-order": 290, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "abortController": { - "title": "Abort controller", "description": "JavaScript AbortController used to cancel an SDK query.", - "type": "object", "additionalProperties": true, "readOnly": true, "x-clicky-section": "environment", "x-clicky-order": 260, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "abortController", "support": "unsupported", "note": "Captain cancels through its bridge protocol instead of accepting a JavaScript object."} + "cwd": { + "description": "Working directory used by Claude Code tools and settings discovery.", + "format": "path", + "title": "Working directory", + "type": "string", + "x-captain-option": { + "nativeName": "cwd", + "specPath": "context.dir", + "support": "mapped" + }, + "x-clicky-order": 30, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "agent": { - "title": "Agent", "description": "Named SDK agent selected as the main execution agent.", - "type": "string", "readOnly": true, "x-clicky-section": "prompt", "x-clicky-order": 270, - "x-captain-option": {"nativeName": "agent", "support": "unsupported", "note": "Captain does not select a named Claude Agent SDK agent."} + "debug": { + "description": "Whether Agent SDK debug logging is enabled.", + "readOnly": true, + "title": "Debug", + "type": "boolean", + "x-captain-option": { + "nativeName": "debug", + "note": "Captain does not expose the SDK debug switch.", + "support": "unsupported" + }, + "x-clicky-order": 660, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "agents": { - "title": "Agent definitions", "description": "Named subagent definitions made available to Claude.", - "type": "object", "additionalProperties": true, "readOnly": true, "x-clicky-section": "prompt", "x-clicky-order": 280, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "agents", "support": "unsupported", "note": "Captain does not expose inline Claude Agent SDK agent definitions."} + "debugFile": { + "description": "Path receiving Agent SDK debug logs.", + "format": "path", + "readOnly": true, + "title": "Debug file", + "type": "string", + "x-captain-option": { + "nativeName": "debugFile", + "note": "Captain does not expose native SDK debug-file output.", + "support": "unsupported" + }, + "x-clicky-order": 670, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "continue": { - "title": "Continue recent session", "description": "Whether the SDK continues the most recent conversation in cwd.", - "type": "boolean", "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 290, - "x-captain-option": {"nativeName": "continue", "support": "unsupported", "note": "Captain resumes only an explicit session identifier."} + "disallowedTools": { + "description": "Tool names explicitly denied by Captain's policy.", + "items": { + "description": "Disallowed Tools value configuration. See the linked native reference for semantics and availability.", + "title": "Disallowed Tools value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "title": "Disallowed tools", + "type": "array", + "x-array-display": "list", + "x-captain-option": { + "nativeName": "disallowedTools", + "specPath": "permissions.tools.deny", + "support": "mapped" + }, + "x-clicky-order": 70, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "toolAliases": { - "title": "Tool aliases", "description": "Alternate display names and descriptions for SDK tools.", - "type": "object", "additionalProperties": true, "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 300, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "toolAliases", "support": "unsupported", "note": "Captain does not rewrite native Claude tool metadata."} + "effort": { + "description": "Adaptive reasoning effort used by supported Claude models.", + "enum": [ + "low", + "medium", + "high", + "xhigh", + "max" + ], + "title": "Effort", + "type": "string", + "x-captain-option": { + "nativeName": "effort", + "specPath": "model.effort", + "support": "mapped" + }, + "x-clicky-order": 20, + "x-clicky-section": "model", + "x-enum-display": "combobox", + "x-enum-labels": { + "high": "High", + "low": "Low", + "max": "Max", + "medium": "Medium", + "xhigh": "Xhigh" + }, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "tools": { - "title": "Tool set", "description": "Built-in tool preset or explicit SDK tool-name list.", - "oneOf": [{"type": "string"}, {"type": "array", "items": {"type": "string"}}], "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 310, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "tools", "support": "unsupported", "note": "Captain maps allow and deny policies instead of replacing the SDK tool set."} + "enableFileCheckpointing": { + "description": "Whether the SDK records file state so edits can be rewound.", + "readOnly": true, + "title": "File checkpointing", + "type": "boolean", + "x-captain-option": { + "nativeName": "enableFileCheckpointing", + "note": "Captain does not expose SDK file checkpointing.", + "support": "unsupported" + }, + "x-clicky-order": 370, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, "env": { - "title": "Environment", "description": "Environment variables supplied to the Claude Code child process.", - "type": "object", "additionalProperties": {"type": "string"}, "readOnly": true, "x-clicky-section": "environment", "x-clicky-order": 320, - "x-captain-option": {"nativeName": "env", "support": "unsupported", "note": "Captain owns child-process environment construction outside the Agent SDK options payload."} + "additionalProperties": { + "description": "Env value configuration. See the linked native reference for semantics and availability.", + "title": "Env value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "description": "Environment variables supplied to the Claude Code child process.", + "readOnly": true, + "title": "Environment", + "type": "object", + "x-captain-option": { + "nativeName": "env", + "note": "Captain owns child-process environment construction outside the Agent SDK options payload.", + "support": "unsupported" + }, + "x-clicky-order": 320, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, "executable": { - "title": "Executable runtime", "description": "JavaScript runtime used to launch the Agent SDK child process.", - "type": "string", "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 330, - "x-captain-option": {"nativeName": "executable", "support": "unsupported", "note": "Captain's packaged bridge owns the executable runtime."} + "description": "JavaScript runtime used to launch the Agent SDK child process.", + "readOnly": true, + "title": "Executable runtime", + "type": "string", + "x-captain-option": { + "nativeName": "executable", + "note": "Captain's packaged bridge owns the executable runtime.", + "support": "unsupported" + }, + "x-clicky-order": 330, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, "executableArgs": { - "title": "Executable arguments", "description": "Arguments prepended when launching the Agent SDK runtime.", - "type": "array", "items": {"type": "string"}, "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 340, "x-array-display": "list", - "x-captain-option": {"nativeName": "executableArgs", "support": "unsupported", "note": "Captain does not expose bridge runtime arguments."} + "description": "Arguments prepended when launching the Agent SDK runtime.", + "items": { + "description": "Executable Args value configuration. See the linked native reference for semantics and availability.", + "title": "Executable Args value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "readOnly": true, + "title": "Executable arguments", + "type": "array", + "x-array-display": "list", + "x-captain-option": { + "nativeName": "executableArgs", + "note": "Captain does not expose bridge runtime arguments.", + "support": "unsupported" + }, + "x-clicky-order": 340, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, "extraArgs": { - "title": "Extra Claude arguments", "description": "Additional raw command-line arguments passed by the SDK to Claude Code.", - "type": "object", "additionalProperties": true, "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 350, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "extraArgs", "support": "unsupported", "note": "Captain exposes typed request fields rather than raw Claude arguments."} + "additionalProperties": { + "description": "Extra Args value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Extra Args value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "description": "Additional raw command-line arguments passed by the SDK to Claude Code.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "readOnly": true, + "title": "Extra Claude arguments", + "type": "object", + "x-captain-option": { + "nativeName": "extraArgs", + "note": "Captain exposes typed request fields rather than raw Claude arguments.", + "support": "unsupported" + }, + "x-clicky-order": 350, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, "fallbackModel": { - "title": "Fallback model", "description": "Model used if the requested Claude model is unavailable.", - "type": "string", "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 360, - "x-captain-option": {"nativeName": "fallbackModel", "support": "unsupported", "note": "Captain performs fallback selection in its provider registry."} + "description": "Model used if the requested Claude model is unavailable.", + "readOnly": true, + "title": "Fallback model", + "type": "string", + "x-captain-option": { + "nativeName": "fallbackModel", + "note": "Captain performs fallback selection in its provider registry.", + "support": "unsupported" + }, + "x-clicky-order": 360, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "enableFileCheckpointing": { - "title": "File checkpointing", "description": "Whether the SDK records file state so edits can be rewound.", - "type": "boolean", "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 370, - "x-captain-option": {"nativeName": "enableFileCheckpointing", "support": "unsupported", "note": "Captain does not expose SDK file checkpointing."} + "forkSession": { + "description": "Whether resuming creates a new session identifier instead of continuing in place.", + "readOnly": true, + "title": "Fork session", + "type": "boolean", + "x-captain-option": { + "nativeName": "forkSession", + "note": "Captain resumes the requested session in place.", + "support": "unsupported" + }, + "x-clicky-order": 390, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "toolConfig": { - "title": "Tool configuration", "description": "Native per-tool configuration supplied to the Agent SDK.", - "type": "object", "additionalProperties": true, "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 380, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "toolConfig", "support": "unsupported", "note": "Captain does not expose Agent SDK per-tool configuration."} + "forwardSubagentText": { + "description": "Whether subagent text is forwarded into the parent query stream.", + "readOnly": true, + "title": "Forward subagent text", + "type": "boolean", + "x-captain-option": { + "nativeName": "forwardSubagentText", + "note": "Captain does not enable native SDK subagent text forwarding.", + "support": "unsupported" + }, + "x-clicky-order": 500, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "forkSession": { - "title": "Fork session", "description": "Whether resuming creates a new session identifier instead of continuing in place.", - "type": "boolean", "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 390, - "x-captain-option": {"nativeName": "forkSession", "support": "unsupported", "note": "Captain resumes the requested session in place."} + "hooks": { + "additionalProperties": { + "description": "Hooks value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Hooks value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "description": "Claude lifecycle and tool hooks installed for monitoring and caller-tool correlation.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "readOnly": true, + "title": "Hooks", + "type": "object", + "x-captain-option": { + "nativeName": "hooks", + "note": "Captain's bridge installs monitoring and caller-tool hooks when their endpoints are active.", + "support": "managed" + }, + "x-clicky-order": 210, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "betas": { - "title": "Beta features", "description": "Anthropic beta feature identifiers enabled for the SDK query.", - "type": "array", "items": {"type": "string"}, "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 400, "x-array-display": "list", - "x-captain-option": {"nativeName": "betas", "support": "unsupported", "note": "Captain does not expose per-query Anthropic beta headers."} + "includeHookEvents": { + "description": "Whether hook lifecycle events are emitted in the SDK message stream.", + "readOnly": true, + "title": "Include hook events", + "type": "boolean", + "x-captain-option": { + "nativeName": "includeHookEvents", + "note": "Captain receives its installed hooks directly instead of emitting hook messages.", + "support": "unsupported" + }, + "x-clicky-order": 480, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "onElicitation": { - "title": "Elicitation callback", "description": "Callback handling MCP elicitation requests from the SDK.", - "type": "object", "additionalProperties": true, "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 410, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "onElicitation", "support": "unsupported", "note": "Captain's bridge does not provide an MCP elicitation callback."} + "includePartialMessages": { + "description": "Whether partial assistant message chunks are emitted by the SDK.", + "readOnly": true, + "title": "Include partial messages", + "type": "boolean", + "x-captain-option": { + "nativeName": "includePartialMessages", + "note": "Captain consumes complete SDK message events.", + "support": "unsupported" + }, + "x-clicky-order": 490, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "onUserDialog": { - "title": "User dialog callback", "description": "Callback handling native Claude user-dialog requests.", - "type": "object", "additionalProperties": true, "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 420, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "onUserDialog", "support": "unsupported", "note": "Captain does not bridge native Agent SDK user dialogs."} + "loadTimeoutMs": { + "description": "Maximum milliseconds allowed when loading a persisted session.", + "minimum": 0, + "readOnly": true, + "title": "Load timeout", + "type": "integer", + "x-captain-option": { + "nativeName": "loadTimeoutMs", + "note": "Captain does not override the SDK session-load timeout.", + "support": "unsupported" + }, + "x-clicky-order": 470, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "supportedDialogKinds": { - "title": "Supported dialog kinds", "description": "User-dialog kinds the host declares it can render.", - "type": "array", "items": {"type": "string"}, "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 430, "x-array-display": "list", - "x-captain-option": {"nativeName": "supportedDialogKinds", "support": "unsupported", "note": "Captain does not advertise Agent SDK native dialog rendering."} + "managedSettings": { + "$ref": "#/$defs/AnthropicAgentSettings", + "additionalProperties": { + "description": "Managed Settings value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Managed Settings value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "description": "Enterprise-managed Claude Code settings applied to the query.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "readOnly": true, + "title": "Managed settings", + "type": "object", + "x-captain-option": { + "nativeName": "managedSettings", + "note": "Captain does not inject enterprise-managed settings.", + "support": "unsupported" + }, + "x-clicky-order": 630, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "persistSession": { - "title": "Persist session", "description": "Whether the Agent SDK persists the session to disk.", - "type": "boolean", "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 440, - "x-captain-option": {"nativeName": "persistSession", "support": "unsupported", "note": "Captain does not override the Agent SDK persistence default."} + "maxBudgetUsd": { + "description": "Maximum spend in US dollars before the SDK stops.", + "minimum": 0, + "title": "Maximum budget", + "type": "number", + "x-captain-option": { + "nativeName": "maxBudgetUsd", + "specPath": "budget.cost", + "support": "mapped" + }, + "x-clicky-order": 100, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "sessionStore": { - "title": "Session store", "description": "Custom storage implementation used for Agent SDK session data.", - "type": "object", "additionalProperties": true, "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 450, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "sessionStore", "support": "unsupported", "note": "Captain does not inject a custom Agent SDK session store."} + "maxThinkingTokens": { + "description": "Maximum tokens allocated to extended thinking.", + "minimum": 0, + "readOnly": true, + "title": "Maximum thinking tokens", + "type": "integer", + "x-captain-option": { + "nativeName": "maxThinkingTokens", + "note": "Captain exposes effort rather than a fixed thinking-token budget.", + "support": "unsupported" + }, + "x-clicky-order": 520, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "sessionStoreFlush": { - "title": "Session store flush", "description": "Callback invoked to flush custom session storage.", - "type": "object", "additionalProperties": true, "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 460, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "sessionStoreFlush", "support": "unsupported", "note": "Captain does not inject a custom session store flush callback."} + "maxTurns": { + "description": "Maximum number of agent turns before the SDK stops.", + "minimum": 1, + "title": "Maximum turns", + "type": "integer", + "x-captain-option": { + "nativeName": "maxTurns", + "specPath": "budget.maxTurns", + "support": "mapped" + }, + "x-clicky-order": 90, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "loadTimeoutMs": { - "title": "Load timeout", "description": "Maximum milliseconds allowed when loading a persisted session.", - "type": "integer", "minimum": 0, "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 470, - "x-captain-option": {"nativeName": "loadTimeoutMs", "support": "unsupported", "note": "Captain does not override the SDK session-load timeout."} + "mcpServers": { + "additionalProperties": { + "$ref": "#/$defs/AnthropicAgentMcpServerConfigForProcessTransport", + "description": "MCP Servers value configuration. See the linked native reference for semantics and availability.", + "title": "MCP Servers value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "description": "Agent SDK MCP server definitions injected for Captain caller tools.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "readOnly": true, + "title": "MCP servers", + "type": "object", + "x-captain-option": { + "nativeName": "mcpServers", + "note": "Captain builds an HTTP MCP server entry for the active caller-tool endpoint.", + "support": "managed" + }, + "x-clicky-order": 190, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "includeHookEvents": { - "title": "Include hook events", "description": "Whether hook lifecycle events are emitted in the SDK message stream.", - "type": "boolean", "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 480, - "x-captain-option": {"nativeName": "includeHookEvents", "support": "unsupported", "note": "Captain receives its installed hooks directly instead of emitting hook messages."} + "model": { + "description": "Claude model identifier passed to the Agent SDK.", + "title": "Model", + "type": "string", + "x-captain-option": { + "nativeName": "model", + "specPath": "model.name", + "support": "mapped" + }, + "x-clicky-order": 10, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + }, + "x-icon": "sparkles" }, - "includePartialMessages": { - "title": "Include partial messages", "description": "Whether partial assistant message chunks are emitted by the SDK.", - "type": "boolean", "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 490, - "x-captain-option": {"nativeName": "includePartialMessages", "support": "unsupported", "note": "Captain consumes complete SDK message events."} + "monitorUrl": { + "description": "Captain bridge URL receiving SDK lifecycle hook events.", + "format": "uri", + "readOnly": true, + "title": "Monitor URL", + "type": "string", + "x-captain-option": { + "nativeName": "initialize.monitorUrl", + "note": "Captain derives the monitor endpoint from its local serve configuration.", + "support": "managed" + }, + "x-clicky-order": 220, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "forwardSubagentText": { - "title": "Forward subagent text", "description": "Whether subagent text is forwarded into the parent query stream.", - "type": "boolean", "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 500, - "x-captain-option": {"nativeName": "forwardSubagentText", "support": "unsupported", "note": "Captain does not enable native SDK subagent text forwarding."} + "onElicitation": { + "additionalProperties": { + "description": "On Elicitation value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "On Elicitation value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "description": "Callback handling MCP elicitation requests from the SDK.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "readOnly": true, + "title": "Elicitation callback", + "type": "object", + "x-captain-option": { + "nativeName": "onElicitation", + "note": "Captain's bridge does not provide an MCP elicitation callback.", + "support": "unsupported" + }, + "x-clicky-order": 410, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "thinking": { - "title": "Thinking", "description": "Detailed native thinking configuration beyond the effort level.", - "type": "object", "additionalProperties": true, "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 510, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "thinking", "support": "unsupported", "note": "Captain maps model.effort and does not expose the lower-level SDK thinking object."} + "onUserDialog": { + "additionalProperties": { + "description": "On User Dialog value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "On User Dialog value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "description": "Callback handling native Claude user-dialog requests.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "readOnly": true, + "title": "User dialog callback", + "type": "object", + "x-captain-option": { + "nativeName": "onUserDialog", + "note": "Captain does not bridge native Agent SDK user dialogs.", + "support": "unsupported" + }, + "x-clicky-order": 420, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "maxThinkingTokens": { - "title": "Maximum thinking tokens", "description": "Maximum tokens allocated to extended thinking.", - "type": "integer", "minimum": 0, "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 520, - "x-captain-option": {"nativeName": "maxThinkingTokens", "support": "unsupported", "note": "Captain exposes effort rather than a fixed thinking-token budget."} + "outputFormat": { + "additionalProperties": { + "description": "Output Format value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Output Format value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "description": "Structured-output JSON Schema passed to the Agent SDK.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Output format", + "type": "object", + "x-captain-option": { + "nativeName": "outputFormat", + "specPath": [ + "prompt.schema", + "prompt.schemaJson" + ], + "support": "mapped" + }, + "x-clicky-order": 140, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "taskBudget": { - "title": "Task budget", "description": "Native budget constraints applied to SDK task execution.", - "type": "object", "additionalProperties": true, "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 530, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "taskBudget", "support": "unsupported", "note": "Captain maps maxTurns and maxBudgetUsd but not the SDK taskBudget object."} + "outputSchema": { + "additionalProperties": { + "description": "Output Schema value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Output Schema value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "description": "Captain bridge JSON Schema converted into the SDK outputFormat option.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Bridge output schema", + "type": "object", + "x-captain-option": { + "nativeName": "initialize.outputSchema", + "specPath": [ + "prompt.schema", + "prompt.schemaJson" + ], + "support": "mapped" + }, + "x-clicky-order": 150, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, "pathToClaudeCodeExecutable": { - "title": "Claude executable path", "description": "Filesystem path to the Claude Code executable launched by the SDK.", - "type": "string", "format": "path", "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 540, - "x-captain-option": {"nativeName": "pathToClaudeCodeExecutable", "support": "unsupported", "note": "Captain's package resolver owns the Claude Code executable path."} + "description": "Filesystem path to the Claude Code executable launched by the SDK.", + "format": "path", + "readOnly": true, + "title": "Claude executable path", + "type": "string", + "x-captain-option": { + "nativeName": "pathToClaudeCodeExecutable", + "note": "Captain's package resolver owns the Claude Code executable path.", + "support": "unsupported" + }, + "x-clicky-order": 540, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "perTaskStopAffordance": { + "description": "Declares that the host can stop individual background tasks, so an interrupt only aborts the current turn.", + "readOnly": true, + "title": "Per-task stop affordance", + "type": "boolean", + "x-captain-option": { + "nativeName": "perTaskStopAffordance", + "note": "Captain interrupts stop the whole query, including background tasks.", + "support": "unsupported" + }, + "x-clicky-order": 720, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "permissionMode": { + "description": "Claude Code permission posture translated from Captain's runtime policy.", + "enum": [ + "default", + "acceptEdits", + "bypassPermissions", + "plan", + "dontAsk" + ], + "title": "Permission mode", + "type": "string", + "x-captain-option": { + "nativeName": "permissionMode", + "specPath": "permissions.mode", + "support": "mapped" + }, + "x-clicky-order": 110, + "x-clicky-section": "permissions", + "x-enum-display": "combobox", + "x-enum-icons": { + "acceptEdits": "folder", + "bypassPermissions": "lock-open", + "default": "shield", + "dontAsk": "prohibit", + "plan": "list-dashes" + }, + "x-enum-labels": { + "acceptEdits": "Accept Edits", + "bypassPermissions": "Bypass Permissions", + "default": "Default", + "dontAsk": "Dont Ask", + "plan": "Plan" + }, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, "permissionPromptToolName": { - "title": "Permission prompt tool", "description": "MCP tool name used by Claude Code to request permission decisions.", - "type": "string", "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 550, - "x-captain-option": {"nativeName": "permissionPromptToolName", "support": "unsupported", "note": "Captain uses the Agent SDK canUseTool callback instead of a permission-prompt MCP tool."} + "description": "MCP tool name used by Claude Code to request permission decisions.", + "readOnly": true, + "title": "Permission prompt tool", + "type": "string", + "x-captain-option": { + "nativeName": "permissionPromptToolName", + "note": "Captain uses the Agent SDK canUseTool callback instead of a permission-prompt MCP tool.", + "support": "unsupported" + }, + "x-clicky-order": 550, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "permissionPrompts": { + "description": "Who answers permission prompts: the host through canUseTool, or nobody so prompting requests are denied.", + "enum": [ + "host", + "none" + ], + "readOnly": true, + "title": "Permission prompts", + "type": "string", + "x-captain-option": { + "nativeName": "permissionPrompts", + "note": "Captain always answers permission prompts through its canUseTool callback.", + "support": "unsupported" + }, + "x-clicky-order": 740, + "x-clicky-section": "permissions", + "x-enum-display": "segmented", + "x-enum-labels": { + "host": "Host", + "none": "None" + }, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "persistSession": { + "description": "Whether the Agent SDK persists the session to disk.", + "readOnly": true, + "title": "Persist session", + "type": "boolean", + "x-captain-option": { + "nativeName": "persistSession", + "note": "Captain does not override the Agent SDK persistence default.", + "support": "unsupported" + }, + "x-clicky-order": 440, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, "planModeInstructions": { - "title": "Plan mode instructions", "description": "Additional instructions injected when Claude enters plan mode.", - "type": "string", "readOnly": true, "x-clicky-section": "prompt", "x-clicky-order": 560, - "x-captain-option": {"nativeName": "planModeInstructions", "support": "unsupported", "note": "Captain does not override Claude's native plan-mode instructions."} + "description": "Additional instructions injected when Claude enters plan mode.", + "readOnly": true, + "title": "Plan mode instructions", + "type": "string", + "x-captain-option": { + "nativeName": "planModeInstructions", + "note": "Captain does not override Claude's native plan-mode instructions.", + "support": "unsupported" + }, + "x-clicky-order": 560, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "pluginDelivery": { + "description": "How plugins reach the Claude Code process: --plugin-dir arguments or the initialize request.", + "enum": [ + "argv", + "initialize" + ], + "readOnly": true, + "title": "Plugin delivery", + "type": "string", + "x-captain-option": { + "nativeName": "pluginDelivery", + "note": "Captain does not expose Agent SDK plugin loading.", + "support": "unsupported" + }, + "x-clicky-order": 750, + "x-clicky-section": "cli", + "x-enum-display": "segmented", + "x-enum-labels": { + "argv": "Argv", + "initialize": "Initialize" + }, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, "plugins": { - "title": "Plugins", "description": "Local Claude Code plugin directories loaded for the query.", - "type": "array", "items": {"type": "object", "additionalProperties": true}, "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 570, "x-array-display": "stacked", - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "plugins", "support": "unsupported", "note": "Captain does not expose Agent SDK plugin loading."} + "description": "Local Claude Code plugin directories loaded for the query.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "items": { + "additionalProperties": { + "description": "Plugins value value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Plugins value value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "description": "Plugins value configuration. See the linked native reference for semantics and availability.", + "title": "Plugins value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "readOnly": true, + "title": "Plugins", + "type": "array", + "x-array-display": "stacked", + "x-captain-option": { + "nativeName": "plugins", + "note": "Captain does not expose Agent SDK plugin loading.", + "support": "unsupported" + }, + "x-clicky-order": 570, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "projectConfigRoot": { + "description": "Trusted checkout that cwd is a worktree of; project settings, .mcp.json and .claude config trees load from here instead of cwd.", + "format": "path", + "readOnly": true, + "title": "Project config root", + "type": "string", + "x-captain-option": { + "nativeName": "projectConfigRoot", + "note": "Captain loads project configuration from the run's working directory.", + "support": "unsupported" + }, + "x-clicky-order": 710, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "promptAttachments": { + "description": "File and image attachments sent in a Captain bridge prompt request.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "items": { + "additionalProperties": { + "description": "Prompt Attachments value value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Prompt Attachments value value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "description": "Prompt Attachments value configuration. See the linked native reference for semantics and availability.", + "title": "Prompt Attachments value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "title": "Prompt attachments", + "type": "array", + "x-array-display": "stacked", + "x-captain-option": { + "nativeName": "prompt.attachments", + "specPath": "prompt.attachments", + "support": "mapped" + }, + "x-clicky-order": 170, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, "promptSuggestions": { - "title": "Prompt suggestions", "description": "Whether the SDK emits suggested follow-up prompts.", - "type": "boolean", "readOnly": true, "x-clicky-section": "prompt", "x-clicky-order": 580, - "x-captain-option": {"nativeName": "promptSuggestions", "support": "unsupported", "note": "Captain does not request Agent SDK prompt suggestions."} + "description": "Whether the SDK emits suggested follow-up prompts.", + "readOnly": true, + "title": "Prompt suggestions", + "type": "boolean", + "x-captain-option": { + "nativeName": "promptSuggestions", + "note": "Captain does not request Agent SDK prompt suggestions.", + "support": "unsupported" + }, + "x-clicky-order": 580, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "agentProgressSummaries": { - "title": "Agent progress summaries", "description": "Whether progress summaries are generated for long-running agent work.", - "type": "boolean", "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 590, - "x-captain-option": {"nativeName": "agentProgressSummaries", "support": "unsupported", "note": "Captain does not enable native SDK progress summaries."} + "promptText": { + "description": "Text sent in a Captain bridge prompt request.", + "title": "Prompt text", + "type": "string", + "x-captain-option": { + "nativeName": "prompt.text", + "specPath": "prompt.user", + "support": "mapped" + }, + "x-clicky-order": 160, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "sessionId": { - "title": "New session ID", "description": "Explicit UUID assigned when starting a new Agent SDK session.", - "type": "string", "format": "uuid", "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 600, - "x-captain-option": {"nativeName": "sessionId", "support": "unsupported", "note": "Captain reads the session identifier emitted by the SDK instead of assigning one."} + "resume": { + "description": "Claude session identifier resumed by the Agent SDK.", + "title": "Resume session", + "type": "string", + "x-captain-option": { + "nativeName": "resume", + "specPath": "sessionId", + "support": "mapped" + }, + "x-clicky-order": 130, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "resumeDropsTurn": { + "description": "Guarded fork point paired with resumeSessionAt that discards the turn after the kept chain entry.", + "readOnly": true, + "title": "Resume drops turn", + "type": "string", + "x-captain-option": { + "nativeName": "resumeDropsTurn", + "note": "Captain resumes the latest point of an explicit session.", + "support": "unsupported" + }, + "x-clicky-order": 760, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, "resumeSessionAt": { - "title": "Resume session at", "description": "Message identifier at which an existing session is resumed.", - "type": "string", "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 610, - "x-captain-option": {"nativeName": "resumeSessionAt", "support": "unsupported", "note": "Captain resumes the latest point of an explicit session."} + "description": "Message identifier at which an existing session is resumed.", + "readOnly": true, + "title": "Resume session at", + "type": "string", + "x-captain-option": { + "nativeName": "resumeSessionAt", + "note": "Captain resumes the latest point of an explicit session.", + "support": "unsupported" + }, + "x-clicky-order": 610, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "settings": { - "title": "Settings", "description": "In-memory Claude Code settings applied to the query.", - "type": "object", "additionalProperties": true, "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 620, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "settings", "support": "unsupported", "note": "Captain does not inject Agent SDK settings objects."} + "sandbox": { + "additionalProperties": { + "description": "Sandbox value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Sandbox value", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "Sandbox configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "properties": { + "allowAppleEvents": { + "description": "macOS only: Allow sandboxed commands to send Apple Events (and look up the appleeventsd Mach service). Needed for `open`, `osascript`, and browser-based auth flows that open URLs. **Removes code-execution isolation** — sandboxed commands can launch other applications unsandboxed with no user prompt, and can script running apps (e.g. Terminal) subject to the user's per-app TCC automation consent. Only honored from user, managed/policy, or CLI (--settings) settings — project settings (.claude/settings.json and .claude/settings.local.json) are ignored. Default: false", + "title": "Allow Apple Events", + "type": "boolean", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "allowUnsandboxedCommands": { + "description": "Allow commands to run outside the sandbox via the dangerouslyDisableSandbox parameter. When false, the dangerouslyDisableSandbox parameter is completely ignored and all commands must run sandboxed. Default: true.", + "title": "Allow Unsandboxed Commands", + "type": "boolean", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "autoAllowBashIfSandboxed": { + "description": "Auto Allow Bash If Sandboxed configuration. See the linked native reference for semantics and availability.", + "title": "Auto Allow Bash If Sandboxed", + "type": "boolean", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "bwrapPath": { + "description": "Linux/WSL only: Absolute path to the bwrap (bubblewrap) binary. Overrides auto-detection via PATH. Only honored from admin-controlled managed settings.", + "title": "Bwrap Path", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "credentials": { + "additionalProperties": false, + "description": "Credentials configuration. See the linked native reference for semantics and availability.", + "properties": { + "allowPlaintextInject": { + "description": "Allow sentinel→real substitution on the plain-HTTP proxy path. Defaults to false: without TLS termination the upstream identity is unverified and the credential travels in cleartext. Set only for trusted-network test fixtures. Only honored from user, managed/policy, or CLI (`--settings`) settings — project settings (.claude/settings.json and .claude/settings.local.json) are ignored.", + "title": "Allow Plaintext Inject", + "type": "boolean", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "awsPairs": { + "description": "Explicit groupings of masked env vars into AWS credential pairs for SigV4 re-signing, for non-standard variable names. The conventional AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY / AWS_SESSION_TOKEN trio is paired automatically when masked. Only honored from user, managed/policy, or CLI (`--settings`) settings — project settings (.claude/settings.json and .claude/settings.local.json) are ignored. A member is only usable when its env var is forwarded as a whole-value `mask` entry (an entry carrying `extract` or `decode` does not qualify — re-signing needs the whole real value). A pair whose key id or secret member is unusable never re-signs: it is dropped, unless it names a conventional AWS variable, in which case it is forwarded as an inert suppressor so implicit auto-pairing stays overridden. A pair whose ONLY unusable member is the session token still re-signs, without an x-amz-security-token (temporary-credential requests fail upstream until the entry is fixed).", + "items": { + "additionalProperties": false, + "description": "Aws Pairs value configuration. See the linked native reference for semantics and availability.", + "properties": { + "accessKeyIdVar": { + "description": "Name of the masked env var holding the AWS access key id.", + "title": "Access Key Id Var", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "secretAccessKeyVar": { + "description": "Name of the masked env var holding the AWS secret access key.", + "title": "Secret Access Key Var", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "sessionTokenVar": { + "description": "Optional name of the masked env var holding the AWS session token (temporary credentials). When set, the proxy sends the real token as x-amz-security-token on re-signed requests and adds it to the signed header set if the client did not.", + "title": "Session Token Var", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "accessKeyIdVar", + "secretAccessKeyVar" + ], + "title": "Aws Pairs value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Aws Pairs", + "type": "array", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "envVars": { + "description": "Environment variables to protect. `deny` unsets the variable for sandboxed commands; `mask` substitutes a sentinel inside the sandbox and injects the real value at the proxy.", + "items": { + "additionalProperties": false, + "description": "Env Vars value configuration. See the linked native reference for semantics and availability.", + "properties": { + "decode": { + "const": "jwt", + "description": "Optional encoded-credential format for `mask` mode. `jwt`: the variable's whole value is verified to actually be a JWT and replaced with a structurally valid fake JWT so client-side token parsing inside the sandbox keeps working; the proxy swaps the whole fake token on egress. If the value does not verify, the variable is left unmasked with a stderr warning (fail-open). Cannot be combined with `extract` — the decode path never consults it. Accepted but ignored for `deny`.", + "title": "Decode", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "extract": { + "description": "Optional regex for structured masking when mode is `mask`. Applied globally to the value; capture group 1 of each match is a credential value, and only those captured spans are replaced with sentinels — the rest of the value is preserved so a tool that parses it (a `DATABASE_URL` connection string, a composite `KEY:SECRET` pair) still succeeds inside the sandbox. Without `extract`, the entire value is replaced with one sentinel (whole-value masking, suited to bare tokens). If the regex matches nothing, behavior is governed by `onExtractNoMatch` (default `warn`). Cannot be combined with `decode` (the decode path never consults it). Accepted but ignored for `deny`.", + "title": "Extract", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "injectHosts": { + "description": "Optional narrowing of where the proxy substitutes this credential. Only meaningful when mode is `mask`; accepted but ignored for `deny`. If unset, defaults to `network.allowedDomains` — the credential is injected at every reachable host. Each entry must be reachable via `network.allowedDomains` (sandbox-runtime validates this).", + "items": { + "description": "Inject Hosts value configuration. See the linked native reference for semantics and availability.", + "title": "Inject Hosts value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Inject Hosts", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "maskClaims": { + "description": "Names of top-level payload claims to mask inside the decoded value, instead of replacing the whole token. Each named claim present with a string value gets its own sentinel and the token is rebuilt around the modified payload; all other claims are preserved so claim-reading clients keep working. Requires `decode`. If no named claim matches, the variable is left unmasked with a stderr warning (fail-open). Only meaningful when mode is `mask`; accepted but ignored for `deny`.", + "items": { + "description": "Mask Claims value configuration. See the linked native reference for semantics and availability.", + "title": "Mask Claims value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Mask Claims", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "mode": { + "description": "Access mode for this environment variable. `deny` unsets the variable for sandboxed commands; `mask` shows sandboxed commands a sentinel value and the host proxy swaps sentinel→real on egress to `injectHosts`.", + "enum": [ + "deny", + "mask" + ], + "title": "Mode", + "type": "string", + "x-clicky-order": 50, + "x-enum-display": "segmented", + "x-enum-labels": { + "deny": "Deny", + "mask": "Mask" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "name": { + "description": "Environment variable name.", + "title": "Name", + "type": "string", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "onExtractNoMatch": { + "description": "What to do when `extract` matches nothing in the value. `warn` (default) emits a stderr warning and lets the variable pass through unmasked (fail-open, for credentials that may be legitimately absent); `deny` unsets the variable inside the sandbox (fail-closed); `error` aborts at sandbox setup so nothing runs until the config is fixed. Only meaningful when mode is `mask` and `extract` is set without `decode`. On a mask entry with `decode`, the runtime takes the decode path and never consults this field, so a fail-closed setting cannot be honored — `deny` and `error` are rejected there; only `warn` is accepted. In all other shapes the field is accepted but ignored.", + "enum": [ + "warn", + "deny", + "error" + ], + "title": "On Extract No Match", + "type": "string", + "x-clicky-order": 70, + "x-enum-display": "segmented", + "x-enum-labels": { + "deny": "Deny", + "error": "Error", + "warn": "Warn" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "name", + "mode" + ], + "title": "Env Vars value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Env Vars", + "type": "array", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "files": { + "description": "Credential files or directories to protect. `deny` blocks reads inside the sandbox; `mask` substitutes a sentinel inside the sandbox (whole-file, or per-`extract` capture) and injects the real value at the proxy. On macOS and Windows `mask` degrades to `deny`.", + "items": { + "additionalProperties": false, + "description": "Files value configuration. See the linked native reference for semantics and availability.", + "properties": { + "decode": { + "const": "jwt", + "description": "Optional encoded-credential format for `mask` mode. `jwt`: candidates are located with a built-in JWT regex (or the explicit `extract` pattern, if set), verified to actually be JWTs before masking, and replaced with a structurally valid fake JWT so client-side token parsing inside the sandbox keeps working. If no candidate verifies, behavior is governed by `onExtractNoMatch` (default `warn`). Accepted but ignored for `deny`.", + "title": "Decode", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "extract": { + "description": "Optional regex for structured masking when mode is `mask`. Applied globally to the file; capture group 1 of each match is a credential value, and only those captured spans are replaced with sentinels — the rest of the file is preserved so a tool that parses it (.netrc, JSON, YAML) still succeeds. Without `extract`, the entire file content is replaced with one sentinel (whole-file masking, suited to single-secret files). If the regex matches nothing, behavior is governed by `onExtractNoMatch` (default `warn`). Accepted but ignored for `deny`.", + "title": "Extract", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "injectHosts": { + "description": "Optional narrowing of where the proxy substitutes this credential. Only meaningful when mode is `mask`; accepted but ignored for `deny`. If unset, defaults to `network.allowedDomains` — the credential is injected at every reachable host. Each entry must be reachable via `network.allowedDomains` (sandbox-runtime validates this).", + "items": { + "description": "Inject Hosts value configuration. See the linked native reference for semantics and availability.", + "title": "Inject Hosts value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Inject Hosts", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "maskClaims": { + "description": "Names of top-level payload claims to mask inside each decoded value, instead of replacing the whole token. Each named claim present with a string value gets its own sentinel and the token is rebuilt around the modified payload; all other claims are preserved so a tool that decodes the token and reads a non-secret claim keeps working. Requires `decode`. If no named claim matches in any verified token, behavior is governed by `onExtractNoMatch` (default `warn`). Only meaningful when mode is `mask`; accepted but ignored for `deny`.", + "items": { + "description": "Mask Claims value configuration. See the linked native reference for semantics and availability.", + "title": "Mask Claims value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Mask Claims", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "maskDuplicates": { + "description": "If true, verbatim occurrences of each captured credential value outside the regex-matched spans are also replaced with the corresponding sentinel — for a secret repeated where the regex does not reach (e.g. pasted into a comment). Matches raw substrings, so short or common values may corrupt unrelated content; intended for long, high-entropy secrets. Defaults to false. Only meaningful when mode is `mask` and `extract` or `decode` is set; accepted but ignored otherwise.", + "title": "Mask Duplicates", + "type": "boolean", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "mode": { + "description": "Access mode for this path. `deny` blocks reads inside the sandbox; `mask` shows sandboxed commands a sentinel-substituted copy (whole-file, or only the spans captured by `extract`) and the host proxy swaps sentinel→real on egress to `injectHosts`. On macOS and Windows `mask` currently degrades to `deny`.", + "enum": [ + "deny", + "mask" + ], + "title": "Mode", + "type": "string", + "x-clicky-order": 60, + "x-enum-display": "segmented", + "x-enum-labels": { + "deny": "Deny", + "mask": "Mask" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "onExtractNoMatch": { + "description": "What to do when `extract` matches nothing in the file — or, with `decode`, when no candidate survives verification. `warn` (default) emits a stderr warning and leaves the file readable as-is inside the sandbox (fail-open, for credentials that may be legitimately absent); `deny` degrades the entry to mode `deny` so the file is unreadable (fail-closed) — under `sandbox.filesystem.disabled` it is treated as `error`, since read-denies are dropped in that mode; `error` aborts at sandbox setup so nothing runs until the config is fixed. Only meaningful when mode is `mask` and `extract` or `decode` is set; accepted but ignored otherwise.", + "enum": [ + "warn", + "deny", + "error" + ], + "title": "On Extract No Match", + "type": "string", + "x-clicky-order": 70, + "x-enum-display": "segmented", + "x-enum-labels": { + "deny": "Deny", + "error": "Error", + "warn": "Warn" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "path": { + "description": "Path to a credential file or directory. Same resolution as sandbox.filesystem.* paths: absolute, ~ expanded, or relative to the settings file root (project root for project settings, ~/.claude for user settings).", + "title": "Path", + "type": "string", + "x-clicky-order": 80, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "path", + "mode" + ], + "title": "Files value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Files", + "type": "array", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "sigv4": { + "additionalProperties": false, + "description": "Policies for AWS SigV4 request shapes the proxy cannot re-sign (streaming, presigned, sigv4a) when they reference a masked credential pair: `deny` (default) or `passthrough`. Only honored from user, managed/policy, or CLI (`--settings`) settings — project settings (.claude/settings.json and .claude/settings.local.json) are ignored.", + "properties": { + "presigned": { + "description": "Policy for presigned URLs (X-Amz-Algorithm/X-Amz-Signature in the query, no Authorization header): the signature lives in the URL itself. `deny` (default) or `passthrough`.", + "enum": [ + "deny", + "passthrough" + ], + "title": "Presigned", + "type": "string", + "x-clicky-order": 10, + "x-enum-display": "segmented", + "x-enum-labels": { + "deny": "Deny", + "passthrough": "Passthrough" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "sigv4a": { + "description": "Policy for SigV4A (AWS4-ECDSA-P256-SHA256) asymmetric signatures: there is no shared-key HMAC to recompute. `deny` (default) or `passthrough`.", + "enum": [ + "deny", + "passthrough" + ], + "title": "Sigv4a", + "type": "string", + "x-clicky-order": 20, + "x-enum-display": "segmented", + "x-enum-labels": { + "deny": "Deny", + "passthrough": "Passthrough" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "streaming": { + "description": "Policy for aws-chunked streaming uploads (x-amz-content-sha256: STREAMING-*): per-chunk signatures chain off the seed signature, so re-signing would require rewriting the body. `deny` (default) fails closed with a 403; `passthrough` forwards the request unre-signed (the upstream will reject its signature).", + "enum": [ + "deny", + "passthrough" + ], + "title": "Streaming", + "type": "string", + "x-clicky-order": 30, + "x-enum-display": "segmented", + "x-enum-labels": { + "deny": "Deny", + "passthrough": "Passthrough" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "title": "Sigv4", + "type": "object", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "title": "Credentials", + "type": "object", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "enableWeakerNestedSandbox": { + "description": "Enable Weaker Nested Sandbox configuration. See the linked native reference for semantics and availability.", + "title": "Enable Weaker Nested Sandbox", + "type": "boolean", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "enableWeakerNetworkIsolation": { + "description": "macOS only: Allow access to com.apple.trustd.agent in the sandbox. Needed for Go-based CLI tools (gh, gcloud, terraform, etc.) to verify TLS certificates when using httpProxyPort with a MITM proxy and custom CA. **Reduces security** — opens a potential data exfiltration vector through the trustd service. Default: false", + "title": "Enable Weaker Network Isolation", + "type": "boolean", + "x-clicky-order": 70, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "enabled": { + "description": "Enabled configuration. See the linked native reference for semantics and availability.", + "title": "Enabled", + "type": "boolean", + "x-clicky-order": 80, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "excludedCommands": { + "description": "Excluded Commands configuration. See the linked native reference for semantics and availability.", + "items": { + "description": "Excluded Commands value configuration. See the linked native reference for semantics and availability.", + "title": "Excluded Commands value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Excluded Commands", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 90, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "failIfUnavailable": { + "description": "Exit with an error at startup if sandbox.enabled is true but the sandbox cannot start (missing dependencies or unsupported platform). When false (default), a warning is shown and commands run unsandboxed. Intended for managed-settings deployments that require sandboxing as a hard gate.", + "title": "Fail If Unavailable", + "type": "boolean", + "x-clicky-order": 100, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "filesystem": { + "additionalProperties": false, + "description": "Filesystem configuration. See the linked native reference for semantics and availability.", + "properties": { + "allowManagedReadPathsOnly": { + "description": "When true (set in managed settings), only allowRead paths from policySettings are used.", + "title": "Allow Managed Read Paths Only", + "type": "boolean", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "allowRead": { + "description": "Paths to re-allow reading within denyRead regions. Takes precedence over denyRead for matching paths.", + "items": { + "description": "Allow Read value configuration. See the linked native reference for semantics and availability.", + "title": "Allow Read value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Allow Read", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "allowWrite": { + "description": "Additional paths to allow writing within the sandbox. Merged with paths from Edit(...) allow permission rules.", + "items": { + "description": "Allow Write value configuration. See the linked native reference for semantics and availability.", + "title": "Allow Write value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Allow Write", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "denyRead": { + "description": "Additional paths to deny reading within the sandbox. Merged with paths from Read(...) deny permission rules.", + "items": { + "description": "Deny Read value configuration. See the linked native reference for semantics and availability.", + "title": "Deny Read value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Deny Read", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "denyWrite": { + "description": "Additional paths to deny writing within the sandbox. Merged with paths from Edit(...) deny permission rules.", + "items": { + "description": "Deny Write value configuration. See the linked native reference for semantics and availability.", + "title": "Deny Write value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Deny Write", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "disabled": { + "description": "macOS and Linux/WSL only: skip filesystem isolation entirely while keeping network and seccomp isolation. Ignored on native Windows, where the sandboxed process runs as a separate user with no inherent rights, so skipping the filesystem rules would withhold every access grant rather than loosen them — filesystem isolation stays on there. Sandboxed commands get unrestricted read/write access to the host filesystem; network egress is still confined to network.allowedDomains. Intended for deployments whose goal is egress control rather than filesystem containment. Does not change Bash prompting: sandbox.autoAllowBashIfSandboxed is independent and still defaults to true, so set it to false to keep prompting for sandboxed commands. Drops the read protection from filesystem.denyRead and credentials.files deny entries for sandboxed commands, since both are enforced by the filesystem layer this turns off; credentials.files mask entries (sentinel binds) and credentials.envVars deny/mask are unaffected. Only honored from user, managed/policy, or CLI (`--settings`) settings — project settings (.claude/settings.json and .claude/settings.local.json) are ignored. If managed settings configure sandbox.filesystem at all, or list any sandbox.credentials.files deny entry, only managed settings can set this: an admin who deployed filesystem restrictions must not have them switched off by a user-writable file. (sandbox.credentials.envVars and credentials.files mask entries do not pin it — env scrubbing and sentinel binds are independent of the filesystem layer and survive this setting.) When unset, filesystem isolation stays on.", + "title": "Disabled", + "type": "boolean", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "title": "Filesystem", + "type": "object", + "x-clicky-order": 110, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "ignoreViolations": { + "additionalProperties": { + "description": "Ignore Violations value configuration. See the linked native reference for semantics and availability.", + "items": { + "description": "Ignore Violations value value configuration. See the linked native reference for semantics and availability.", + "title": "Ignore Violations value value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Ignore Violations value", + "type": "array", + "x-array-display": "list", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "Ignore Violations configuration. See the linked native reference for semantics and availability.", + "title": "Ignore Violations", + "type": "object", + "x-clicky-order": 120, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "network": { + "additionalProperties": false, + "description": "Network configuration. See the linked native reference for semantics and availability.", + "properties": { + "allowAllUnixSockets": { + "description": "If true, allow all Unix sockets (disables blocking on both platforms).", + "title": "Allow All Unix Sockets", + "type": "boolean", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "allowLocalBinding": { + "description": "Allow Local Binding configuration. See the linked native reference for semantics and availability.", + "title": "Allow Local Binding", + "type": "boolean", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "allowMachLookup": { + "description": "macOS only: Additional XPC/Mach service names to allow looking up. Supports trailing-wildcard prefix matching (e.g., \"com.apple.coresimulator.*\"). Needed for tools that communicate via XPC such as the iOS Simulator or Playwright.", + "items": { + "description": "Allow Mach Lookup value configuration. See the linked native reference for semantics and availability.", + "title": "Allow Mach Lookup value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Allow Mach Lookup", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "allowManagedDomainsOnly": { + "description": "When true (and set in managed settings), only allowedDomains and WebFetch(domain:...) allow rules from managed settings are respected. User, project, local, and flag settings domains are ignored. Denied domains are still respected from all sources.", + "title": "Allow Managed Domains Only", + "type": "boolean", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "allowUnixSockets": { + "description": "macOS only: Unix socket paths to allow. Ignored on Linux (seccomp cannot filter by path).", + "items": { + "description": "Allow Unix Sockets value configuration. See the linked native reference for semantics and availability.", + "title": "Allow Unix Sockets value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Allow Unix Sockets", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "allowedDomains": { + "description": "Allowed Domains configuration. See the linked native reference for semantics and availability.", + "items": { + "description": "Allowed Domains value configuration. See the linked native reference for semantics and availability.", + "title": "Allowed Domains value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Allowed Domains", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "deniedDomains": { + "description": "Domains that are always blocked, even if matched by allowedDomains. Supports the same wildcard syntax as allowedDomains. Merged from all settings sources regardless of allowManagedDomainsOnly.", + "items": { + "description": "Denied Domains value configuration. See the linked native reference for semantics and availability.", + "title": "Denied Domains value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Denied Domains", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 70, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "httpProxyPort": { + "description": "HTTP Proxy Port configuration. See the linked native reference for semantics and availability.", + "title": "HTTP Proxy Port", + "type": "number", + "x-clicky-order": 80, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "socksProxyPort": { + "description": "Socks Proxy Port configuration. See the linked native reference for semantics and availability.", + "title": "Socks Proxy Port", + "type": "number", + "x-clicky-order": 90, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "strictAllowlist": { + "description": "When true, the sandbox runtime deterministically denies hosts not in allowedDomains instead of prompting. Enforced for sandboxed commands only — in-process tools such as WebFetch are not gated by this setting. Only honored from user, managed/policy, or CLI (--settings) settings — project settings (.claude/settings.json and .claude/settings.local.json) are ignored.", + "title": "Strict Allowlist", + "type": "boolean", + "x-clicky-order": 100, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "tlsTerminate": { + "additionalProperties": false, + "description": "[EXPERIMENTAL] Enable in-process TLS termination so the per-request filter can see HTTPS request bodies. Provide a CA cert+key, or omit both to have sandbox-runtime generate an ephemeral one for the session. On native Windows an ephemeral CA cannot pass the sandbox trust check, so omitting the paths uses a persistent CA managed by the sandbox runtime (set up and trusted via /sandbox install); configured paths are passed to the sandbox runtime verbatim, which rejects a bad or incomplete pair at sandbox initialization. Only honored from user, managed/policy, or CLI (`--settings`) settings — project settings (.claude/settings.json and .claude/settings.local.json) are ignored.", + "properties": { + "caCertPath": { + "description": "Ca Cert Path configuration. See the linked native reference for semantics and availability.", + "title": "Ca Cert Path", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "caKeyPath": { + "description": "Ca Key Path configuration. See the linked native reference for semantics and availability.", + "title": "Ca Key Path", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "title": "Tls Terminate", + "type": "object", + "x-clicky-order": 110, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "title": "Network", + "type": "object", + "x-clicky-order": 130, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "ripgrep": { + "additionalProperties": false, + "description": "Custom ripgrep configuration for bundled ripgrep support. Only honored from user, managed/policy, or CLI (--settings) settings — project settings (.claude/settings.json and .claude/settings.local.json) are ignored.", + "properties": { + "args": { + "description": "Args configuration. See the linked native reference for semantics and availability.", + "items": { + "description": "Args value configuration. See the linked native reference for semantics and availability.", + "title": "Args value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Args", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "command": { + "description": "Command configuration. See the linked native reference for semantics and availability.", + "title": "Command", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "command" + ], + "title": "Ripgrep", + "type": "object", + "x-clicky-order": 140, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "socatPath": { + "description": "Linux/WSL only: Absolute path to the socat binary used for the sandbox network proxy. Overrides auto-detection via PATH. Only honored from admin-controlled managed settings.", + "title": "Socat Path", + "type": "string", + "x-clicky-order": 150, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + }, + "title": "Sandbox", + "type": "object", + "x-captain-option": { + "nativeName": "sandbox", + "specPath": "permissions", + "support": "mapped" + }, + "x-clicky-order": 1250, + "x-clicky-section": "sandbox", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, - "managedSettings": { - "title": "Managed settings", "description": "Enterprise-managed Claude Code settings applied to the query.", - "type": "object", "additionalProperties": true, "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 630, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "managedSettings", "support": "unsupported", "note": "Captain does not inject enterprise-managed settings."} + "sessionId": { + "description": "Explicit UUID assigned when starting a new Agent SDK session.", + "format": "uuid", + "readOnly": true, + "title": "New session ID", + "type": "string", + "x-captain-option": { + "nativeName": "sessionId", + "note": "Captain reads the session identifier emitted by the SDK instead of assigning one.", + "support": "unsupported" + }, + "x-clicky-order": 600, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "sessionStore": { + "additionalProperties": { + "description": "Session Store value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Session Store value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "description": "Custom storage implementation used for Agent SDK session data.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "readOnly": true, + "title": "Session store", + "type": "object", + "x-captain-option": { + "nativeName": "sessionStore", + "note": "Captain does not inject a custom Agent SDK session store.", + "support": "unsupported" + }, + "x-clicky-order": 450, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "sessionStoreFlush": { + "additionalProperties": { + "description": "Session Store Flush value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Session Store Flush value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "description": "Callback invoked to flush custom session storage.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "readOnly": true, + "title": "Session store flush", + "type": "object", + "x-captain-option": { + "nativeName": "sessionStoreFlush", + "note": "Captain does not inject a custom session store flush callback.", + "support": "unsupported" + }, + "x-clicky-order": 460, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, "settingSources": { - "title": "Setting sources", "description": "Filesystem setting scopes loaded by Claude Code.", - "type": "array", "items": {"type": "string", "enum": ["user", "project", "local"]}, "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 640, "x-array-display": "list", - "x-captain-option": {"nativeName": "settingSources", "support": "unsupported", "note": "Captain leaves Agent SDK settings-source discovery at its default."} + "description": "Filesystem setting scopes loaded by Claude Code.", + "items": { + "description": "Setting Sources value configuration. See the linked native reference for semantics and availability.", + "enum": [ + "user", + "project", + "local" + ], + "title": "Setting Sources value", + "type": "string", + "x-enum-display": "segmented", + "x-enum-labels": { + "local": "Local", + "project": "Project", + "user": "User" + }, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "readOnly": true, + "title": "Setting sources", + "type": "array", + "x-captain-option": { + "nativeName": "settingSources", + "note": "Captain leaves Agent SDK settings-source discovery at its default.", + "support": "unsupported" + }, + "x-clicky-order": 640, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "settings": { + "$ref": "#/$defs/AnthropicAgentSettings", + "additionalProperties": { + "description": "Settings value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Settings value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "description": "In-memory Claude Code settings applied to the query.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "readOnly": true, + "title": "Settings", + "type": "object", + "x-captain-option": { + "nativeName": "settings", + "note": "Captain does not inject Agent SDK settings objects.", + "support": "unsupported" + }, + "x-clicky-order": 620, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, "skills": { - "title": "Skills", "description": "Skill configuration made available to the Agent SDK query.", - "type": "array", "items": {"type": "object", "additionalProperties": true}, "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 650, "x-array-display": "stacked", - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "skills", "support": "unsupported", "note": "Captain does not pass inline Agent SDK skill configuration."} + "description": "Skill configuration made available to the Agent SDK query.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "items": { + "additionalProperties": { + "description": "Skills value value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Skills value value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "description": "Skills value configuration. See the linked native reference for semantics and availability.", + "title": "Skills value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "readOnly": true, + "title": "Skills", + "type": "array", + "x-array-display": "stacked", + "x-captain-option": { + "nativeName": "skills", + "note": "Captain does not pass inline Agent SDK skill configuration.", + "support": "unsupported" + }, + "x-clicky-order": 650, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "debug": { - "title": "Debug", "description": "Whether Agent SDK debug logging is enabled.", - "type": "boolean", "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 660, - "x-captain-option": {"nativeName": "debug", "support": "unsupported", "note": "Captain does not expose the SDK debug switch."} + "spawnClaudeCodeProcess": { + "additionalProperties": { + "description": "Spawn Claude Code Process value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Spawn Claude Code Process value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "description": "Custom callback used by the SDK to start the Claude Code process.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "readOnly": true, + "title": "Process spawner", + "type": "object", + "x-captain-option": { + "nativeName": "spawnClaudeCodeProcess", + "note": "Captain's packaged bridge uses the SDK default process spawner.", + "support": "unsupported" + }, + "x-clicky-order": 700, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "debugFile": { - "title": "Debug file", "description": "Path receiving Agent SDK debug logs.", - "type": "string", "format": "path", "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 670, - "x-captain-option": {"nativeName": "debugFile", "support": "unsupported", "note": "Captain does not expose native SDK debug-file output."} + "stderr": { + "additionalProperties": { + "description": "Stderr value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Stderr value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "description": "Agent SDK callback forwarding child-process diagnostics to Captain.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "readOnly": true, + "title": "Standard error handler", + "type": "object", + "x-captain-option": { + "nativeName": "stderr", + "note": "The bridge owns stderr forwarding over the host protocol.", + "support": "managed" + }, + "x-clicky-order": 250, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, "strictMcpConfig": { - "title": "Strict MCP configuration", "description": "Whether Claude ignores all MCP servers except those supplied in options.", - "type": "boolean", "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 680, - "x-captain-option": {"nativeName": "strictMcpConfig", "support": "unsupported", "note": "Captain injects its caller-tool server without replacing user MCP configuration."} + "description": "Whether Claude ignores all MCP servers except those supplied in options.", + "readOnly": true, + "title": "Strict MCP configuration", + "type": "boolean", + "x-captain-option": { + "nativeName": "strictMcpConfig", + "note": "Captain injects its caller-tool server without replacing user MCP configuration.", + "support": "unsupported" + }, + "x-clicky-order": 680, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "title": { - "title": "Session title", "description": "Display title assigned to the Claude Agent SDK session.", - "type": "string", "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 690, - "x-captain-option": {"nativeName": "title", "support": "unsupported", "note": "Captain does not assign an SDK-native session title."} + "supportedDialogKinds": { + "description": "User-dialog kinds the host declares it can render.", + "items": { + "description": "Supported Dialog Kinds value configuration. See the linked native reference for semantics and availability.", + "title": "Supported Dialog Kinds value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "readOnly": true, + "title": "Supported dialog kinds", + "type": "array", + "x-array-display": "list", + "x-captain-option": { + "nativeName": "supportedDialogKinds", + "note": "Captain does not advertise Agent SDK native dialog rendering.", + "support": "unsupported" + }, + "x-clicky-order": 430, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "spawnClaudeCodeProcess": { - "title": "Process spawner", "description": "Custom callback used by the SDK to start the Claude Code process.", - "type": "object", "additionalProperties": true, "readOnly": true, "x-clicky-section": "environment", "x-clicky-order": 700, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "spawnClaudeCodeProcess", "support": "unsupported", "note": "Captain's packaged bridge uses the SDK default process spawner."} + "systemPrompt": { + "description": "System prompt string, string blocks, or custom/preset configuration used for the session.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "oneOf": [ + { + "description": "System Prompt configuration. See the linked native reference for semantics and availability.", + "title": "System Prompt", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + { + "description": "System Prompt configuration. See the linked native reference for semantics and availability.", + "items": { + "description": "System Prompt value configuration. See the linked native reference for semantics and availability.", + "title": "System Prompt value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "title": "System Prompt", + "type": "array", + "x-array-display": "list", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": { + "description": "System Prompt value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "System Prompt value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "description": "System Prompt configuration. See the linked native reference for semantics and availability.", + "title": "System Prompt", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + } + ], + "title": "System prompt", + "x-captain-option": { + "nativeName": "systemPrompt", + "specPath": "prompt.system", + "support": "mapped" + }, + "x-clicky-order": 40, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "projectConfigRoot": { - "title": "Project config root", "description": "Trusted checkout that cwd is a worktree of; project settings, .mcp.json and .claude config trees load from here instead of cwd.", - "type": "string", "format": "path", "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 710, - "x-captain-option": {"nativeName": "projectConfigRoot", "support": "unsupported", "note": "Captain loads project configuration from the run's working directory."} + "taskBudget": { + "additionalProperties": { + "description": "Task Budget value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Task Budget value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "description": "Native budget constraints applied to SDK task execution.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "readOnly": true, + "title": "Task budget", + "type": "object", + "x-captain-option": { + "nativeName": "taskBudget", + "note": "Captain maps maxTurns and maxBudgetUsd but not the SDK taskBudget object.", + "support": "unsupported" + }, + "x-clicky-order": 530, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "perTaskStopAffordance": { - "title": "Per-task stop affordance", "description": "Declares that the host can stop individual background tasks, so an interrupt only aborts the current turn.", - "type": "boolean", "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 720, - "x-captain-option": {"nativeName": "perTaskStopAffordance", "support": "unsupported", "note": "Captain interrupts stop the whole query, including background tasks."} + "thinking": { + "additionalProperties": { + "description": "Thinking value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Thinking value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "description": "Detailed native thinking configuration beyond the effort level.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "readOnly": true, + "title": "Thinking", + "type": "object", + "x-captain-option": { + "nativeName": "thinking", + "note": "Captain maps model.effort and does not expose the lower-level SDK thinking object.", + "support": "unsupported" + }, + "x-clicky-order": 510, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "verbatimPrompts": { - "title": "Verbatim prompts", "description": "Deliver prompt text as written, without @path expansion, slash-command dispatch or turn-start attachments.", - "type": "boolean", "readOnly": true, "x-clicky-section": "prompt", "x-clicky-order": 730, - "x-captain-option": {"nativeName": "verbatimPrompts", "support": "unsupported", "note": "Captain sends prompts with the SDK default mention and slash-command handling."} + "title": { + "description": "Display title assigned to the Claude Agent SDK session.", + "readOnly": true, + "title": "Session title", + "type": "string", + "x-captain-option": { + "nativeName": "title", + "note": "Captain does not assign an SDK-native session title.", + "support": "unsupported" + }, + "x-clicky-order": 690, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "permissionPrompts": { - "title": "Permission prompts", "description": "Who answers permission prompts: the host through canUseTool, or nobody so prompting requests are denied.", - "type": "string", "enum": ["host", "none"], "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 740, - "x-captain-option": {"nativeName": "permissionPrompts", "support": "unsupported", "note": "Captain always answers permission prompts through its canUseTool callback."} + "toolAliases": { + "additionalProperties": { + "description": "Tool Aliases value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Tool Aliases value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "description": "Alternate display names and descriptions for SDK tools.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "readOnly": true, + "title": "Tool aliases", + "type": "object", + "x-captain-option": { + "nativeName": "toolAliases", + "note": "Captain does not rewrite native Claude tool metadata.", + "support": "unsupported" + }, + "x-clicky-order": 300, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "pluginDelivery": { - "title": "Plugin delivery", "description": "How plugins reach the Claude Code process: --plugin-dir arguments or the initialize request.", - "type": "string", "enum": ["argv", "initialize"], "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 750, - "x-captain-option": {"nativeName": "pluginDelivery", "support": "unsupported", "note": "Captain does not expose Agent SDK plugin loading."} + "toolConfig": { + "additionalProperties": { + "description": "Tool Config value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Tool Config value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "description": "Native per-tool configuration supplied to the Agent SDK.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "readOnly": true, + "title": "Tool configuration", + "type": "object", + "x-captain-option": { + "nativeName": "toolConfig", + "note": "Captain does not expose Agent SDK per-tool configuration.", + "support": "unsupported" + }, + "x-clicky-order": 380, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } }, - "resumeDropsTurn": { - "title": "Resume drops turn", "description": "Guarded fork point paired with resumeSessionAt that discards the turn after the kept chain entry.", - "type": "string", "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 760, - "x-captain-option": {"nativeName": "resumeDropsTurn", "support": "unsupported", "note": "Captain resumes the latest point of an explicit session."} + "tools": { + "description": "Built-in tool preset or explicit SDK tool-name list.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "oneOf": [ + { + "description": "Tools configuration. See the linked native reference for semantics and availability.", + "title": "Tools", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + { + "description": "Tools configuration. See the linked native reference for semantics and availability.", + "items": { + "description": "Tools value configuration. See the linked native reference for semantics and availability.", + "title": "Tools value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "title": "Tools", + "type": "array", + "x-array-display": "list", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + } + ], + "readOnly": true, + "title": "Tool set", + "x-captain-option": { + "nativeName": "tools", + "note": "Captain maps allow and deny policies instead of replacing the SDK tool set.", + "support": "unsupported" + }, + "x-clicky-order": 310, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } + }, + "verbatimPrompts": { + "description": "Deliver prompt text as written, without @path expansion, slash-command dispatch or turn-start attachments.", + "readOnly": true, + "title": "Verbatim prompts", + "type": "boolean", + "x-captain-option": { + "nativeName": "verbatimPrompts", + "note": "Captain sends prompts with the SDK default mention and slash-command handling.", + "support": "unsupported" + }, + "x-clicky-order": 730, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] + } } + }, + "title": "Anthropic Agent options", + "type": "object", + "x-captain-adapter": { + "mode": "agent", + "provider": "anthropic", + "sources": [ + { + "kind": "sdk", + "reference": "@anthropic-ai/claude-agent-sdk.Options", + "version": "0.3.280" + }, + { + "kind": "protocol", + "reference": "pkg/ai/provider/claudeagent/protocol.ts InitializeParams and PromptParams", + "version": "6a2b56cbd26702b18905865f21fc66d44cc864cc" + }, + { + "kind": "implementation", + "reference": "pkg/ai/provider/claudeagent/agent.ts and bridge_params.go", + "version": "6a2b56cbd26702b18905865f21fc66d44cc864cc" + } + ] + }, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/agent-sdk/typescript", + "label": "Documentation" + } + ] } } diff --git a/pkg/adapters/anthropic/api.schema.json b/pkg/adapters/anthropic/api.schema.json index f4f1dcb8..e38efb4d 100644 --- a/pkg/adapters/anthropic/api.schema.json +++ b/pkg/adapters/anthropic/api.schema.json @@ -1,117 +1,9054 @@ { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "AnthropicAPIOptions", - "description": "Native Anthropic Messages API request options used by Captain's API runtime.", - "type": "object", - "additionalProperties": false, - "x-captain-adapter": { - "provider": "anthropic", - "mode": "api", - "sources": [ - {"kind": "sdk", "reference": "github.com/anthropics/anthropic-sdk-go.MessageNewParams", "version": "v1.26.0"}, - {"kind": "official-docs", "reference": "https://platform.claude.com/docs/en/api/http/messages/create", "version": "retrieved 2026-09-11"}, - {"kind": "implementation", "reference": "pkg/ai/provider/genkit/options.go and firebase/genkit plugins/internal/anthropic", "version": "6a2b56cbd26702b18905865f21fc66d44cc864cc"} - ] - }, - "required": ["max_tokens", "messages", "model"], - "properties": { - "model": { - "title": "Model", "description": "Anthropic model identifier used to complete the request.", - "type": "string", "minLength": 1, "x-clicky-section": "model", "x-clicky-order": 10, "x-icon": "sparkles", - "x-captain-option": {"nativeName": "model", "support": "mapped", "specPath": "model.name"} + "$defs": { + "AnthropicAPIBase64ImageSourceParam": { + "additionalProperties": false, + "description": "The properties Data, MediaType, Type are required.\n", + "properties": { + "data": { + "description": "Data configuration. See the linked native reference for semantics and availability.", + "title": "Data", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "media_type": { + "description": "Any of \"image/jpeg\", \"image/png\", \"image/gif\", \"image/webp\".\n", + "enum": [ + "image/jpeg", + "image/png", + "image/gif", + "image/webp" + ], + "title": "Media type", + "type": "string", + "x-clicky-order": 20, + "x-enum-display": "segmented", + "x-enum-labels": { + "image/gif": "Image/gif", + "image/jpeg": "Image/jpeg", + "image/png": "Image/png", + "image/webp": "Image/webp" + }, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "base64", + "description": "This field can be elided, and will marshal its zero value as \"base64\".\n", + "title": "Type", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "data", + "media_type", + "type" + ], + "title": "Anthropic APIBase64Image Source Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } }, - "max_tokens": { - "title": "Maximum output tokens", "description": "Maximum tokens generated before stopping, including extended-thinking tokens.", - "type": "integer", "minimum": 1, "x-clicky-section": "model", "x-clicky-order": 20, "x-icon": "hash", - "x-captain-option": {"nativeName": "max_tokens", "support": "mapped", "specPath": "budget.maxTokens"} + "AnthropicAPIBase64PDFSourceParam": { + "additionalProperties": false, + "description": "The properties Data, MediaType, Type are required.\n", + "properties": { + "data": { + "description": "Data configuration. See the linked native reference for semantics and availability.", + "title": "Data", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "media_type": { + "const": "application/pdf", + "description": "This field can be elided, and will marshal its zero value as \"application/pdf\".\n", + "title": "Media type", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "base64", + "description": "This field can be elided, and will marshal its zero value as \"base64\".\n", + "title": "Type", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "data", + "media_type", + "type" + ], + "title": "Anthropic APIBase64PDFSource Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } }, - "messages": { - "title": "Messages", "description": "Alternating user and assistant messages sent to the Messages API.", - "type": "array", "items": {"type": "object", "additionalProperties": true}, "x-clicky-section": "prompt", "x-clicky-order": 30, "x-array-display": "stacked", - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "messages", "support": "mapped", "specPath": ["messages", "prompt.user", "prompt.attachments"]} + "AnthropicAPIBashCodeExecutionOutputBlockParam": { + "additionalProperties": false, + "description": "The properties FileID, Type are required.\n", + "properties": { + "file_id": { + "description": "File id configuration. See the linked native reference for semantics and availability.", + "title": "File id", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "bash_code_execution_output", + "description": "This field can be elided, and will marshal its zero value as\n\"bash_code_execution_output\".\n", + "title": "Type", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "file_id", + "type" + ], + "title": "Anthropic APIBash Code Execution Output Block Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } }, - "system": { - "title": "System prompt", "description": "System instruction blocks supplied outside the message list.", - "type": "array", "items": {"type": "object", "additionalProperties": true}, "x-clicky-section": "prompt", "x-clicky-order": 40, "x-array-display": "stacked", - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "system", "support": "mapped", "specPath": "prompt.system"} + "AnthropicAPIBashCodeExecutionResultBlockParam": { + "additionalProperties": false, + "description": "The properties Content, ReturnCode, Stderr, Stdout, Type are required.\n", + "properties": { + "content": { + "description": "Content configuration. See the linked native reference for semantics and availability.", + "items": { + "$ref": "#/$defs/AnthropicAPIBashCodeExecutionOutputBlockParam", + "description": "Content value configuration. See the linked native reference for semantics and availability.", + "title": "Content value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": "Content", + "type": "array", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "return_code": { + "description": "Return code configuration. See the linked native reference for semantics and availability.", + "title": "Return code", + "type": "integer", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "stderr": { + "description": "Stderr configuration. See the linked native reference for semantics and availability.", + "title": "Stderr", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "stdout": { + "description": "Stdout configuration. See the linked native reference for semantics and availability.", + "title": "Stdout", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "bash_code_execution_result", + "description": "This field can be elided, and will marshal its zero value as\n\"bash_code_execution_result\".\n", + "title": "Type", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "content", + "return_code", + "stderr", + "stdout", + "type" + ], + "title": "Anthropic APIBash Code Execution Result Block Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } }, - "temperature": { - "title": "Temperature", "description": "Sampling temperature between zero and one.", - "type": "number", "minimum": 0, "maximum": 1, "x-clicky-section": "model", "x-clicky-order": 50, - "x-captain-option": {"nativeName": "temperature", "support": "mapped", "specPath": "model.temperature"} + "AnthropicAPIBashCodeExecutionToolResultBlockParam": { + "additionalProperties": false, + "description": "The properties Content, ToolUseID, Type are required.\n", + "properties": { + "cache_control": { + "$ref": "#/$defs/AnthropicAPICacheControlEphemeralParam", + "description": "Create a cache control breakpoint at this content block.\n", + "title": "Cache control", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "content": { + "$ref": "#/$defs/AnthropicAPIBashCodeExecutionToolResultBlockParamContentUnion", + "description": "Content configuration. See the linked native reference for semantics and availability.", + "title": "Content", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "tool_use_id": { + "description": "Tool use id configuration. See the linked native reference for semantics and availability.", + "title": "Tool use id", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "bash_code_execution_tool_result", + "description": "This field can be elided, and will marshal its zero value as\n\"bash_code_execution_tool_result\".\n", + "title": "Type", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "content", + "tool_use_id", + "type" + ], + "title": "Anthropic APIBash Code Execution Tool Result Block Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } }, - "thinking": { - "title": "Thinking", "description": "Extended-thinking configuration for reasoning-capable models.", - "type": "object", "additionalProperties": true, "x-clicky-section": "model", "x-clicky-order": 60, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "thinking", "support": "mapped", "specPath": "model.effort"} + "AnthropicAPIBashCodeExecutionToolResultBlockParamContentUnion": { + "anyOf": [ + { + "$ref": "#/$defs/AnthropicAPIBashCodeExecutionToolResultErrorParam", + "description": "Anthropic APIBash Code Execution Tool Result Block Param Content Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIBash Code Execution Tool Result Block Param Content Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIBashCodeExecutionResultBlockParam", + "description": "Anthropic APIBash Code Execution Tool Result Block Param Content Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIBash Code Execution Tool Result Block Param Content Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + ], + "description": "Anthropic APIBash Code Execution Tool Result Block Param Content Union configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Anthropic APIBash Code Execution Tool Result Block Param Content Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } }, - "output_config": { - "title": "Output configuration", "description": "Structured-output format and adaptive-thinking effort configuration.", - "type": "object", "additionalProperties": true, "x-clicky-section": "prompt", "x-clicky-order": 70, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "output_config", "support": "mapped", "specPath": ["prompt.schema", "prompt.schemaJson", "model.effort"]} + "AnthropicAPIBashCodeExecutionToolResultErrorParam": { + "additionalProperties": false, + "description": "The properties ErrorCode, Type are required.\n", + "properties": { + "error_code": { + "description": "Any of \"invalid_tool_input\", \"unavailable\", \"too_many_requests\",\n\"execution_time_exceeded\", \"output_file_too_large\".\n", + "enum": [ + "invalid_tool_input", + "unavailable", + "too_many_requests", + "execution_time_exceeded", + "output_file_too_large" + ], + "title": "Error code", + "type": "string", + "x-clicky-order": 10, + "x-enum-display": "combobox", + "x-enum-labels": { + "execution_time_exceeded": "Execution time exceeded", + "invalid_tool_input": "Invalid tool input", + "output_file_too_large": "Output file too large", + "too_many_requests": "Too many requests", + "unavailable": "Unavailable" + }, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "bash_code_execution_tool_result_error", + "description": "This field can be elided, and will marshal its zero value as\n\"bash_code_execution_tool_result_error\".\n", + "title": "Type", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "error_code", + "type" + ], + "title": "Anthropic APIBash Code Execution Tool Result Error Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } }, - "tools": { - "title": "Tools", "description": "Native Anthropic tool definitions derived from Captain caller tools.", - "type": "array", "items": {"type": "object", "additionalProperties": true}, "x-clicky-section": "permissions", "x-clicky-order": 80, "x-array-display": "stacked", - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, "readOnly": true, - "x-captain-option": {"nativeName": "tools", "support": "managed", "note": "Captain derives native tool definitions from runtime Config.Tools and the Spec tool policy."} + "AnthropicAPICacheControlEphemeralParam": { + "additionalProperties": false, + "description": "This struct has a constant value, construct it with\n[NewCacheControlEphemeralParam].\n", + "properties": { + "ttl": { + "description": "The time-to-live for the cache control breakpoint.\n\nThis may be one the following values:\n\n- `5m`: 5 minutes\n- `1h`: 1 hour\n\nDefaults to `5m`.\n\nAny of \"5m\", \"1h\".\n", + "enum": [ + "5m", + "1h" + ], + "title": "Ttl", + "type": "string", + "x-clicky-order": 10, + "x-enum-display": "segmented", + "x-enum-labels": { + "1h": "1h", + "5m": "5m" + }, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "ephemeral", + "description": "Type configuration. See the linked native reference for semantics and availability.", + "title": "Type", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type" + ], + "title": "Anthropic APICache Control Ephemeral Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } }, - "stream": { - "title": "Stream", "description": "Whether the Messages API returns server-sent streaming events.", - "type": "boolean", "const": true, "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 90, - "x-captain-option": {"nativeName": "stream", "support": "managed", "note": "Captain selects the SDK streaming method for ExecuteStream."} + "AnthropicAPICitationCharLocationParam": { + "additionalProperties": false, + "description": "The properties CitedText, DocumentIndex, DocumentTitle, EndCharIndex,\nStartCharIndex, Type are required.\n", + "properties": { + "cited_text": { + "description": "Cited text configuration. See the linked native reference for semantics and availability.", + "title": "Cited text", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "document_index": { + "description": "Document index configuration. See the linked native reference for semantics and availability.", + "title": "Document index", + "type": "integer", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "document_title": { + "description": "Document title configuration. See the linked native reference for semantics and availability.", + "title": "Document title", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "end_char_index": { + "description": "End char index configuration. See the linked native reference for semantics and availability.", + "title": "End char index", + "type": "integer", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "start_char_index": { + "description": "Start char index configuration. See the linked native reference for semantics and availability.", + "title": "Start char index", + "type": "integer", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "char_location", + "description": "This field can be elided, and will marshal its zero value as \"char_location\".\n", + "title": "Type", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "document_title", + "cited_text", + "document_index", + "end_char_index", + "start_char_index", + "type" + ], + "title": "Anthropic APICitation Char Location Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } }, - "container": { - "title": "Container", "description": "Container identifier reused across Messages API requests.", - "type": "string", "readOnly": true, "x-clicky-section": "environment", "x-clicky-order": 100, - "x-captain-option": {"nativeName": "container", "support": "unsupported", "note": "Captain does not expose Anthropic container reuse."} + "AnthropicAPICitationContentBlockLocationParam": { + "additionalProperties": false, + "description": "The properties CitedText, DocumentIndex, DocumentTitle, EndBlockIndex,\nStartBlockIndex, Type are required.\n", + "properties": { + "cited_text": { + "description": "Cited text configuration. See the linked native reference for semantics and availability.", + "title": "Cited text", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "document_index": { + "description": "Document index configuration. See the linked native reference for semantics and availability.", + "title": "Document index", + "type": "integer", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "document_title": { + "description": "Document title configuration. See the linked native reference for semantics and availability.", + "title": "Document title", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "end_block_index": { + "description": "End block index configuration. See the linked native reference for semantics and availability.", + "title": "End block index", + "type": "integer", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "start_block_index": { + "description": "Start block index configuration. See the linked native reference for semantics and availability.", + "title": "Start block index", + "type": "integer", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "content_block_location", + "description": "This field can be elided, and will marshal its zero value as\n\"content_block_location\".\n", + "title": "Type", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "document_title", + "cited_text", + "document_index", + "end_block_index", + "start_block_index", + "type" + ], + "title": "Anthropic APICitation Content Block Location Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } }, - "inference_geo": { - "title": "Inference geography", "description": "Geographic region requested for inference processing.", - "type": "string", "readOnly": true, "x-clicky-section": "environment", "x-clicky-order": 110, - "x-captain-option": {"nativeName": "inference_geo", "support": "unsupported", "note": "Captain does not set a per-request inference geography."} + "AnthropicAPICitationPageLocationParam": { + "additionalProperties": false, + "description": "The properties CitedText, DocumentIndex, DocumentTitle, EndPageNumber,\nStartPageNumber, Type are required.\n", + "properties": { + "cited_text": { + "description": "Cited text configuration. See the linked native reference for semantics and availability.", + "title": "Cited text", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "document_index": { + "description": "Document index configuration. See the linked native reference for semantics and availability.", + "title": "Document index", + "type": "integer", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "document_title": { + "description": "Document title configuration. See the linked native reference for semantics and availability.", + "title": "Document title", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "end_page_number": { + "description": "End page number configuration. See the linked native reference for semantics and availability.", + "title": "End page number", + "type": "integer", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "start_page_number": { + "description": "Start page number configuration. See the linked native reference for semantics and availability.", + "title": "Start page number", + "type": "integer", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "page_location", + "description": "This field can be elided, and will marshal its zero value as \"page_location\".\n", + "title": "Type", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "document_title", + "cited_text", + "document_index", + "end_page_number", + "start_page_number", + "type" + ], + "title": "Anthropic APICitation Page Location Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } }, - "top_k": { - "title": "Top K", "description": "Number of highest-probability tokens retained during sampling.", - "type": "integer", "minimum": 0, "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 120, - "x-captain-option": {"nativeName": "top_k", "support": "unsupported", "note": "Captain has no native top-k Spec field."} + "AnthropicAPICitationSearchResultLocationParam": { + "additionalProperties": false, + "description": "The properties CitedText, EndBlockIndex, SearchResultIndex, Source,\nStartBlockIndex, Title, Type are required.\n", + "properties": { + "cited_text": { + "description": "Cited text configuration. See the linked native reference for semantics and availability.", + "title": "Cited text", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "end_block_index": { + "description": "End block index configuration. See the linked native reference for semantics and availability.", + "title": "End block index", + "type": "integer", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "search_result_index": { + "description": "Search result index configuration. See the linked native reference for semantics and availability.", + "title": "Search result index", + "type": "integer", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "source": { + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "start_block_index": { + "description": "Start block index configuration. See the linked native reference for semantics and availability.", + "title": "Start block index", + "type": "integer", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": { + "description": "Title configuration. See the linked native reference for semantics and availability.", + "title": "Title", + "type": "string", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "search_result_location", + "description": "This field can be elided, and will marshal its zero value as\n\"search_result_location\".\n", + "title": "Type", + "x-clicky-order": 70, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "title", + "cited_text", + "end_block_index", + "search_result_index", + "source", + "start_block_index", + "type" + ], + "title": "Anthropic APICitation Search Result Location Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } }, - "top_p": { - "title": "Top P", "description": "Cumulative probability mass retained during nucleus sampling.", - "type": "number", "minimum": 0, "maximum": 1, "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 130, - "x-captain-option": {"nativeName": "top_p", "support": "unsupported", "note": "Captain has no native top-p Spec field."} + "AnthropicAPICitationWebSearchResultLocationParam": { + "additionalProperties": false, + "description": "The properties CitedText, EncryptedIndex, Title, Type, URL are required.\n", + "properties": { + "cited_text": { + "description": "Cited text configuration. See the linked native reference for semantics and availability.", + "title": "Cited text", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "encrypted_index": { + "description": "Encrypted index configuration. See the linked native reference for semantics and availability.", + "title": "Encrypted index", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": { + "description": "Title configuration. See the linked native reference for semantics and availability.", + "title": "Title", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "web_search_result_location", + "description": "This field can be elided, and will marshal its zero value as\n\"web_search_result_location\".\n", + "title": "Type", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "Url configuration. See the linked native reference for semantics and availability.", + "title": "Url", + "type": "string", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "title", + "cited_text", + "encrypted_index", + "url", + "type" + ], + "title": "Anthropic APICitation Web Search Result Location Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPICitationsConfigParam": { + "additionalProperties": false, + "description": "Anthropic APICitations Config Param configuration. See the linked native reference for semantics and availability.", + "properties": { + "enabled": { + "description": "Enabled configuration. See the linked native reference for semantics and availability.", + "title": "Enabled", + "type": "boolean", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "title": "Anthropic APICitations Config Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPICodeExecutionOutputBlockParam": { + "additionalProperties": false, + "description": "The properties FileID, Type are required.\n", + "properties": { + "file_id": { + "description": "File id configuration. See the linked native reference for semantics and availability.", + "title": "File id", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "code_execution_output", + "description": "This field can be elided, and will marshal its zero value as\n\"code_execution_output\".\n", + "title": "Type", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "file_id", + "type" + ], + "title": "Anthropic APICode Execution Output Block Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPICodeExecutionResultBlockParam": { + "additionalProperties": false, + "description": "The properties Content, ReturnCode, Stderr, Stdout, Type are required.\n", + "properties": { + "content": { + "description": "Content configuration. See the linked native reference for semantics and availability.", + "items": { + "$ref": "#/$defs/AnthropicAPICodeExecutionOutputBlockParam", + "description": "Content value configuration. See the linked native reference for semantics and availability.", + "title": "Content value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": "Content", + "type": "array", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "return_code": { + "description": "Return code configuration. See the linked native reference for semantics and availability.", + "title": "Return code", + "type": "integer", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "stderr": { + "description": "Stderr configuration. See the linked native reference for semantics and availability.", + "title": "Stderr", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "stdout": { + "description": "Stdout configuration. See the linked native reference for semantics and availability.", + "title": "Stdout", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "code_execution_result", + "description": "This field can be elided, and will marshal its zero value as\n\"code_execution_result\".\n", + "title": "Type", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "content", + "return_code", + "stderr", + "stdout", + "type" + ], + "title": "Anthropic APICode Execution Result Block Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPICodeExecutionTool20250522Param": { + "additionalProperties": false, + "description": "The properties Name, Type are required.\n", + "properties": { + "allowed_callers": { + "description": "Any of \"direct\", \"code_execution_20250825\", \"code_execution_20260120\".\n", + "items": { + "description": "Allowed callers value configuration. See the linked native reference for semantics and availability.", + "title": "Allowed callers value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": "Allowed callers", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "cache_control": { + "$ref": "#/$defs/AnthropicAPICacheControlEphemeralParam", + "description": "Create a cache control breakpoint at this content block.\n", + "title": "Cache control", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "defer_loading": { + "description": "If true, tool will not be included in initial system prompt. Only loaded when\nreturned via tool_reference from tool search.\n", + "title": "Defer loading", + "type": "boolean", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "name": { + "const": "code_execution", + "description": "Name of the tool.\n\nThis is how the tool will be called by the model and in `tool_use` blocks.\n\nThis field can be elided, and will marshal its zero value as \"code_execution\".\n", + "title": "Name", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "strict": { + "description": "When true, guarantees schema validation on tool names and inputs\n", + "title": "Strict", + "type": "boolean", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "code_execution_20250522", + "description": "This field can be elided, and will marshal its zero value as\n\"code_execution_20250522\".\n", + "title": "Type", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "name", + "type" + ], + "title": "Anthropic APICode Execution Tool20250522Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPICodeExecutionTool20250825Param": { + "additionalProperties": false, + "description": "The properties Name, Type are required.\n", + "properties": { + "allowed_callers": { + "description": "Any of \"direct\", \"code_execution_20250825\", \"code_execution_20260120\".\n", + "items": { + "description": "Allowed callers value configuration. See the linked native reference for semantics and availability.", + "title": "Allowed callers value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": "Allowed callers", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "cache_control": { + "$ref": "#/$defs/AnthropicAPICacheControlEphemeralParam", + "description": "Create a cache control breakpoint at this content block.\n", + "title": "Cache control", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "defer_loading": { + "description": "If true, tool will not be included in initial system prompt. Only loaded when\nreturned via tool_reference from tool search.\n", + "title": "Defer loading", + "type": "boolean", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "name": { + "const": "code_execution", + "description": "Name of the tool.\n\nThis is how the tool will be called by the model and in `tool_use` blocks.\n\nThis field can be elided, and will marshal its zero value as \"code_execution\".\n", + "title": "Name", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "strict": { + "description": "When true, guarantees schema validation on tool names and inputs\n", + "title": "Strict", + "type": "boolean", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "code_execution_20250825", + "description": "This field can be elided, and will marshal its zero value as\n\"code_execution_20250825\".\n", + "title": "Type", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "name", + "type" + ], + "title": "Anthropic APICode Execution Tool20250825Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPICodeExecutionTool20260120Param": { + "additionalProperties": false, + "description": "Code execution tool with REPL state persistence (daemon mode + gVisor\ncheckpoint).\n\nThe properties Name, Type are required.\n", + "properties": { + "allowed_callers": { + "description": "Any of \"direct\", \"code_execution_20250825\", \"code_execution_20260120\".\n", + "items": { + "description": "Allowed callers value configuration. See the linked native reference for semantics and availability.", + "title": "Allowed callers value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": "Allowed callers", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "cache_control": { + "$ref": "#/$defs/AnthropicAPICacheControlEphemeralParam", + "description": "Create a cache control breakpoint at this content block.\n", + "title": "Cache control", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "defer_loading": { + "description": "If true, tool will not be included in initial system prompt. Only loaded when\nreturned via tool_reference from tool search.\n", + "title": "Defer loading", + "type": "boolean", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "name": { + "const": "code_execution", + "description": "Name of the tool.\n\nThis is how the tool will be called by the model and in `tool_use` blocks.\n\nThis field can be elided, and will marshal its zero value as \"code_execution\".\n", + "title": "Name", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "strict": { + "description": "When true, guarantees schema validation on tool names and inputs\n", + "title": "Strict", + "type": "boolean", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "code_execution_20260120", + "description": "This field can be elided, and will marshal its zero value as\n\"code_execution_20260120\".\n", + "title": "Type", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "name", + "type" + ], + "title": "Anthropic APICode Execution Tool20260120Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPICodeExecutionToolResultBlockParam": { + "additionalProperties": false, + "description": "The properties Content, ToolUseID, Type are required.\n", + "properties": { + "cache_control": { + "$ref": "#/$defs/AnthropicAPICacheControlEphemeralParam", + "description": "Create a cache control breakpoint at this content block.\n", + "title": "Cache control", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "content": { + "$ref": "#/$defs/AnthropicAPICodeExecutionToolResultBlockParamContentUnion", + "description": "Code execution result with encrypted stdout for PFC + web_search results.\n", + "title": "Content", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "tool_use_id": { + "description": "Tool use id configuration. See the linked native reference for semantics and availability.", + "title": "Tool use id", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "code_execution_tool_result", + "description": "This field can be elided, and will marshal its zero value as\n\"code_execution_tool_result\".\n", + "title": "Type", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "content", + "tool_use_id", + "type" + ], + "title": "Anthropic APICode Execution Tool Result Block Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPICodeExecutionToolResultBlockParamContentUnion": { + "anyOf": [ + { + "$ref": "#/$defs/AnthropicAPICodeExecutionToolResultErrorParam", + "description": "Anthropic APICode Execution Tool Result Block Param Content Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APICode Execution Tool Result Block Param Content Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPICodeExecutionResultBlockParam", + "description": "Anthropic APICode Execution Tool Result Block Param Content Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APICode Execution Tool Result Block Param Content Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIEncryptedCodeExecutionResultBlockParam", + "description": "Anthropic APICode Execution Tool Result Block Param Content Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APICode Execution Tool Result Block Param Content Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + ], + "description": "Anthropic APICode Execution Tool Result Block Param Content Union configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Anthropic APICode Execution Tool Result Block Param Content Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPICodeExecutionToolResultErrorParam": { + "additionalProperties": false, + "description": "The properties ErrorCode, Type are required.\n", + "properties": { + "error_code": { + "description": "Any of \"invalid_tool_input\", \"unavailable\", \"too_many_requests\",\n\"execution_time_exceeded\".\n", + "enum": [ + "invalid_tool_input", + "unavailable", + "too_many_requests", + "execution_time_exceeded" + ], + "title": "Error code", + "type": "string", + "x-clicky-order": 10, + "x-enum-display": "segmented", + "x-enum-labels": { + "execution_time_exceeded": "Execution time exceeded", + "invalid_tool_input": "Invalid tool input", + "too_many_requests": "Too many requests", + "unavailable": "Unavailable" + }, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "code_execution_tool_result_error", + "description": "This field can be elided, and will marshal its zero value as\n\"code_execution_tool_result_error\".\n", + "title": "Type", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "error_code", + "type" + ], + "title": "Anthropic APICode Execution Tool Result Error Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIContainerUploadBlockParam": { + "additionalProperties": false, + "description": "A content block that represents a file to be uploaded to the container Files\nuploaded via this block will be available in the container's input directory.\n\nThe properties FileID, Type are required.\n", + "properties": { + "cache_control": { + "$ref": "#/$defs/AnthropicAPICacheControlEphemeralParam", + "description": "Create a cache control breakpoint at this content block.\n", + "title": "Cache control", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "file_id": { + "description": "File id configuration. See the linked native reference for semantics and availability.", + "title": "File id", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "container_upload", + "description": "This field can be elided, and will marshal its zero value as \"container_upload\".\n", + "title": "Type", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "file_id", + "type" + ], + "title": "Anthropic APIContainer Upload Block Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIContentBlockParamUnion": { + "anyOf": [ + { + "$ref": "#/$defs/AnthropicAPITextBlockParam", + "description": "Anthropic APIContent Block Param Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIContent Block Param Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIImageBlockParam", + "description": "Anthropic APIContent Block Param Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIContent Block Param Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIDocumentBlockParam", + "description": "Anthropic APIContent Block Param Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIContent Block Param Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPISearchResultBlockParam", + "description": "Anthropic APIContent Block Param Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIContent Block Param Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIThinkingBlockParam", + "description": "Anthropic APIContent Block Param Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIContent Block Param Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIRedactedThinkingBlockParam", + "description": "Anthropic APIContent Block Param Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIContent Block Param Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIToolUseBlockParam", + "description": "Anthropic APIContent Block Param Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIContent Block Param Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIToolResultBlockParam", + "description": "Anthropic APIContent Block Param Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIContent Block Param Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIServerToolUseBlockParam", + "description": "Anthropic APIContent Block Param Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIContent Block Param Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIWebSearchToolResultBlockParam", + "description": "Anthropic APIContent Block Param Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIContent Block Param Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIWebFetchToolResultBlockParam", + "description": "Anthropic APIContent Block Param Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIContent Block Param Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPICodeExecutionToolResultBlockParam", + "description": "Anthropic APIContent Block Param Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIContent Block Param Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIBashCodeExecutionToolResultBlockParam", + "description": "Anthropic APIContent Block Param Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIContent Block Param Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPITextEditorCodeExecutionToolResultBlockParam", + "description": "Anthropic APIContent Block Param Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIContent Block Param Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIToolSearchToolResultBlockParam", + "description": "Anthropic APIContent Block Param Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIContent Block Param Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIContainerUploadBlockParam", + "description": "Anthropic APIContent Block Param Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIContent Block Param Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + ], + "description": "Anthropic APIContent Block Param Union configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Anthropic APIContent Block Param Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIContentBlockSourceContentItemUnionParam": { + "anyOf": [ + { + "$ref": "#/$defs/AnthropicAPITextBlockParam", + "description": "Anthropic APIContent Block Source Content Item Union Param configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIContent Block Source Content Item Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIImageBlockParam", + "description": "Anthropic APIContent Block Source Content Item Union Param configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIContent Block Source Content Item Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + ], + "description": "Anthropic APIContent Block Source Content Item Union Param configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Anthropic APIContent Block Source Content Item Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIContentBlockSourceContentUnionParam": { + "anyOf": [ + { + "description": "Anthropic APIContent Block Source Content Union Param configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIContent Block Source Content Union Param", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "description": "Anthropic APIContent Block Source Content Union Param configuration. See the linked native reference for semantics and availability.", + "items": { + "$ref": "#/$defs/AnthropicAPIContentBlockSourceContentItemUnionParam", + "description": "Anthropic APIContent Block Source Content Union Param value configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIContent Block Source Content Union Param value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": "Anthropic APIContent Block Source Content Union Param", + "type": "array", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + ], + "description": "Anthropic APIContent Block Source Content Union Param configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Anthropic APIContent Block Source Content Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIContentBlockSourceParam": { + "additionalProperties": false, + "description": "The properties Content, Type are required.\n", + "properties": { + "content": { + "$ref": "#/$defs/AnthropicAPIContentBlockSourceContentUnionParam", + "description": "Content configuration. See the linked native reference for semantics and availability.", + "title": "Content", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "content", + "description": "This field can be elided, and will marshal its zero value as \"content\".\n", + "title": "Type", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "content", + "type" + ], + "title": "Anthropic APIContent Block Source Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIDirectCallerParam": { + "additionalProperties": false, + "description": "Tool invocation directly from the model.\n\nThis struct has a constant value, construct it with [NewDirectCallerParam].\n", + "properties": { + "type": { + "const": "direct", + "description": "Type configuration. See the linked native reference for semantics and availability.", + "title": "Type", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type" + ], + "title": "Anthropic APIDirect Caller Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIDocumentBlockParam": { + "additionalProperties": false, + "description": "The properties Source, Type are required.\n", + "properties": { + "cache_control": { + "$ref": "#/$defs/AnthropicAPICacheControlEphemeralParam", + "description": "Create a cache control breakpoint at this content block.\n", + "title": "Cache control", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "citations": { + "$ref": "#/$defs/AnthropicAPICitationsConfigParam", + "description": "Citations configuration. See the linked native reference for semantics and availability.", + "title": "Citations", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "context": { + "description": "Context configuration. See the linked native reference for semantics and availability.", + "title": "Context", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "source": { + "$ref": "#/$defs/AnthropicAPIDocumentBlockParamSourceUnion", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": { + "description": "Title configuration. See the linked native reference for semantics and availability.", + "title": "Title", + "type": "string", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "document", + "description": "This field can be elided, and will marshal its zero value as \"document\".\n", + "title": "Type", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "type" + ], + "title": "Anthropic APIDocument Block Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIDocumentBlockParamSourceUnion": { + "anyOf": [ + { + "$ref": "#/$defs/AnthropicAPIBase64PDFSourceParam", + "description": "Anthropic APIDocument Block Param Source Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIDocument Block Param Source Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIPlainTextSourceParam", + "description": "Anthropic APIDocument Block Param Source Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIDocument Block Param Source Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIContentBlockSourceParam", + "description": "Anthropic APIDocument Block Param Source Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIDocument Block Param Source Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIURLPDFSourceParam", + "description": "Anthropic APIDocument Block Param Source Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIDocument Block Param Source Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + ], + "description": "Anthropic APIDocument Block Param Source Union configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Anthropic APIDocument Block Param Source Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIEncryptedCodeExecutionResultBlockParam": { + "additionalProperties": false, + "description": "Code execution result with encrypted stdout for PFC + web_search results.\n\nThe properties Content, EncryptedStdout, ReturnCode, Stderr, Type are required.\n", + "properties": { + "content": { + "description": "Content configuration. See the linked native reference for semantics and availability.", + "items": { + "$ref": "#/$defs/AnthropicAPICodeExecutionOutputBlockParam", + "description": "Content value configuration. See the linked native reference for semantics and availability.", + "title": "Content value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": "Content", + "type": "array", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "encrypted_stdout": { + "description": "Encrypted stdout configuration. See the linked native reference for semantics and availability.", + "title": "Encrypted stdout", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "return_code": { + "description": "Return code configuration. See the linked native reference for semantics and availability.", + "title": "Return code", + "type": "integer", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "stderr": { + "description": "Stderr configuration. See the linked native reference for semantics and availability.", + "title": "Stderr", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "encrypted_code_execution_result", + "description": "This field can be elided, and will marshal its zero value as\n\"encrypted_code_execution_result\".\n", + "title": "Type", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "content", + "encrypted_stdout", + "return_code", + "stderr", + "type" + ], + "title": "Anthropic APIEncrypted Code Execution Result Block Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIImageBlockParam": { + "additionalProperties": false, + "description": "The properties Source, Type are required.\n", + "properties": { + "cache_control": { + "$ref": "#/$defs/AnthropicAPICacheControlEphemeralParam", + "description": "Create a cache control breakpoint at this content block.\n", + "title": "Cache control", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "source": { + "$ref": "#/$defs/AnthropicAPIImageBlockParamSourceUnion", + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "image", + "description": "This field can be elided, and will marshal its zero value as \"image\".\n", + "title": "Type", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "source", + "type" + ], + "title": "Anthropic APIImage Block Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIImageBlockParamSourceUnion": { + "anyOf": [ + { + "$ref": "#/$defs/AnthropicAPIBase64ImageSourceParam", + "description": "Anthropic APIImage Block Param Source Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIImage Block Param Source Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIURLImageSourceParam", + "description": "Anthropic APIImage Block Param Source Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIImage Block Param Source Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + ], + "description": "Anthropic APIImage Block Param Source Union configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Anthropic APIImage Block Param Source Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIJSONOutputFormatParam": { + "additionalProperties": false, + "description": "The properties Schema, Type are required.\n", + "properties": { + "schema": { + "additionalProperties": { + "description": "Schema value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Schema value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "description": "The JSON schema of the format\n", + "title": "Schema", + "type": "object", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "json_schema", + "description": "This field can be elided, and will marshal its zero value as \"json_schema\".\n", + "title": "Type", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "schema", + "type" + ], + "title": "Anthropic APIJSONOutput Format Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIMemoryTool20250818Param": { + "additionalProperties": false, + "description": "The properties Name, Type are required.\n", + "properties": { + "allowed_callers": { + "description": "Any of \"direct\", \"code_execution_20250825\", \"code_execution_20260120\".\n", + "items": { + "description": "Allowed callers value configuration. See the linked native reference for semantics and availability.", + "title": "Allowed callers value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": "Allowed callers", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "cache_control": { + "$ref": "#/$defs/AnthropicAPICacheControlEphemeralParam", + "description": "Create a cache control breakpoint at this content block.\n", + "title": "Cache control", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "defer_loading": { + "description": "If true, tool will not be included in initial system prompt. Only loaded when\nreturned via tool_reference from tool search.\n", + "title": "Defer loading", + "type": "boolean", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "input_examples": { + "description": "Input examples configuration. See the linked native reference for semantics and availability.", + "items": { + "additionalProperties": { + "description": "Input examples value value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Input examples value value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "description": "Input examples value configuration. See the linked native reference for semantics and availability.", + "title": "Input examples value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": "Input examples", + "type": "array", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "name": { + "const": "memory", + "description": "Name of the tool.\n\nThis is how the tool will be called by the model and in `tool_use` blocks.\n\nThis field can be elided, and will marshal its zero value as \"memory\".\n", + "title": "Name", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "strict": { + "description": "When true, guarantees schema validation on tool names and inputs\n", + "title": "Strict", + "type": "boolean", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "memory_20250818", + "description": "This field can be elided, and will marshal its zero value as \"memory_20250818\".\n", + "title": "Type", + "x-clicky-order": 70, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "name", + "type" + ], + "title": "Anthropic APIMemory Tool20250818Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIMessageParam": { + "additionalProperties": false, + "description": "The properties Content, Role are required.\n", + "properties": { + "content": { + "description": "Content configuration. See the linked native reference for semantics and availability.", + "items": { + "$ref": "#/$defs/AnthropicAPIContentBlockParamUnion", + "description": "Content value configuration. See the linked native reference for semantics and availability.", + "title": "Content value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": "Content", + "type": "array", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "role": { + "description": "Any of \"user\", \"assistant\".\n", + "enum": [ + "user", + "assistant" + ], + "title": "Role", + "type": "string", + "x-clicky-order": 20, + "x-enum-display": "segmented", + "x-enum-labels": { + "assistant": "Assistant", + "user": "User" + }, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "content", + "role" + ], + "title": "Anthropic APIMessage Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIMetadataParam": { + "additionalProperties": false, + "description": "Anthropic APIMetadata Param configuration. See the linked native reference for semantics and availability.", + "properties": { + "user_id": { + "description": "An external identifier for the user who is associated with the request.\n\nThis should be a uuid, hash value, or other opaque identifier. Anthropic may use\nthis id to help detect abuse. Do not include any identifying information such as\nname, email address, or phone number.\n", + "title": "User id", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "title": "Anthropic APIMetadata Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIOutputConfigParam": { + "additionalProperties": false, + "description": "Anthropic APIOutput Config Param configuration. See the linked native reference for semantics and availability.", + "properties": { + "effort": { + "description": "All possible effort levels.\n\nAny of \"low\", \"medium\", \"high\", \"max\".\n", + "enum": [ + "low", + "medium", + "high", + "max" + ], + "title": "Effort", + "type": "string", + "x-clicky-order": 10, + "x-enum-display": "segmented", + "x-enum-labels": { + "high": "High", + "low": "Low", + "max": "Max", + "medium": "Medium" + }, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "format": { + "$ref": "#/$defs/AnthropicAPIJSONOutputFormatParam", + "description": "A schema to specify Claude's output format in responses. See\n[structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)\n", + "title": "Format", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "title": "Anthropic APIOutput Config Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIPlainTextSourceParam": { + "additionalProperties": false, + "description": "The properties Data, MediaType, Type are required.\n", + "properties": { + "data": { + "description": "Data configuration. See the linked native reference for semantics and availability.", + "title": "Data", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "media_type": { + "const": "text/plain", + "description": "This field can be elided, and will marshal its zero value as \"text/plain\".\n", + "title": "Media type", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "text", + "description": "This field can be elided, and will marshal its zero value as \"text\".\n", + "title": "Type", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "data", + "media_type", + "type" + ], + "title": "Anthropic APIPlain Text Source Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIRedactedThinkingBlockParam": { + "additionalProperties": false, + "description": "The properties Data, Type are required.\n", + "properties": { + "data": { + "description": "Data configuration. See the linked native reference for semantics and availability.", + "title": "Data", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "redacted_thinking", + "description": "This field can be elided, and will marshal its zero value as\n\"redacted_thinking\".\n", + "title": "Type", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "data", + "type" + ], + "title": "Anthropic APIRedacted Thinking Block Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPISearchResultBlockParam": { + "additionalProperties": false, + "description": "The properties Content, Source, Title, Type are required.\n", + "properties": { + "cache_control": { + "$ref": "#/$defs/AnthropicAPICacheControlEphemeralParam", + "description": "Create a cache control breakpoint at this content block.\n", + "title": "Cache control", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "citations": { + "$ref": "#/$defs/AnthropicAPICitationsConfigParam", + "description": "Citations configuration. See the linked native reference for semantics and availability.", + "title": "Citations", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "content": { + "description": "Content configuration. See the linked native reference for semantics and availability.", + "items": { + "$ref": "#/$defs/AnthropicAPITextBlockParam", + "description": "Content value configuration. See the linked native reference for semantics and availability.", + "title": "Content value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": "Content", + "type": "array", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "source": { + "description": "Source configuration. See the linked native reference for semantics and availability.", + "title": "Source", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": { + "description": "Title configuration. See the linked native reference for semantics and availability.", + "title": "Title", + "type": "string", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "search_result", + "description": "This field can be elided, and will marshal its zero value as \"search_result\".\n", + "title": "Type", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "content", + "source", + "title", + "type" + ], + "title": "Anthropic APISearch Result Block Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIServerToolCaller20260120Param": { + "additionalProperties": false, + "description": "The properties ToolID, Type are required.\n", + "properties": { + "tool_id": { + "description": "Tool id configuration. See the linked native reference for semantics and availability.", + "title": "Tool id", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "code_execution_20260120", + "description": "This field can be elided, and will marshal its zero value as\n\"code_execution_20260120\".\n", + "title": "Type", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "tool_id", + "type" + ], + "title": "Anthropic APIServer Tool Caller20260120Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIServerToolCallerParam": { + "additionalProperties": false, + "description": "Tool invocation generated by a server-side tool.\n\nThe properties ToolID, Type are required.\n", + "properties": { + "tool_id": { + "description": "Tool id configuration. See the linked native reference for semantics and availability.", + "title": "Tool id", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "code_execution_20250825", + "description": "This field can be elided, and will marshal its zero value as\n\"code_execution_20250825\".\n", + "title": "Type", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "tool_id", + "type" + ], + "title": "Anthropic APIServer Tool Caller Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIServerToolUseBlockParam": { + "additionalProperties": false, + "description": "The properties ID, Input, Name, Type are required.\n", + "properties": { + "cache_control": { + "$ref": "#/$defs/AnthropicAPICacheControlEphemeralParam", + "description": "Create a cache control breakpoint at this content block.\n", + "title": "Cache control", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "caller": { + "$ref": "#/$defs/AnthropicAPIServerToolUseBlockParamCallerUnion", + "description": "Tool invocation directly from the model.\n", + "title": "Caller", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "id": { + "description": "Id configuration. See the linked native reference for semantics and availability.", + "title": "Id", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "input": { + "description": "Input configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Input", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "name": { + "description": "Any of \"web_search\", \"web_fetch\", \"code_execution\", \"bash_code_execution\",\n\"text_editor_code_execution\", \"tool_search_tool_regex\", \"tool_search_tool_bm25\".\n", + "enum": [ + "web_search", + "web_fetch", + "code_execution", + "bash_code_execution", + "text_editor_code_execution", + "tool_search_tool_regex", + "tool_search_tool_bm25" + ], + "title": "Name", + "type": "string", + "x-clicky-order": 50, + "x-enum-display": "combobox", + "x-enum-labels": { + "bash_code_execution": "Bash code execution", + "code_execution": "Code execution", + "text_editor_code_execution": "Text editor code execution", + "tool_search_tool_bm25": "Tool search tool bm25", + "tool_search_tool_regex": "Tool search tool regex", + "web_fetch": "Web fetch", + "web_search": "Web search" + }, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "server_tool_use", + "description": "This field can be elided, and will marshal its zero value as \"server_tool_use\".\n", + "title": "Type", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "id", + "input", + "name", + "type" + ], + "title": "Anthropic APIServer Tool Use Block Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIServerToolUseBlockParamCallerUnion": { + "anyOf": [ + { + "$ref": "#/$defs/AnthropicAPIDirectCallerParam", + "description": "Anthropic APIServer Tool Use Block Param Caller Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIServer Tool Use Block Param Caller Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIServerToolCallerParam", + "description": "Anthropic APIServer Tool Use Block Param Caller Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIServer Tool Use Block Param Caller Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIServerToolCaller20260120Param", + "description": "Anthropic APIServer Tool Use Block Param Caller Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIServer Tool Use Block Param Caller Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + ], + "description": "Anthropic APIServer Tool Use Block Param Caller Union configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Anthropic APIServer Tool Use Block Param Caller Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPITextBlockParam": { + "additionalProperties": false, + "description": "The properties Text, Type are required.\n", + "properties": { + "cache_control": { + "$ref": "#/$defs/AnthropicAPICacheControlEphemeralParam", + "description": "Create a cache control breakpoint at this content block.\n", + "title": "Cache control", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "citations": { + "description": "Citations configuration. See the linked native reference for semantics and availability.", + "items": { + "$ref": "#/$defs/AnthropicAPITextCitationParamUnion", + "description": "Citations value configuration. See the linked native reference for semantics and availability.", + "title": "Citations value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": "Citations", + "type": "array", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "text": { + "description": "Text configuration. See the linked native reference for semantics and availability.", + "title": "Text", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "text", + "description": "This field can be elided, and will marshal its zero value as \"text\".\n", + "title": "Type", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "text", + "type" + ], + "title": "Anthropic APIText Block Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPITextCitationParamUnion": { + "anyOf": [ + { + "$ref": "#/$defs/AnthropicAPICitationCharLocationParam", + "description": "Anthropic APIText Citation Param Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIText Citation Param Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPICitationPageLocationParam", + "description": "Anthropic APIText Citation Param Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIText Citation Param Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPICitationContentBlockLocationParam", + "description": "Anthropic APIText Citation Param Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIText Citation Param Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPICitationWebSearchResultLocationParam", + "description": "Anthropic APIText Citation Param Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIText Citation Param Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPICitationSearchResultLocationParam", + "description": "Anthropic APIText Citation Param Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIText Citation Param Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + ], + "description": "Anthropic APIText Citation Param Union configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Anthropic APIText Citation Param Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPITextEditorCodeExecutionCreateResultBlockParam": { + "additionalProperties": false, + "description": "The properties IsFileUpdate, Type are required.\n", + "properties": { + "is_file_update": { + "description": "Is file update configuration. See the linked native reference for semantics and availability.", + "title": "Is file update", + "type": "boolean", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "text_editor_code_execution_create_result", + "description": "This field can be elided, and will marshal its zero value as\n\"text_editor_code_execution_create_result\".\n", + "title": "Type", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "is_file_update", + "type" + ], + "title": "Anthropic APIText Editor Code Execution Create Result Block Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPITextEditorCodeExecutionStrReplaceResultBlockParam": { + "additionalProperties": false, + "description": "The property Type is required.\n", + "properties": { + "lines": { + "description": "Lines configuration. See the linked native reference for semantics and availability.", + "items": { + "description": "Lines value configuration. See the linked native reference for semantics and availability.", + "title": "Lines value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": "Lines", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "new_lines": { + "description": "New lines configuration. See the linked native reference for semantics and availability.", + "title": "New lines", + "type": "integer", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "new_start": { + "description": "New start configuration. See the linked native reference for semantics and availability.", + "title": "New start", + "type": "integer", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "old_lines": { + "description": "Old lines configuration. See the linked native reference for semantics and availability.", + "title": "Old lines", + "type": "integer", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "old_start": { + "description": "Old start configuration. See the linked native reference for semantics and availability.", + "title": "Old start", + "type": "integer", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "text_editor_code_execution_str_replace_result", + "description": "This field can be elided, and will marshal its zero value as\n\"text_editor_code_execution_str_replace_result\".\n", + "title": "Type", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type" + ], + "title": "Anthropic APIText Editor Code Execution Str Replace Result Block Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPITextEditorCodeExecutionToolResultBlockParam": { + "additionalProperties": false, + "description": "The properties Content, ToolUseID, Type are required.\n", + "properties": { + "cache_control": { + "$ref": "#/$defs/AnthropicAPICacheControlEphemeralParam", + "description": "Create a cache control breakpoint at this content block.\n", + "title": "Cache control", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "content": { + "$ref": "#/$defs/AnthropicAPITextEditorCodeExecutionToolResultBlockParamContentUnion", + "description": "Content configuration. See the linked native reference for semantics and availability.", + "title": "Content", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "tool_use_id": { + "description": "Tool use id configuration. See the linked native reference for semantics and availability.", + "title": "Tool use id", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "text_editor_code_execution_tool_result", + "description": "This field can be elided, and will marshal its zero value as\n\"text_editor_code_execution_tool_result\".\n", + "title": "Type", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "content", + "tool_use_id", + "type" + ], + "title": "Anthropic APIText Editor Code Execution Tool Result Block Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPITextEditorCodeExecutionToolResultBlockParamContentUnion": { + "anyOf": [ + { + "$ref": "#/$defs/AnthropicAPITextEditorCodeExecutionToolResultErrorParam", + "description": "Anthropic APIText Editor Code Execution Tool Result Block Param Content Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIText Editor Code Execution Tool Result Block Param Content Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPITextEditorCodeExecutionViewResultBlockParam", + "description": "Anthropic APIText Editor Code Execution Tool Result Block Param Content Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIText Editor Code Execution Tool Result Block Param Content Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPITextEditorCodeExecutionCreateResultBlockParam", + "description": "Anthropic APIText Editor Code Execution Tool Result Block Param Content Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIText Editor Code Execution Tool Result Block Param Content Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPITextEditorCodeExecutionStrReplaceResultBlockParam", + "description": "Anthropic APIText Editor Code Execution Tool Result Block Param Content Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIText Editor Code Execution Tool Result Block Param Content Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + ], + "description": "Anthropic APIText Editor Code Execution Tool Result Block Param Content Union configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Anthropic APIText Editor Code Execution Tool Result Block Param Content Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPITextEditorCodeExecutionToolResultErrorParam": { + "additionalProperties": false, + "description": "The properties ErrorCode, Type are required.\n", + "properties": { + "error_code": { + "description": "Any of \"invalid_tool_input\", \"unavailable\", \"too_many_requests\",\n\"execution_time_exceeded\", \"file_not_found\".\n", + "enum": [ + "invalid_tool_input", + "unavailable", + "too_many_requests", + "execution_time_exceeded", + "file_not_found" + ], + "title": "Error code", + "type": "string", + "x-clicky-order": 10, + "x-enum-display": "combobox", + "x-enum-labels": { + "execution_time_exceeded": "Execution time exceeded", + "file_not_found": "File not found", + "invalid_tool_input": "Invalid tool input", + "too_many_requests": "Too many requests", + "unavailable": "Unavailable" + }, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "error_message": { + "description": "Error message configuration. See the linked native reference for semantics and availability.", + "title": "Error message", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "text_editor_code_execution_tool_result_error", + "description": "This field can be elided, and will marshal its zero value as\n\"text_editor_code_execution_tool_result_error\".\n", + "title": "Type", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "error_code", + "type" + ], + "title": "Anthropic APIText Editor Code Execution Tool Result Error Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPITextEditorCodeExecutionViewResultBlockParam": { + "additionalProperties": false, + "description": "The properties Content, FileType, Type are required.\n", + "properties": { + "content": { + "description": "Content configuration. See the linked native reference for semantics and availability.", + "title": "Content", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "file_type": { + "description": "Any of \"text\", \"image\", \"pdf\".\n", + "enum": [ + "text", + "image", + "pdf" + ], + "title": "File type", + "type": "string", + "x-clicky-order": 20, + "x-enum-display": "segmented", + "x-enum-labels": { + "image": "Image", + "pdf": "Pdf", + "text": "Text" + }, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "num_lines": { + "description": "Num lines configuration. See the linked native reference for semantics and availability.", + "title": "Num lines", + "type": "integer", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "start_line": { + "description": "Start line configuration. See the linked native reference for semantics and availability.", + "title": "Start line", + "type": "integer", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "total_lines": { + "description": "Total lines configuration. See the linked native reference for semantics and availability.", + "title": "Total lines", + "type": "integer", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "text_editor_code_execution_view_result", + "description": "This field can be elided, and will marshal its zero value as\n\"text_editor_code_execution_view_result\".\n", + "title": "Type", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "content", + "file_type", + "type" + ], + "title": "Anthropic APIText Editor Code Execution View Result Block Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIThinkingBlockParam": { + "additionalProperties": false, + "description": "The properties Signature, Thinking, Type are required.\n", + "properties": { + "signature": { + "description": "Signature configuration. See the linked native reference for semantics and availability.", + "title": "Signature", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "thinking": { + "description": "Thinking configuration. See the linked native reference for semantics and availability.", + "title": "Thinking", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "thinking", + "description": "This field can be elided, and will marshal its zero value as \"thinking\".\n", + "title": "Type", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "signature", + "thinking", + "type" + ], + "title": "Anthropic APIThinking Block Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIThinkingConfigAdaptiveParam": { + "additionalProperties": false, + "description": "This struct has a constant value, construct it with\n[NewThinkingConfigAdaptiveParam].\n", + "properties": { + "type": { + "const": "adaptive", + "description": "Type configuration. See the linked native reference for semantics and availability.", + "title": "Type", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type" + ], + "title": "Anthropic APIThinking Config Adaptive Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIThinkingConfigDisabledParam": { + "additionalProperties": false, + "description": "This struct has a constant value, construct it with\n[NewThinkingConfigDisabledParam].\n", + "properties": { + "type": { + "const": "disabled", + "description": "Type configuration. See the linked native reference for semantics and availability.", + "title": "Type", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type" + ], + "title": "Anthropic APIThinking Config Disabled Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIThinkingConfigEnabledParam": { + "additionalProperties": false, + "description": "The properties BudgetTokens, Type are required.\n", + "properties": { + "budget_tokens": { + "description": "Determines how many tokens Claude can use for its internal reasoning process.\nLarger budgets can enable more thorough analysis for complex problems, improving\nresponse quality.\n\nMust be ≥1024 and less than `max_tokens`.\n\nSee\n[extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking)\nfor details.\n", + "title": "Budget tokens", + "type": "integer", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "enabled", + "description": "This field can be elided, and will marshal its zero value as \"enabled\".\n", + "title": "Type", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "budget_tokens", + "type" + ], + "title": "Anthropic APIThinking Config Enabled Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIThinkingConfigParamUnion": { + "anyOf": [ + { + "$ref": "#/$defs/AnthropicAPIThinkingConfigEnabledParam", + "description": "Anthropic APIThinking Config Param Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIThinking Config Param Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIThinkingConfigDisabledParam", + "description": "Anthropic APIThinking Config Param Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIThinking Config Param Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIThinkingConfigAdaptiveParam", + "description": "Anthropic APIThinking Config Param Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIThinking Config Param Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + ], + "description": "Anthropic APIThinking Config Param Union configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Anthropic APIThinking Config Param Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIToolBash20250124Param": { + "additionalProperties": false, + "description": "The properties Name, Type are required.\n", + "properties": { + "allowed_callers": { + "description": "Any of \"direct\", \"code_execution_20250825\", \"code_execution_20260120\".\n", + "items": { + "description": "Allowed callers value configuration. See the linked native reference for semantics and availability.", + "title": "Allowed callers value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": "Allowed callers", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "cache_control": { + "$ref": "#/$defs/AnthropicAPICacheControlEphemeralParam", + "description": "Create a cache control breakpoint at this content block.\n", + "title": "Cache control", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "defer_loading": { + "description": "If true, tool will not be included in initial system prompt. Only loaded when\nreturned via tool_reference from tool search.\n", + "title": "Defer loading", + "type": "boolean", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "input_examples": { + "description": "Input examples configuration. See the linked native reference for semantics and availability.", + "items": { + "additionalProperties": { + "description": "Input examples value value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Input examples value value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "description": "Input examples value configuration. See the linked native reference for semantics and availability.", + "title": "Input examples value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": "Input examples", + "type": "array", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "name": { + "const": "bash", + "description": "Name of the tool.\n\nThis is how the tool will be called by the model and in `tool_use` blocks.\n\nThis field can be elided, and will marshal its zero value as \"bash\".\n", + "title": "Name", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "strict": { + "description": "When true, guarantees schema validation on tool names and inputs\n", + "title": "Strict", + "type": "boolean", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "bash_20250124", + "description": "This field can be elided, and will marshal its zero value as \"bash_20250124\".\n", + "title": "Type", + "x-clicky-order": 70, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "name", + "type" + ], + "title": "Anthropic APITool Bash20250124Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIToolChoiceAnyParam": { + "additionalProperties": false, + "description": "The model will use any available tools.\n\nThe property Type is required.\n", + "properties": { + "disable_parallel_tool_use": { + "description": "Whether to disable parallel tool use.\n\nDefaults to `false`. If set to `true`, the model will output exactly one tool\nuse.\n", + "title": "Disable parallel tool use", + "type": "boolean", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "any", + "description": "This field can be elided, and will marshal its zero value as \"any\".\n", + "title": "Type", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type" + ], + "title": "Anthropic APITool Choice Any Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIToolChoiceAutoParam": { + "additionalProperties": false, + "description": "The model will automatically decide whether to use tools.\n\nThe property Type is required.\n", + "properties": { + "disable_parallel_tool_use": { + "description": "Whether to disable parallel tool use.\n\nDefaults to `false`. If set to `true`, the model will output at most one tool\nuse.\n", + "title": "Disable parallel tool use", + "type": "boolean", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "auto", + "description": "This field can be elided, and will marshal its zero value as \"auto\".\n", + "title": "Type", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type" + ], + "title": "Anthropic APITool Choice Auto Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIToolChoiceNoneParam": { + "additionalProperties": false, + "description": "The model will not be allowed to use tools.\n\nThis struct has a constant value, construct it with [NewToolChoiceNoneParam].\n", + "properties": { + "type": { + "const": "none", + "description": "Type configuration. See the linked native reference for semantics and availability.", + "title": "Type", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type" + ], + "title": "Anthropic APITool Choice None Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIToolChoiceToolParam": { + "additionalProperties": false, + "description": "The model will use the specified tool with `tool_choice.name`.\n\nThe properties Name, Type are required.\n", + "properties": { + "disable_parallel_tool_use": { + "description": "Whether to disable parallel tool use.\n\nDefaults to `false`. If set to `true`, the model will output exactly one tool\nuse.\n", + "title": "Disable parallel tool use", + "type": "boolean", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "name": { + "description": "The name of the tool to use.\n", + "title": "Name", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "tool", + "description": "This field can be elided, and will marshal its zero value as \"tool\".\n", + "title": "Type", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "name", + "type" + ], + "title": "Anthropic APITool Choice Tool Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIToolChoiceUnionParam": { + "anyOf": [ + { + "$ref": "#/$defs/AnthropicAPIToolChoiceAutoParam", + "description": "Anthropic APITool Choice Union Param configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APITool Choice Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIToolChoiceAnyParam", + "description": "Anthropic APITool Choice Union Param configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APITool Choice Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIToolChoiceToolParam", + "description": "Anthropic APITool Choice Union Param configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APITool Choice Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIToolChoiceNoneParam", + "description": "Anthropic APITool Choice Union Param configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APITool Choice Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + ], + "description": "Anthropic APITool Choice Union Param configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Anthropic APITool Choice Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } }, + "AnthropicAPIToolInputSchemaParam": { + "additionalProperties": false, + "description": "[JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.\n\nThis defines the shape of the `input` that your tool accepts and that the model\nwill produce.\n\nThe property Type is required.\n", + "properties": { + "properties": { + "description": "Properties configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Properties", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "required": { + "description": "Required configuration. See the linked native reference for semantics and availability.", + "items": { + "description": "Required value configuration. See the linked native reference for semantics and availability.", + "title": "Required value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": "Required", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "object", + "description": "This field can be elided, and will marshal its zero value as \"object\".\n", + "title": "Type", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "required", + "type" + ], + "title": "Anthropic APITool Input Schema Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIToolParam": { + "additionalProperties": false, + "description": "The properties InputSchema, Name are required.\n", + "properties": { + "allowed_callers": { + "description": "Any of \"direct\", \"code_execution_20250825\", \"code_execution_20260120\".\n", + "items": { + "description": "Allowed callers value configuration. See the linked native reference for semantics and availability.", + "title": "Allowed callers value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": "Allowed callers", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "cache_control": { + "$ref": "#/$defs/AnthropicAPICacheControlEphemeralParam", + "description": "Create a cache control breakpoint at this content block.\n", + "title": "Cache control", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "defer_loading": { + "description": "If true, tool will not be included in initial system prompt. Only loaded when\nreturned via tool_reference from tool search.\n", + "title": "Defer loading", + "type": "boolean", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "description": { + "description": "Description of what this tool does.\n\nTool descriptions should be as detailed as possible. The more information that\nthe model has about what the tool is and how to use it, the better it will\nperform. You can use natural language descriptions to reinforce important\naspects of the tool input JSON schema.\n", + "title": "Description", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "eager_input_streaming": { + "description": "Enable eager input streaming for this tool. When true, tool input parameters\nwill be streamed incrementally as they are generated, and types will be inferred\non-the-fly rather than buffering the full JSON output. When false, streaming is\ndisabled for this tool even if the fine-grained-tool-streaming beta is active.\nWhen null (default), uses the default behavior based on beta headers.\n", + "title": "Eager input streaming", + "type": "boolean", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "input_examples": { + "description": "Input examples configuration. See the linked native reference for semantics and availability.", + "items": { + "additionalProperties": { + "description": "Input examples value value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Input examples value value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "description": "Input examples value configuration. See the linked native reference for semantics and availability.", + "title": "Input examples value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": "Input examples", + "type": "array", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "input_schema": { + "$ref": "#/$defs/AnthropicAPIToolInputSchemaParam", + "description": "[JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.\n\nThis defines the shape of the `input` that your tool accepts and that the model\nwill produce.\n", + "title": "Input schema", + "x-clicky-order": 70, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "name": { + "description": "Name of the tool.\n\nThis is how the tool will be called by the model and in `tool_use` blocks.\n", + "title": "Name", + "type": "string", + "x-clicky-order": 80, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "strict": { + "description": "When true, guarantees schema validation on tool names and inputs\n", + "title": "Strict", + "type": "boolean", + "x-clicky-order": 90, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Any of \"custom\".\n", + "enum": [ + "custom" + ], + "title": "Type", + "type": "string", + "x-clicky-order": 100, + "x-enum-display": "segmented", + "x-enum-labels": { + "custom": "Custom" + }, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "input_schema", + "name" + ], + "title": "Anthropic APITool Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIToolReferenceBlockParam": { + "additionalProperties": false, + "description": "Tool reference block that can be included in tool_result content.\n\nThe properties ToolName, Type are required.\n", + "properties": { + "cache_control": { + "$ref": "#/$defs/AnthropicAPICacheControlEphemeralParam", + "description": "Create a cache control breakpoint at this content block.\n", + "title": "Cache control", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "tool_name": { + "description": "Tool name configuration. See the linked native reference for semantics and availability.", + "title": "Tool name", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "tool_reference", + "description": "This field can be elided, and will marshal its zero value as \"tool_reference\".\n", + "title": "Type", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "tool_name", + "type" + ], + "title": "Anthropic APITool Reference Block Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIToolResultBlockParam": { + "additionalProperties": false, + "description": "The properties ToolUseID, Type are required.\n", + "properties": { + "cache_control": { + "$ref": "#/$defs/AnthropicAPICacheControlEphemeralParam", + "description": "Create a cache control breakpoint at this content block.\n", + "title": "Cache control", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "content": { + "description": "Content configuration. See the linked native reference for semantics and availability.", + "items": { + "$ref": "#/$defs/AnthropicAPIToolResultBlockParamContentUnion", + "description": "Content value configuration. See the linked native reference for semantics and availability.", + "title": "Content value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": "Content", + "type": "array", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "is_error": { + "description": "Is error configuration. See the linked native reference for semantics and availability.", + "title": "Is error", + "type": "boolean", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "tool_use_id": { + "description": "Tool use id configuration. See the linked native reference for semantics and availability.", + "title": "Tool use id", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "tool_result", + "description": "This field can be elided, and will marshal its zero value as \"tool_result\".\n", + "title": "Type", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "tool_use_id", + "type" + ], + "title": "Anthropic APITool Result Block Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIToolResultBlockParamContentUnion": { + "anyOf": [ + { + "$ref": "#/$defs/AnthropicAPITextBlockParam", + "description": "Anthropic APITool Result Block Param Content Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APITool Result Block Param Content Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIImageBlockParam", + "description": "Anthropic APITool Result Block Param Content Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APITool Result Block Param Content Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPISearchResultBlockParam", + "description": "Anthropic APITool Result Block Param Content Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APITool Result Block Param Content Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIDocumentBlockParam", + "description": "Anthropic APITool Result Block Param Content Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APITool Result Block Param Content Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIToolReferenceBlockParam", + "description": "Anthropic APITool Result Block Param Content Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APITool Result Block Param Content Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + ], + "description": "Anthropic APITool Result Block Param Content Union configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Anthropic APITool Result Block Param Content Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIToolSearchToolBm25_20251119Param": { + "additionalProperties": false, + "description": "The properties Name, Type are required.\n", + "properties": { + "allowed_callers": { + "description": "Any of \"direct\", \"code_execution_20250825\", \"code_execution_20260120\".\n", + "items": { + "description": "Allowed callers value configuration. See the linked native reference for semantics and availability.", + "title": "Allowed callers value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": "Allowed callers", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "cache_control": { + "$ref": "#/$defs/AnthropicAPICacheControlEphemeralParam", + "description": "Create a cache control breakpoint at this content block.\n", + "title": "Cache control", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "defer_loading": { + "description": "If true, tool will not be included in initial system prompt. Only loaded when\nreturned via tool_reference from tool search.\n", + "title": "Defer loading", + "type": "boolean", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "name": { + "const": "tool_search_tool_bm25", + "description": "Name of the tool.\n\nThis is how the tool will be called by the model and in `tool_use` blocks.\n\nThis field can be elided, and will marshal its zero value as\n\"tool_search_tool_bm25\".\n", + "title": "Name", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "strict": { + "description": "When true, guarantees schema validation on tool names and inputs\n", + "title": "Strict", + "type": "boolean", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Any of \"tool_search_tool_bm25_20251119\", \"tool_search_tool_bm25\".\n", + "enum": [ + "tool_search_tool_bm25_20251119", + "tool_search_tool_bm25" + ], + "title": "Type", + "type": "string", + "x-clicky-order": 60, + "x-enum-display": "segmented", + "x-enum-labels": { + "tool_search_tool_bm25": "Tool search tool bm25", + "tool_search_tool_bm25_20251119": "Tool search tool bm25 20251119" + }, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type", + "name" + ], + "title": "Anthropic APITool Search Tool Bm25 20251119Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIToolSearchToolRegex20251119Param": { + "additionalProperties": false, + "description": "The properties Name, Type are required.\n", + "properties": { + "allowed_callers": { + "description": "Any of \"direct\", \"code_execution_20250825\", \"code_execution_20260120\".\n", + "items": { + "description": "Allowed callers value configuration. See the linked native reference for semantics and availability.", + "title": "Allowed callers value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": "Allowed callers", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "cache_control": { + "$ref": "#/$defs/AnthropicAPICacheControlEphemeralParam", + "description": "Create a cache control breakpoint at this content block.\n", + "title": "Cache control", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "defer_loading": { + "description": "If true, tool will not be included in initial system prompt. Only loaded when\nreturned via tool_reference from tool search.\n", + "title": "Defer loading", + "type": "boolean", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "name": { + "const": "tool_search_tool_regex", + "description": "Name of the tool.\n\nThis is how the tool will be called by the model and in `tool_use` blocks.\n\nThis field can be elided, and will marshal its zero value as\n\"tool_search_tool_regex\".\n", + "title": "Name", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "strict": { + "description": "When true, guarantees schema validation on tool names and inputs\n", + "title": "Strict", + "type": "boolean", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Any of \"tool_search_tool_regex_20251119\", \"tool_search_tool_regex\".\n", + "enum": [ + "tool_search_tool_regex_20251119", + "tool_search_tool_regex" + ], + "title": "Type", + "type": "string", + "x-clicky-order": 60, + "x-enum-display": "segmented", + "x-enum-labels": { + "tool_search_tool_regex": "Tool search tool regex", + "tool_search_tool_regex_20251119": "Tool search tool regex 20251119" + }, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type", + "name" + ], + "title": "Anthropic APITool Search Tool Regex20251119Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIToolSearchToolResultBlockParam": { + "additionalProperties": false, + "description": "The properties Content, ToolUseID, Type are required.\n", + "properties": { + "cache_control": { + "$ref": "#/$defs/AnthropicAPICacheControlEphemeralParam", + "description": "Create a cache control breakpoint at this content block.\n", + "title": "Cache control", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "content": { + "$ref": "#/$defs/AnthropicAPIToolSearchToolResultBlockParamContentUnion", + "description": "Content configuration. See the linked native reference for semantics and availability.", + "title": "Content", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "tool_use_id": { + "description": "Tool use id configuration. See the linked native reference for semantics and availability.", + "title": "Tool use id", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "tool_search_tool_result", + "description": "This field can be elided, and will marshal its zero value as\n\"tool_search_tool_result\".\n", + "title": "Type", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "content", + "tool_use_id", + "type" + ], + "title": "Anthropic APITool Search Tool Result Block Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIToolSearchToolResultBlockParamContentUnion": { + "anyOf": [ + { + "$ref": "#/$defs/AnthropicAPIToolSearchToolResultErrorParam", + "description": "Anthropic APITool Search Tool Result Block Param Content Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APITool Search Tool Result Block Param Content Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIToolSearchToolSearchResultBlockParam", + "description": "Anthropic APITool Search Tool Result Block Param Content Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APITool Search Tool Result Block Param Content Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + ], + "description": "Anthropic APITool Search Tool Result Block Param Content Union configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Anthropic APITool Search Tool Result Block Param Content Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIToolSearchToolResultErrorParam": { + "additionalProperties": false, + "description": "The properties ErrorCode, Type are required.\n", + "properties": { + "error_code": { + "description": "Any of \"invalid_tool_input\", \"unavailable\", \"too_many_requests\",\n\"execution_time_exceeded\".\n", + "enum": [ + "invalid_tool_input", + "unavailable", + "too_many_requests", + "execution_time_exceeded" + ], + "title": "Error code", + "type": "string", + "x-clicky-order": 10, + "x-enum-display": "segmented", + "x-enum-labels": { + "execution_time_exceeded": "Execution time exceeded", + "invalid_tool_input": "Invalid tool input", + "too_many_requests": "Too many requests", + "unavailable": "Unavailable" + }, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "tool_search_tool_result_error", + "description": "This field can be elided, and will marshal its zero value as\n\"tool_search_tool_result_error\".\n", + "title": "Type", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "error_code", + "type" + ], + "title": "Anthropic APITool Search Tool Result Error Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIToolSearchToolSearchResultBlockParam": { + "additionalProperties": false, + "description": "The properties ToolReferences, Type are required.\n", + "properties": { + "tool_references": { + "description": "Tool references configuration. See the linked native reference for semantics and availability.", + "items": { + "$ref": "#/$defs/AnthropicAPIToolReferenceBlockParam", + "description": "Tool references value configuration. See the linked native reference for semantics and availability.", + "title": "Tool references value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": "Tool references", + "type": "array", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "tool_search_tool_search_result", + "description": "This field can be elided, and will marshal its zero value as\n\"tool_search_tool_search_result\".\n", + "title": "Type", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "tool_references", + "type" + ], + "title": "Anthropic APITool Search Tool Search Result Block Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIToolTextEditor20250124Param": { + "additionalProperties": false, + "description": "The properties Name, Type are required.\n", + "properties": { + "allowed_callers": { + "description": "Any of \"direct\", \"code_execution_20250825\", \"code_execution_20260120\".\n", + "items": { + "description": "Allowed callers value configuration. See the linked native reference for semantics and availability.", + "title": "Allowed callers value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": "Allowed callers", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "cache_control": { + "$ref": "#/$defs/AnthropicAPICacheControlEphemeralParam", + "description": "Create a cache control breakpoint at this content block.\n", + "title": "Cache control", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "defer_loading": { + "description": "If true, tool will not be included in initial system prompt. Only loaded when\nreturned via tool_reference from tool search.\n", + "title": "Defer loading", + "type": "boolean", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "input_examples": { + "description": "Input examples configuration. See the linked native reference for semantics and availability.", + "items": { + "additionalProperties": { + "description": "Input examples value value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Input examples value value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "description": "Input examples value configuration. See the linked native reference for semantics and availability.", + "title": "Input examples value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": "Input examples", + "type": "array", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "name": { + "const": "str_replace_editor", + "description": "Name of the tool.\n\nThis is how the tool will be called by the model and in `tool_use` blocks.\n\nThis field can be elided, and will marshal its zero value as\n\"str_replace_editor\".\n", + "title": "Name", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "strict": { + "description": "When true, guarantees schema validation on tool names and inputs\n", + "title": "Strict", + "type": "boolean", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "text_editor_20250124", + "description": "This field can be elided, and will marshal its zero value as\n\"text_editor_20250124\".\n", + "title": "Type", + "x-clicky-order": 70, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "name", + "type" + ], + "title": "Anthropic APITool Text Editor20250124Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIToolTextEditor20250429Param": { + "additionalProperties": false, + "description": "The properties Name, Type are required.\n", + "properties": { + "allowed_callers": { + "description": "Any of \"direct\", \"code_execution_20250825\", \"code_execution_20260120\".\n", + "items": { + "description": "Allowed callers value configuration. See the linked native reference for semantics and availability.", + "title": "Allowed callers value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": "Allowed callers", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "cache_control": { + "$ref": "#/$defs/AnthropicAPICacheControlEphemeralParam", + "description": "Create a cache control breakpoint at this content block.\n", + "title": "Cache control", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "defer_loading": { + "description": "If true, tool will not be included in initial system prompt. Only loaded when\nreturned via tool_reference from tool search.\n", + "title": "Defer loading", + "type": "boolean", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "input_examples": { + "description": "Input examples configuration. See the linked native reference for semantics and availability.", + "items": { + "additionalProperties": { + "description": "Input examples value value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Input examples value value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "description": "Input examples value configuration. See the linked native reference for semantics and availability.", + "title": "Input examples value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": "Input examples", + "type": "array", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "name": { + "const": "str_replace_based_edit_tool", + "description": "Name of the tool.\n\nThis is how the tool will be called by the model and in `tool_use` blocks.\n\nThis field can be elided, and will marshal its zero value as\n\"str_replace_based_edit_tool\".\n", + "title": "Name", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "strict": { + "description": "When true, guarantees schema validation on tool names and inputs\n", + "title": "Strict", + "type": "boolean", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "text_editor_20250429", + "description": "This field can be elided, and will marshal its zero value as\n\"text_editor_20250429\".\n", + "title": "Type", + "x-clicky-order": 70, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "name", + "type" + ], + "title": "Anthropic APITool Text Editor20250429Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIToolTextEditor20250728Param": { + "additionalProperties": false, + "description": "The properties Name, Type are required.\n", + "properties": { + "allowed_callers": { + "description": "Any of \"direct\", \"code_execution_20250825\", \"code_execution_20260120\".\n", + "items": { + "description": "Allowed callers value configuration. See the linked native reference for semantics and availability.", + "title": "Allowed callers value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": "Allowed callers", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "cache_control": { + "$ref": "#/$defs/AnthropicAPICacheControlEphemeralParam", + "description": "Create a cache control breakpoint at this content block.\n", + "title": "Cache control", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "defer_loading": { + "description": "If true, tool will not be included in initial system prompt. Only loaded when\nreturned via tool_reference from tool search.\n", + "title": "Defer loading", + "type": "boolean", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "input_examples": { + "description": "Input examples configuration. See the linked native reference for semantics and availability.", + "items": { + "additionalProperties": { + "description": "Input examples value value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Input examples value value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "description": "Input examples value configuration. See the linked native reference for semantics and availability.", + "title": "Input examples value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": "Input examples", + "type": "array", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "max_characters": { + "description": "Maximum number of characters to display when viewing a file. If not specified,\ndefaults to displaying the full file.\n", + "title": "Max characters", + "type": "integer", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "name": { + "const": "str_replace_based_edit_tool", + "description": "Name of the tool.\n\nThis is how the tool will be called by the model and in `tool_use` blocks.\n\nThis field can be elided, and will marshal its zero value as\n\"str_replace_based_edit_tool\".\n", + "title": "Name", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "strict": { + "description": "When true, guarantees schema validation on tool names and inputs\n", + "title": "Strict", + "type": "boolean", + "x-clicky-order": 70, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "text_editor_20250728", + "description": "This field can be elided, and will marshal its zero value as\n\"text_editor_20250728\".\n", + "title": "Type", + "x-clicky-order": 80, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "name", + "type" + ], + "title": "Anthropic APITool Text Editor20250728Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIToolUnionParam": { + "anyOf": [ + { + "$ref": "#/$defs/AnthropicAPIToolParam", + "description": "Anthropic APITool Union Param configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APITool Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIToolBash20250124Param", + "description": "Anthropic APITool Union Param configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APITool Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPICodeExecutionTool20250522Param", + "description": "Anthropic APITool Union Param configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APITool Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPICodeExecutionTool20250825Param", + "description": "Anthropic APITool Union Param configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APITool Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPICodeExecutionTool20260120Param", + "description": "Anthropic APITool Union Param configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APITool Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIMemoryTool20250818Param", + "description": "Anthropic APITool Union Param configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APITool Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIToolTextEditor20250124Param", + "description": "Anthropic APITool Union Param configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APITool Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIToolTextEditor20250429Param", + "description": "Anthropic APITool Union Param configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APITool Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIToolTextEditor20250728Param", + "description": "Anthropic APITool Union Param configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APITool Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIWebSearchTool20250305Param", + "description": "Anthropic APITool Union Param configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APITool Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIWebFetchTool20250910Param", + "description": "Anthropic APITool Union Param configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APITool Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIWebSearchTool20260209Param", + "description": "Anthropic APITool Union Param configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APITool Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIWebFetchTool20260209Param", + "description": "Anthropic APITool Union Param configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APITool Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIToolSearchToolBm25_20251119Param", + "description": "Anthropic APITool Union Param configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APITool Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIToolSearchToolRegex20251119Param", + "description": "Anthropic APITool Union Param configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APITool Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + ], + "description": "Anthropic APITool Union Param configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Anthropic APITool Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIToolUseBlockParam": { + "additionalProperties": false, + "description": "The properties ID, Input, Name, Type are required.\n", + "properties": { + "cache_control": { + "$ref": "#/$defs/AnthropicAPICacheControlEphemeralParam", + "description": "Create a cache control breakpoint at this content block.\n", + "title": "Cache control", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "caller": { + "$ref": "#/$defs/AnthropicAPIToolUseBlockParamCallerUnion", + "description": "Tool invocation directly from the model.\n", + "title": "Caller", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "id": { + "description": "Id configuration. See the linked native reference for semantics and availability.", + "title": "Id", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "input": { + "description": "Input configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Input", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "name": { + "description": "Name configuration. See the linked native reference for semantics and availability.", + "title": "Name", + "type": "string", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "tool_use", + "description": "This field can be elided, and will marshal its zero value as \"tool_use\".\n", + "title": "Type", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "id", + "input", + "name", + "type" + ], + "title": "Anthropic APITool Use Block Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIToolUseBlockParamCallerUnion": { + "anyOf": [ + { + "$ref": "#/$defs/AnthropicAPIDirectCallerParam", + "description": "Anthropic APITool Use Block Param Caller Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APITool Use Block Param Caller Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIServerToolCallerParam", + "description": "Anthropic APITool Use Block Param Caller Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APITool Use Block Param Caller Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIServerToolCaller20260120Param", + "description": "Anthropic APITool Use Block Param Caller Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APITool Use Block Param Caller Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + ], + "description": "Anthropic APITool Use Block Param Caller Union configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Anthropic APITool Use Block Param Caller Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIURLImageSourceParam": { + "additionalProperties": false, + "description": "The properties Type, URL are required.\n", + "properties": { + "type": { + "const": "url", + "description": "This field can be elided, and will marshal its zero value as \"url\".\n", + "title": "Type", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "Url configuration. See the linked native reference for semantics and availability.", + "title": "Url", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "url", + "type" + ], + "title": "Anthropic APIURLImage Source Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIURLPDFSourceParam": { + "additionalProperties": false, + "description": "The properties Type, URL are required.\n", + "properties": { + "type": { + "const": "url", + "description": "This field can be elided, and will marshal its zero value as \"url\".\n", + "title": "Type", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "Url configuration. See the linked native reference for semantics and availability.", + "title": "Url", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "url", + "type" + ], + "title": "Anthropic APIURLPDFSource Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIUserLocationParam": { + "additionalProperties": false, + "description": "The property Type is required.\n", + "properties": { + "city": { + "description": "The city of the user.\n", + "title": "City", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "country": { + "description": "The two letter\n[ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the\nuser.\n", + "title": "Country", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "region": { + "description": "The region of the user.\n", + "title": "Region", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "timezone": { + "description": "The [IANA timezone](https://nodatime.org/TimeZones) of the user.\n", + "title": "Timezone", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "approximate", + "description": "This field can be elided, and will marshal its zero value as \"approximate\".\n", + "title": "Type", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type" + ], + "title": "Anthropic APIUser Location Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIWebFetchBlockParam": { + "additionalProperties": false, + "description": "The properties Content, Type, URL are required.\n", + "properties": { + "content": { + "$ref": "#/$defs/AnthropicAPIDocumentBlockParam", + "description": "Content configuration. See the linked native reference for semantics and availability.", + "title": "Content", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "retrieved_at": { + "description": "ISO 8601 timestamp when the content was retrieved\n", + "title": "Retrieved at", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "web_fetch_result", + "description": "This field can be elided, and will marshal its zero value as \"web_fetch_result\".\n", + "title": "Type", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "Fetched content URL\n", + "title": "Url", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "content", + "url", + "type" + ], + "title": "Anthropic APIWeb Fetch Block Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIWebFetchTool20250910Param": { + "additionalProperties": false, + "description": "The properties Name, Type are required.\n", + "properties": { + "allowed_callers": { + "description": "Any of \"direct\", \"code_execution_20250825\", \"code_execution_20260120\".\n", + "items": { + "description": "Allowed callers value configuration. See the linked native reference for semantics and availability.", + "title": "Allowed callers value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": "Allowed callers", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "allowed_domains": { + "description": "List of domains to allow fetching from\n", + "items": { + "description": "Allowed domains value configuration. See the linked native reference for semantics and availability.", + "title": "Allowed domains value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": "Allowed domains", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "blocked_domains": { + "description": "List of domains to block fetching from\n", + "items": { + "description": "Blocked domains value configuration. See the linked native reference for semantics and availability.", + "title": "Blocked domains value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": "Blocked domains", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "cache_control": { + "$ref": "#/$defs/AnthropicAPICacheControlEphemeralParam", + "description": "Create a cache control breakpoint at this content block.\n", + "title": "Cache control", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "citations": { + "$ref": "#/$defs/AnthropicAPICitationsConfigParam", + "description": "Citations configuration for fetched documents. Citations are disabled by\ndefault.\n", + "title": "Citations", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "defer_loading": { + "description": "If true, tool will not be included in initial system prompt. Only loaded when\nreturned via tool_reference from tool search.\n", + "title": "Defer loading", + "type": "boolean", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "max_content_tokens": { + "description": "Maximum number of tokens used by including web page text content in the context.\nThe limit is approximate and does not apply to binary content such as PDFs.\n", + "title": "Max content tokens", + "type": "integer", + "x-clicky-order": 70, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "max_uses": { + "description": "Maximum number of times the tool can be used in the API request.\n", + "title": "Max uses", + "type": "integer", + "x-clicky-order": 80, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "name": { + "const": "web_fetch", + "description": "Name of the tool.\n\nThis is how the tool will be called by the model and in `tool_use` blocks.\n\nThis field can be elided, and will marshal its zero value as \"web_fetch\".\n", + "title": "Name", + "x-clicky-order": 90, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "strict": { + "description": "When true, guarantees schema validation on tool names and inputs\n", + "title": "Strict", + "type": "boolean", + "x-clicky-order": 100, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "web_fetch_20250910", + "description": "This field can be elided, and will marshal its zero value as\n\"web_fetch_20250910\".\n", + "title": "Type", + "x-clicky-order": 110, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "name", + "type" + ], + "title": "Anthropic APIWeb Fetch Tool20250910Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIWebFetchTool20260209Param": { + "additionalProperties": false, + "description": "The properties Name, Type are required.\n", + "properties": { + "allowed_callers": { + "description": "Any of \"direct\", \"code_execution_20250825\", \"code_execution_20260120\".\n", + "items": { + "description": "Allowed callers value configuration. See the linked native reference for semantics and availability.", + "title": "Allowed callers value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": "Allowed callers", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "allowed_domains": { + "description": "List of domains to allow fetching from\n", + "items": { + "description": "Allowed domains value configuration. See the linked native reference for semantics and availability.", + "title": "Allowed domains value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": "Allowed domains", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "blocked_domains": { + "description": "List of domains to block fetching from\n", + "items": { + "description": "Blocked domains value configuration. See the linked native reference for semantics and availability.", + "title": "Blocked domains value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": "Blocked domains", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "cache_control": { + "$ref": "#/$defs/AnthropicAPICacheControlEphemeralParam", + "description": "Create a cache control breakpoint at this content block.\n", + "title": "Cache control", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "citations": { + "$ref": "#/$defs/AnthropicAPICitationsConfigParam", + "description": "Citations configuration for fetched documents. Citations are disabled by\ndefault.\n", + "title": "Citations", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "defer_loading": { + "description": "If true, tool will not be included in initial system prompt. Only loaded when\nreturned via tool_reference from tool search.\n", + "title": "Defer loading", + "type": "boolean", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "max_content_tokens": { + "description": "Maximum number of tokens used by including web page text content in the context.\nThe limit is approximate and does not apply to binary content such as PDFs.\n", + "title": "Max content tokens", + "type": "integer", + "x-clicky-order": 70, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "max_uses": { + "description": "Maximum number of times the tool can be used in the API request.\n", + "title": "Max uses", + "type": "integer", + "x-clicky-order": 80, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "name": { + "const": "web_fetch", + "description": "Name of the tool.\n\nThis is how the tool will be called by the model and in `tool_use` blocks.\n\nThis field can be elided, and will marshal its zero value as \"web_fetch\".\n", + "title": "Name", + "x-clicky-order": 90, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "strict": { + "description": "When true, guarantees schema validation on tool names and inputs\n", + "title": "Strict", + "type": "boolean", + "x-clicky-order": 100, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "web_fetch_20260209", + "description": "This field can be elided, and will marshal its zero value as\n\"web_fetch_20260209\".\n", + "title": "Type", + "x-clicky-order": 110, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "name", + "type" + ], + "title": "Anthropic APIWeb Fetch Tool20260209Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIWebFetchToolResultBlockParam": { + "additionalProperties": false, + "description": "The properties Content, ToolUseID, Type are required.\n", + "properties": { + "cache_control": { + "$ref": "#/$defs/AnthropicAPICacheControlEphemeralParam", + "description": "Create a cache control breakpoint at this content block.\n", + "title": "Cache control", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "caller": { + "$ref": "#/$defs/AnthropicAPIWebFetchToolResultBlockParamCallerUnion", + "description": "Tool invocation directly from the model.\n", + "title": "Caller", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "content": { + "$ref": "#/$defs/AnthropicAPIWebFetchToolResultBlockParamContentUnion", + "description": "Content configuration. See the linked native reference for semantics and availability.", + "title": "Content", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "tool_use_id": { + "description": "Tool use id configuration. See the linked native reference for semantics and availability.", + "title": "Tool use id", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "web_fetch_tool_result", + "description": "This field can be elided, and will marshal its zero value as\n\"web_fetch_tool_result\".\n", + "title": "Type", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "content", + "tool_use_id", + "type" + ], + "title": "Anthropic APIWeb Fetch Tool Result Block Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIWebFetchToolResultBlockParamCallerUnion": { + "anyOf": [ + { + "$ref": "#/$defs/AnthropicAPIDirectCallerParam", + "description": "Anthropic APIWeb Fetch Tool Result Block Param Caller Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIWeb Fetch Tool Result Block Param Caller Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIServerToolCallerParam", + "description": "Anthropic APIWeb Fetch Tool Result Block Param Caller Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIWeb Fetch Tool Result Block Param Caller Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIServerToolCaller20260120Param", + "description": "Anthropic APIWeb Fetch Tool Result Block Param Caller Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIWeb Fetch Tool Result Block Param Caller Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + ], + "description": "Anthropic APIWeb Fetch Tool Result Block Param Caller Union configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Anthropic APIWeb Fetch Tool Result Block Param Caller Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIWebFetchToolResultBlockParamContentUnion": { + "anyOf": [ + { + "$ref": "#/$defs/AnthropicAPIWebFetchToolResultErrorBlockParam", + "description": "Anthropic APIWeb Fetch Tool Result Block Param Content Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIWeb Fetch Tool Result Block Param Content Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIWebFetchBlockParam", + "description": "Anthropic APIWeb Fetch Tool Result Block Param Content Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIWeb Fetch Tool Result Block Param Content Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + ], + "description": "Anthropic APIWeb Fetch Tool Result Block Param Content Union configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Anthropic APIWeb Fetch Tool Result Block Param Content Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIWebFetchToolResultErrorBlockParam": { + "additionalProperties": false, + "description": "The properties ErrorCode, Type are required.\n", + "properties": { + "error_code": { + "description": "Any of \"invalid_tool_input\", \"url_too_long\", \"url_not_allowed\",\n\"url_not_accessible\", \"unsupported_content_type\", \"too_many_requests\",\n\"max_uses_exceeded\", \"unavailable\".\n", + "enum": [ + "invalid_tool_input", + "url_too_long", + "url_not_allowed", + "url_not_accessible", + "unsupported_content_type", + "too_many_requests", + "max_uses_exceeded", + "unavailable" + ], + "title": "Error code", + "type": "string", + "x-clicky-order": 10, + "x-enum-display": "combobox", + "x-enum-labels": { + "invalid_tool_input": "Invalid tool input", + "max_uses_exceeded": "Max uses exceeded", + "too_many_requests": "Too many requests", + "unavailable": "Unavailable", + "unsupported_content_type": "Unsupported content type", + "url_not_accessible": "Url not accessible", + "url_not_allowed": "Url not allowed", + "url_too_long": "Url too long" + }, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "web_fetch_tool_result_error", + "description": "This field can be elided, and will marshal its zero value as\n\"web_fetch_tool_result_error\".\n", + "title": "Type", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "error_code", + "type" + ], + "title": "Anthropic APIWeb Fetch Tool Result Error Block Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIWebSearchResultBlockParam": { + "additionalProperties": false, + "description": "The properties EncryptedContent, Title, Type, URL are required.\n", + "properties": { + "encrypted_content": { + "description": "Encrypted content configuration. See the linked native reference for semantics and availability.", + "title": "Encrypted content", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "page_age": { + "description": "Page age configuration. See the linked native reference for semantics and availability.", + "title": "Page age", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": { + "description": "Title configuration. See the linked native reference for semantics and availability.", + "title": "Title", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "web_search_result", + "description": "This field can be elided, and will marshal its zero value as\n\"web_search_result\".\n", + "title": "Type", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "Url configuration. See the linked native reference for semantics and availability.", + "title": "Url", + "type": "string", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "encrypted_content", + "title", + "url", + "type" + ], + "title": "Anthropic APIWeb Search Result Block Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIWebSearchTool20250305Param": { + "additionalProperties": false, + "description": "The properties Name, Type are required.\n", + "properties": { + "allowed_callers": { + "description": "Any of \"direct\", \"code_execution_20250825\", \"code_execution_20260120\".\n", + "items": { + "description": "Allowed callers value configuration. See the linked native reference for semantics and availability.", + "title": "Allowed callers value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": "Allowed callers", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "allowed_domains": { + "description": "If provided, only these domains will be included in results. Cannot be used\nalongside `blocked_domains`.\n", + "items": { + "description": "Allowed domains value configuration. See the linked native reference for semantics and availability.", + "title": "Allowed domains value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": "Allowed domains", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "blocked_domains": { + "description": "If provided, these domains will never appear in results. Cannot be used\nalongside `allowed_domains`.\n", + "items": { + "description": "Blocked domains value configuration. See the linked native reference for semantics and availability.", + "title": "Blocked domains value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": "Blocked domains", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "cache_control": { + "$ref": "#/$defs/AnthropicAPICacheControlEphemeralParam", + "description": "Create a cache control breakpoint at this content block.\n", + "title": "Cache control", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "defer_loading": { + "description": "If true, tool will not be included in initial system prompt. Only loaded when\nreturned via tool_reference from tool search.\n", + "title": "Defer loading", + "type": "boolean", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "max_uses": { + "description": "Maximum number of times the tool can be used in the API request.\n", + "title": "Max uses", + "type": "integer", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "name": { + "const": "web_search", + "description": "Name of the tool.\n\nThis is how the tool will be called by the model and in `tool_use` blocks.\n\nThis field can be elided, and will marshal its zero value as \"web_search\".\n", + "title": "Name", + "x-clicky-order": 70, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "strict": { + "description": "When true, guarantees schema validation on tool names and inputs\n", + "title": "Strict", + "type": "boolean", + "x-clicky-order": 80, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "web_search_20250305", + "description": "This field can be elided, and will marshal its zero value as\n\"web_search_20250305\".\n", + "title": "Type", + "x-clicky-order": 90, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "user_location": { + "$ref": "#/$defs/AnthropicAPIUserLocationParam", + "description": "Parameters for the user's location. Used to provide more relevant search\nresults.\n", + "title": "User location", + "x-clicky-order": 100, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "name", + "type" + ], + "title": "Anthropic APIWeb Search Tool20250305Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIWebSearchTool20260209Param": { + "additionalProperties": false, + "description": "The properties Name, Type are required.\n", + "properties": { + "allowed_callers": { + "description": "Any of \"direct\", \"code_execution_20250825\", \"code_execution_20260120\".\n", + "items": { + "description": "Allowed callers value configuration. See the linked native reference for semantics and availability.", + "title": "Allowed callers value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": "Allowed callers", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "allowed_domains": { + "description": "If provided, only these domains will be included in results. Cannot be used\nalongside `blocked_domains`.\n", + "items": { + "description": "Allowed domains value configuration. See the linked native reference for semantics and availability.", + "title": "Allowed domains value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": "Allowed domains", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "blocked_domains": { + "description": "If provided, these domains will never appear in results. Cannot be used\nalongside `allowed_domains`.\n", + "items": { + "description": "Blocked domains value configuration. See the linked native reference for semantics and availability.", + "title": "Blocked domains value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": "Blocked domains", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "cache_control": { + "$ref": "#/$defs/AnthropicAPICacheControlEphemeralParam", + "description": "Create a cache control breakpoint at this content block.\n", + "title": "Cache control", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "defer_loading": { + "description": "If true, tool will not be included in initial system prompt. Only loaded when\nreturned via tool_reference from tool search.\n", + "title": "Defer loading", + "type": "boolean", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "max_uses": { + "description": "Maximum number of times the tool can be used in the API request.\n", + "title": "Max uses", + "type": "integer", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "name": { + "const": "web_search", + "description": "Name of the tool.\n\nThis is how the tool will be called by the model and in `tool_use` blocks.\n\nThis field can be elided, and will marshal its zero value as \"web_search\".\n", + "title": "Name", + "x-clicky-order": 70, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "strict": { + "description": "When true, guarantees schema validation on tool names and inputs\n", + "title": "Strict", + "type": "boolean", + "x-clicky-order": 80, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "web_search_20260209", + "description": "This field can be elided, and will marshal its zero value as\n\"web_search_20260209\".\n", + "title": "Type", + "x-clicky-order": 90, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "user_location": { + "$ref": "#/$defs/AnthropicAPIUserLocationParam", + "description": "Parameters for the user's location. Used to provide more relevant search\nresults.\n", + "title": "User location", + "x-clicky-order": 100, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "name", + "type" + ], + "title": "Anthropic APIWeb Search Tool20260209Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIWebSearchToolRequestErrorParam": { + "additionalProperties": false, + "description": "The properties ErrorCode, Type are required.\n", + "properties": { + "error_code": { + "description": "Any of \"invalid_tool_input\", \"unavailable\", \"max_uses_exceeded\",\n\"too_many_requests\", \"query_too_long\", \"request_too_large\".\n", + "enum": [ + "invalid_tool_input", + "unavailable", + "max_uses_exceeded", + "too_many_requests", + "query_too_long", + "request_too_large" + ], + "title": "Error code", + "type": "string", + "x-clicky-order": 10, + "x-enum-display": "combobox", + "x-enum-labels": { + "invalid_tool_input": "Invalid tool input", + "max_uses_exceeded": "Max uses exceeded", + "query_too_long": "Query too long", + "request_too_large": "Request too large", + "too_many_requests": "Too many requests", + "unavailable": "Unavailable" + }, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "web_search_tool_result_error", + "description": "This field can be elided, and will marshal its zero value as\n\"web_search_tool_result_error\".\n", + "title": "Type", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "error_code", + "type" + ], + "title": "Anthropic APIWeb Search Tool Request Error Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIWebSearchToolResultBlockParam": { + "additionalProperties": false, + "description": "The properties Content, ToolUseID, Type are required.\n", + "properties": { + "cache_control": { + "$ref": "#/$defs/AnthropicAPICacheControlEphemeralParam", + "description": "Create a cache control breakpoint at this content block.\n", + "title": "Cache control", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "caller": { + "$ref": "#/$defs/AnthropicAPIWebSearchToolResultBlockParamCallerUnion", + "description": "Tool invocation directly from the model.\n", + "title": "Caller", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "content": { + "$ref": "#/$defs/AnthropicAPIWebSearchToolResultBlockParamContentUnion", + "description": "Content configuration. See the linked native reference for semantics and availability.", + "title": "Content", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "tool_use_id": { + "description": "Tool use id configuration. See the linked native reference for semantics and availability.", + "title": "Tool use id", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "web_search_tool_result", + "description": "This field can be elided, and will marshal its zero value as\n\"web_search_tool_result\".\n", + "title": "Type", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "content", + "tool_use_id", + "type" + ], + "title": "Anthropic APIWeb Search Tool Result Block Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIWebSearchToolResultBlockParamCallerUnion": { + "anyOf": [ + { + "$ref": "#/$defs/AnthropicAPIDirectCallerParam", + "description": "Anthropic APIWeb Search Tool Result Block Param Caller Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIWeb Search Tool Result Block Param Caller Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIServerToolCallerParam", + "description": "Anthropic APIWeb Search Tool Result Block Param Caller Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIWeb Search Tool Result Block Param Caller Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIServerToolCaller20260120Param", + "description": "Anthropic APIWeb Search Tool Result Block Param Caller Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIWeb Search Tool Result Block Param Caller Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + ], + "description": "Anthropic APIWeb Search Tool Result Block Param Caller Union configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Anthropic APIWeb Search Tool Result Block Param Caller Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "AnthropicAPIWebSearchToolResultBlockParamContentUnion": { + "anyOf": [ + { + "description": "Anthropic APIWeb Search Tool Result Block Param Content Union configuration. See the linked native reference for semantics and availability.", + "items": { + "$ref": "#/$defs/AnthropicAPIWebSearchResultBlockParam", + "description": "Anthropic APIWeb Search Tool Result Block Param Content Union value configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIWeb Search Tool Result Block Param Content Union value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": "Anthropic APIWeb Search Tool Result Block Param Content Union", + "type": "array", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/AnthropicAPIWebSearchToolRequestErrorParam", + "description": "Anthropic APIWeb Search Tool Result Block Param Content Union configuration. See the linked native reference for semantics and availability.", + "title": "Anthropic APIWeb Search Tool Result Block Param Content Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + ], + "description": "Anthropic APIWeb Search Tool Result Block Param Content Union configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Anthropic APIWeb Search Tool Result Block Param Content Union", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + } + }, + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "description": "Native Anthropic Messages API request options used by Captain's API runtime.", + "properties": { "cache_control": { - "title": "Cache control", "description": "Top-level prompt-cache marker applied to the final cacheable block.", - "type": "object", "additionalProperties": true, "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 140, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "cache_control", "support": "unsupported", "note": "Captain does not set Anthropic top-level cache control."} + "$ref": "#/$defs/AnthropicAPICacheControlEphemeralParam", + "description": "Top-level prompt-cache marker applied to the final cacheable block.", + "readOnly": true, + "title": "Cache control", + "x-captain-option": { + "nativeName": "cache_control", + "note": "Captain does not set Anthropic top-level cache control.", + "support": "unsupported" + }, + "x-clicky-order": 140, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "container": { + "description": "Container identifier reused across Messages API requests.", + "readOnly": true, + "title": "Container", + "type": "string", + "x-captain-option": { + "nativeName": "container", + "note": "Captain does not expose Anthropic container reuse.", + "support": "unsupported" + }, + "x-clicky-order": 100, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "inference_geo": { + "description": "Geographic region requested for inference processing.", + "readOnly": true, + "title": "Inference geography", + "type": "string", + "x-captain-option": { + "nativeName": "inference_geo", + "note": "Captain does not set a per-request inference geography.", + "support": "unsupported" + }, + "x-clicky-order": 110, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "max_tokens": { + "description": "Maximum tokens generated before stopping, including extended-thinking tokens.", + "minimum": 1, + "title": "Maximum output tokens", + "type": "integer", + "x-captain-option": { + "nativeName": "max_tokens", + "specPath": "budget.maxTokens", + "support": "mapped" + }, + "x-clicky-order": 20, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + }, + "x-icon": "hash" + }, + "messages": { + "description": "Alternating user and assistant messages sent to the Messages API.", + "items": { + "$ref": "#/$defs/AnthropicAPIMessageParam", + "description": "Messages value configuration. See the linked native reference for semantics and availability.", + "title": "Messages value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": "Messages", + "type": "array", + "x-array-display": "stacked", + "x-captain-option": { + "nativeName": "messages", + "specPath": [ + "messages", + "prompt.user", + "prompt.attachments" + ], + "support": "mapped" + }, + "x-clicky-order": 30, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } }, "metadata": { - "title": "Metadata", "description": "Request metadata, including the optional user identifier.", - "type": "object", "additionalProperties": true, "readOnly": true, "x-clicky-section": "environment", "x-clicky-order": 150, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "metadata", "support": "unsupported", "note": "Captain does not forward per-request Anthropic metadata."} + "$ref": "#/$defs/AnthropicAPIMetadataParam", + "description": "Request metadata, including the optional user identifier.", + "readOnly": true, + "title": "Metadata", + "x-captain-option": { + "nativeName": "metadata", + "note": "Captain does not forward per-request Anthropic metadata.", + "support": "unsupported" + }, + "x-clicky-order": 150, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "model": { + "description": "Anthropic model identifier used to complete the request.", + "examples": [ + "claude-opus-4-6", + "claude-sonnet-4-6", + "claude-opus-4-5-20251101", + "claude-opus-4-5", + "claude-3-7-sonnet-latest", + "claude-3-7-sonnet-20250219", + "claude-3-5-haiku-latest", + "claude-3-5-haiku-20241022", + "claude-haiku-4-5", + "claude-haiku-4-5-20251001", + "claude-sonnet-4-20250514", + "claude-sonnet-4-0", + "claude-4-sonnet-20250514", + "claude-sonnet-4-5", + "claude-sonnet-4-5-20250929", + "claude-opus-4-0", + "claude-opus-4-20250514", + "claude-4-opus-20250514", + "claude-opus-4-1-20250805", + "claude-3-opus-latest", + "claude-3-opus-20240229", + "claude-3-haiku-20240307" + ], + "minLength": 1, + "title": "Model", + "type": "string", + "x-captain-option": { + "nativeName": "model", + "specPath": "model.name", + "support": "mapped" + }, + "x-clicky-order": 10, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + }, + "x-icon": "sparkles" + }, + "output_config": { + "$ref": "#/$defs/AnthropicAPIOutputConfigParam", + "description": "Structured-output format and adaptive-thinking effort configuration.", + "title": "Output configuration", + "x-captain-option": { + "nativeName": "output_config", + "specPath": [ + "prompt.schema", + "prompt.schemaJson", + "model.effort" + ], + "support": "mapped" + }, + "x-clicky-order": 70, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } }, "service_tier": { - "title": "Service tier", "description": "Capacity tier used to serve the request.", - "type": "string", "enum": ["auto", "standard_only"], "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 160, "x-enum-display": "segmented", - "x-captain-option": {"nativeName": "service_tier", "support": "unsupported", "note": "Captain does not select an Anthropic service tier."} + "description": "Capacity tier used to serve the request.", + "enum": [ + "auto", + "standard_only" + ], + "readOnly": true, + "title": "Service tier", + "type": "string", + "x-captain-option": { + "nativeName": "service_tier", + "note": "Captain does not select an Anthropic service tier.", + "support": "unsupported" + }, + "x-clicky-order": 160, + "x-clicky-section": "model", + "x-enum-display": "segmented", + "x-enum-labels": { + "auto": "Auto", + "standard_only": "Standard only" + }, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } }, "stop_sequences": { - "title": "Stop sequences", "description": "Text sequences that stop generation when encountered.", - "type": "array", "items": {"type": "string"}, "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 170, "x-array-display": "list", - "x-captain-option": {"nativeName": "stop_sequences", "support": "unsupported", "note": "Captain has no stop-sequence Spec field."} + "description": "Text sequences that stop generation when encountered.", + "items": { + "description": "Stop sequences value configuration. See the linked native reference for semantics and availability.", + "title": "Stop sequences value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "readOnly": true, + "title": "Stop sequences", + "type": "array", + "x-array-display": "list", + "x-captain-option": { + "nativeName": "stop_sequences", + "note": "Captain has no stop-sequence Spec field.", + "support": "unsupported" + }, + "x-clicky-order": 170, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "stream": { + "const": true, + "description": "Whether the Messages API returns server-sent streaming events.", + "readOnly": true, + "title": "Stream", + "type": "boolean", + "x-captain-option": { + "nativeName": "stream", + "note": "Captain selects the SDK streaming method for ExecuteStream.", + "support": "managed" + }, + "x-clicky-order": 90, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "system": { + "description": "System instruction blocks supplied outside the message list.", + "items": { + "$ref": "#/$defs/AnthropicAPITextBlockParam", + "description": "System value configuration. See the linked native reference for semantics and availability.", + "title": "System value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "title": "System prompt", + "type": "array", + "x-array-display": "stacked", + "x-captain-option": { + "nativeName": "system", + "specPath": "prompt.system", + "support": "mapped" + }, + "x-clicky-order": 40, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "temperature": { + "description": "Sampling temperature between zero and one.", + "maximum": 1, + "minimum": 0, + "title": "Temperature", + "type": "number", + "x-captain-option": { + "nativeName": "temperature", + "specPath": "model.temperature", + "support": "mapped" + }, + "x-clicky-order": 50, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "thinking": { + "$ref": "#/$defs/AnthropicAPIThinkingConfigParamUnion", + "description": "Extended-thinking configuration for reasoning-capable models.", + "title": "Thinking", + "x-captain-option": { + "nativeName": "thinking", + "specPath": "model.effort", + "support": "mapped" + }, + "x-clicky-order": 60, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } }, "tool_choice": { - "title": "Tool choice", "description": "Policy controlling whether and which native tool Claude should call.", - "oneOf": [{"type": "string"}, {"type": "object", "additionalProperties": true}], "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 180, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "tool_choice", "support": "unsupported", "note": "Captain supplies tool definitions but does not set Anthropic tool_choice."} + "$ref": "#/$defs/AnthropicAPIToolChoiceUnionParam", + "description": "Policy controlling whether and which native tool Claude should call.", + "readOnly": true, + "title": "Tool choice", + "x-captain-option": { + "nativeName": "tool_choice", + "note": "Captain supplies tool definitions but does not set Anthropic tool_choice.", + "support": "unsupported" + }, + "x-clicky-order": 180, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "tools": { + "description": "Native Anthropic tool definitions derived from Captain caller tools.", + "items": { + "$ref": "#/$defs/AnthropicAPIToolUnionParam", + "description": "Tools value configuration. See the linked native reference for semantics and availability.", + "title": "Tools value", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "readOnly": true, + "title": "Tools", + "type": "array", + "x-array-display": "stacked", + "x-captain-option": { + "nativeName": "tools", + "note": "Captain derives native tool definitions from runtime Config.Tools and the Spec tool policy.", + "support": "managed" + }, + "x-clicky-order": 80, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "top_k": { + "description": "Number of highest-probability tokens retained during sampling.", + "minimum": 0, + "readOnly": true, + "title": "Top K", + "type": "integer", + "x-captain-option": { + "nativeName": "top_k", + "note": "Captain has no native top-k Spec field.", + "support": "unsupported" + }, + "x-clicky-order": 120, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } + }, + "top_p": { + "description": "Cumulative probability mass retained during nucleus sampling.", + "maximum": 1, + "minimum": 0, + "readOnly": true, + "title": "Top P", + "type": "number", + "x-captain-option": { + "nativeName": "top_p", + "note": "Captain has no native top-p Spec field.", + "support": "unsupported" + }, + "x-clicky-order": 130, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] + } } + }, + "required": [ + "max_tokens", + "messages", + "model" + ], + "title": "Anthropic API options", + "type": "object", + "x-captain-adapter": { + "mode": "api", + "provider": "anthropic", + "sources": [ + { + "kind": "sdk", + "reference": "github.com/anthropics/anthropic-sdk-go.MessageNewParams", + "version": "v1.26.0" + }, + { + "kind": "official-docs", + "reference": "https://platform.claude.com/docs/en/api/http/messages/create", + "version": "retrieved 2026-09-11" + }, + { + "kind": "implementation", + "reference": "pkg/ai/provider/genkit/options.go and firebase/genkit plugins/internal/anthropic", + "version": "6a2b56cbd26702b18905865f21fc66d44cc864cc" + } + ] + }, + "x-captain-inventory": { + "sourceType": "anthropic.MessageNewParams", + "version": "github.com/anthropics/anthropic-sdk-go v1.26.0" + }, + "x-help": { + "links": [ + { + "href": "https://platform.claude.com/docs/en/api/messages", + "label": "Documentation" + } + ] } } diff --git a/pkg/adapters/anthropic/cli.schema.json b/pkg/adapters/anthropic/cli.schema.json index 5df48d09..8d2b8e17 100644 --- a/pkg/adapters/anthropic/cli.schema.json +++ b/pkg/adapters/anthropic/cli.schema.json @@ -1,351 +1,1852 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "AnthropicCLIOptions", - "description": "Native Claude Code CLI arguments used by Captain's Anthropic CLI runtime.", - "type": "object", "additionalProperties": false, - "x-captain-adapter": { - "provider": "anthropic", - "mode": "cli", - "sources": [ - {"kind": "cli-help", "reference": "claude -p --help", "version": "2.1.268"}, - {"kind": "implementation", "reference": "pkg/ai/provider/claude_cli.go", "version": "6a2b56cbd26702b18905865f21fc66d44cc864cc"} - ] - }, + "description": "Native Claude Code CLI arguments used by Captain's Anthropic CLI runtime.", "properties": { - "prompt": { - "title": "Prompt", "description": "Prompt text written to Claude Code standard input.", - "type": "string", "x-clicky-section": "prompt", "x-clicky-order": 10, - "x-captain-option": {"nativeName": "stdin", "support": "mapped", "specPath": ["prompt.user", "prompt.attachments"]} - }, - "model": { - "title": "Model", "description": "Model alias or full model identifier passed to Claude Code.", - "type": "string", "x-clicky-section": "model", "x-clicky-order": 20, "x-icon": "sparkles", - "x-captain-option": {"nativeName": "--model", "support": "mapped", "specPath": "model.name"} - }, - "systemPrompt": { - "title": "System prompt", "description": "System prompt replacing Claude Code's default instructions.", - "type": "string", "x-clicky-section": "prompt", "x-clicky-order": 30, - "x-captain-option": {"nativeName": "--system-prompt", "support": "mapped", "specPath": "prompt.system"} - }, - "appendSystemPrompt": { - "title": "Append system prompt", "description": "Additional instructions appended to Claude Code's system prompt.", - "type": "string", "x-clicky-section": "prompt", "x-clicky-order": 40, - "x-captain-option": {"nativeName": "--append-system-prompt", "support": "mapped", "specPath": "prompt.appendSystem"} - }, - "resume": { - "title": "Resume session", "description": "Session identifier resumed by Claude Code.", - "type": "string", "x-clicky-section": "workspace", "x-clicky-order": 50, - "x-captain-option": {"nativeName": "--resume", "support": "mapped", "specPath": "sessionId"} - }, - "effort": { - "title": "Effort", "description": "Reasoning effort requested from supported Claude models.", - "type": "string", "enum": ["low", "medium", "high", "xhigh", "max"], "x-clicky-section": "model", "x-clicky-order": 60, "x-enum-display": "combobox", - "x-captain-option": {"nativeName": "--effort", "support": "mapped", "specPath": "model.effort"} - }, - "maxBudgetUsd": { - "title": "Maximum budget", "description": "Maximum spend in US dollars for the CLI request.", - "type": "number", "minimum": 0, "x-clicky-section": "model", "x-clicky-order": 70, - "x-captain-option": {"nativeName": "--max-budget-usd", "support": "mapped", "specPath": "budget.cost"} - }, - "permissionMode": { - "title": "Permission mode", "description": "Claude Code permission posture translated from Captain policy.", - "type": "string", "enum": ["acceptEdits", "auto", "bypassPermissions", "manual", "dontAsk", "plan"], "x-clicky-section": "permissions", "x-clicky-order": 80, "x-enum-display": "combobox", - "x-captain-option": {"nativeName": "--permission-mode", "support": "mapped", "specPath": "permissions.mode"} - }, - "allowedTools": { - "title": "Allowed tools", "description": "Claude Code tools allowed by Captain's tool policy.", - "type": "array", "items": {"type": "string"}, "x-clicky-section": "permissions", "x-clicky-order": 90, "x-array-display": "list", - "x-captain-option": {"nativeName": "--allowedTools", "support": "mapped", "specPath": "permissions.tools.allow"} - }, - "disallowedTools": { - "title": "Disallowed tools", "description": "Claude Code tools denied by Captain's tool policy.", - "type": "array", "items": {"type": "string"}, "x-clicky-section": "permissions", "x-clicky-order": 100, "x-array-display": "list", - "x-captain-option": {"nativeName": "--disallowedTools", "support": "mapped", "specPath": "permissions.tools.deny"} - }, "addDir": { - "title": "Additional directories", "description": "Directories outside the working directory that Claude Code may access.", - "type": "array", "items": {"type": "string", "format": "path"}, "x-clicky-section": "workspace", "x-clicky-order": 110, "x-array-display": "list", - "x-captain-option": {"nativeName": "--add-dir", "support": "mapped", "specPath": "permissions.directories"} - }, - "pluginDir": { - "title": "Plugin directories", "description": "Claude Code plugin directories loaded for this session.", - "type": "array", "items": {"type": "string", "format": "path"}, "x-clicky-section": "workspace", "x-clicky-order": 120, "x-array-display": "list", - "x-captain-option": {"nativeName": "--plugin-dir", "support": "mapped", "specPath": "memory.skills"} - }, - "disableSlashCommands": { - "title": "Disable slash commands", "description": "Whether skills and slash commands are disabled.", - "type": "boolean", "x-clicky-section": "workspace", "x-clicky-order": 130, - "x-captain-option": {"nativeName": "--disable-slash-commands", "support": "mapped", "specPath": "memory.skipSkills"} - }, - "bare": { - "title": "Bare mode", "description": "Whether Claude starts without hooks, skills, plugins, or settings.", - "type": "boolean", "x-clicky-section": "workspace", "x-clicky-order": 140, - "x-captain-option": {"nativeName": "--bare", "support": "mapped", "specPath": ["memory.bare", "permissions.presets"]} - }, - "mcpConfig": { - "title": "MCP configuration", "description": "MCP server configuration files or inline JSON passed to Claude Code.", - "type": "array", "items": {"type": "string"}, "x-clicky-section": "permissions", "x-clicky-order": 150, "x-array-display": "list", - "x-captain-option": {"nativeName": "--mcp-config", "support": "mapped", "specPath": "permissions.mcp"} - }, - "settings": { - "title": "Settings", "description": "Settings file or inline JSON generated for sandbox and monitoring behavior.", - "type": "string", "x-clicky-section": "environment", "x-clicky-order": 160, - "x-captain-option": {"nativeName": "--settings", "support": "mapped", "specPath": ["permissions", "monitoring"]} - }, - "jsonSchema": { - "title": "JSON Schema", "description": "JSON Schema constraining Claude's final response.", - "type": "object", "additionalProperties": true, "x-clicky-section": "prompt", "x-clicky-order": 170, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "--json-schema", "support": "mapped", "specPath": ["prompt.schema", "prompt.schemaJson"]} - }, - "print": { - "title": "Print mode", "description": "Whether Claude prints one response and exits instead of opening an interactive session.", - "type": "boolean", "const": true, "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 180, - "x-captain-option": {"nativeName": "--print", "support": "managed", "note": "Captain always invokes Claude Code in print mode."} - }, - "verbose": { - "title": "Verbose", "description": "Whether Claude emits complete stream-json diagnostic events.", - "type": "boolean", "const": true, "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 190, - "x-captain-option": {"nativeName": "--verbose", "support": "managed", "note": "Captain enables verbose output so the adapter receives the complete event stream."} - }, - "outputFormat": { - "title": "Output format", "description": "Format used for Claude Code output.", - "type": "string", "const": "stream-json", "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 200, - "x-captain-option": {"nativeName": "--output-format", "support": "managed", "note": "Captain requires stream-json for typed event parsing."} - }, - "strictMcpConfig": { - "title": "Strict MCP configuration", "description": "Whether Claude uses only MCP servers supplied by --mcp-config.", - "type": "boolean", "const": true, "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 210, - "x-captain-option": {"nativeName": "--strict-mcp-config", "support": "managed", "note": "Captain enables strict MCP configuration whenever it supplies or disables MCP servers."} + "description": "Directories outside the working directory that Claude Code may access.", + "items": { + "description": "Add Dir value configuration. See the linked native reference for semantics and availability.", + "format": "path", + "title": "Add Dir value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Additional directories", + "type": "array", + "x-array-display": "list", + "x-captain-option": { + "nativeName": "--add-dir", + "specPath": "permissions.directories", + "support": "mapped" + }, + "x-clicky-order": 110, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, "agent": { - "title": "Agent", "description": "Named agent selected for the current session.", - "type": "string", "readOnly": true, "x-clicky-section": "prompt", "x-clicky-order": 220, - "x-captain-option": {"nativeName": "--agent", "support": "unsupported", "note": "Captain does not select a named Claude Code agent."} + "description": "Named agent selected for the current session.", + "readOnly": true, + "title": "Agent", + "type": "string", + "x-captain-option": { + "nativeName": "--agent", + "note": "Captain does not select a named Claude Code agent.", + "support": "unsupported" + }, + "x-clicky-order": 220, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, "agents": { - "title": "Agent definitions", "description": "Inline JSON object defining custom agents.", - "type": "object", "additionalProperties": true, "readOnly": true, "x-clicky-section": "prompt", "x-clicky-order": 230, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "--agents", "support": "unsupported", "note": "Captain does not expose inline Claude Code agent definitions."} + "additionalProperties": { + "description": "Agents value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Agents value", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "Inline JSON object defining custom agents.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "readOnly": true, + "title": "Agent definitions", + "type": "object", + "x-captain-option": { + "nativeName": "--agents", + "note": "Captain does not expose inline Claude Code agent definitions.", + "support": "unsupported" + }, + "x-clicky-order": 230, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, "allowDangerouslySkipPermissions": { - "title": "Allow permission bypass", "description": "Whether permission bypass may be selected without being the default mode.", - "type": "boolean", "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 240, - "x-captain-option": {"nativeName": "--allow-dangerously-skip-permissions", "support": "unsupported", "note": "Captain expresses bypass through its validated permission-mode mapping."} + "description": "Whether permission bypass may be selected without being the default mode.", + "readOnly": true, + "title": "Allow permission bypass", + "type": "boolean", + "x-captain-option": { + "nativeName": "--allow-dangerously-skip-permissions", + "note": "Captain expresses bypass through its validated permission-mode mapping.", + "support": "unsupported" + }, + "x-clicky-order": 240, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "allowedTools": { + "description": "Claude Code tools allowed by Captain's tool policy.", + "items": { + "description": "Allowed Tools value configuration. See the linked native reference for semantics and availability.", + "title": "Allowed Tools value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Allowed tools", + "type": "array", + "x-array-display": "list", + "x-captain-option": { + "aliases": [ + "--allowedTools", + "--allowed-tools" + ], + "nativeName": "--allowedTools", + "specPath": "permissions.tools.allow", + "support": "mapped" + }, + "x-clicky-order": 90, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "appendSystemPrompt": { + "description": "Additional instructions appended to Claude Code's system prompt.", + "title": "Append system prompt", + "type": "string", + "x-captain-option": { + "nativeName": "--append-system-prompt", + "specPath": "prompt.appendSystem", + "support": "mapped" + }, + "x-clicky-order": 40, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, "autocompact": { - "title": "Autocompact", "description": "Whether Claude compacts conversation context automatically.", - "type": "boolean", "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 250, - "x-captain-option": {"nativeName": "--autocompact", "support": "unsupported", "note": "Captain does not override Claude Code context compaction."} + "description": "Whether Claude compacts conversation context automatically.", + "readOnly": true, + "title": "Autocompact", + "type": "boolean", + "x-captain-option": { + "nativeName": "--autocompact", + "note": "Captain does not override Claude Code context compaction.", + "support": "unsupported" + }, + "x-clicky-order": 250, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, "axScreenReader": { - "title": "Screen reader mode", "description": "Whether terminal output is optimized for screen readers.", - "type": "boolean", "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 260, - "x-captain-option": {"nativeName": "--ax-screen-reader", "support": "unsupported", "note": "Captain consumes machine-readable output and does not expose terminal accessibility flags."} + "description": "Whether terminal output is optimized for screen readers.", + "readOnly": true, + "title": "Screen reader mode", + "type": "boolean", + "x-captain-option": { + "nativeName": "--ax-screen-reader", + "note": "Captain consumes machine-readable output and does not expose terminal accessibility flags.", + "support": "unsupported" + }, + "x-clicky-order": 260, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, "background": { - "title": "Background mode", "description": "Whether the Claude Code session runs in the background.", - "type": "boolean", "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 270, - "x-captain-option": {"nativeName": "--background", "support": "unsupported", "note": "Captain supervises a foreground child process."} + "description": "Whether the Claude Code session runs in the background.", + "readOnly": true, + "title": "Background mode", + "type": "boolean", + "x-captain-option": { + "aliases": [ + "--bg", + "--background" + ], + "nativeName": "--background", + "note": "Captain supervises a foreground child process.", + "support": "unsupported" + }, + "x-clicky-order": 270, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "bare": { + "description": "Whether Claude starts without hooks, skills, plugins, or settings.", + "title": "Bare mode", + "type": "boolean", + "x-captain-option": { + "nativeName": "--bare", + "specPath": [ + "memory.bare", + "permissions.presets" + ], + "support": "mapped" + }, + "x-clicky-order": 140, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, "betas": { - "title": "Beta headers", "description": "Anthropic beta feature identifiers included in API requests.", - "type": "array", "items": {"type": "string"}, "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 280, "x-array-display": "list", - "x-captain-option": {"nativeName": "--betas", "support": "unsupported", "note": "Captain does not expose per-run Claude beta headers."} + "description": "Anthropic beta feature identifiers included in API requests.", + "items": { + "description": "Betas value configuration. See the linked native reference for semantics and availability.", + "title": "Betas value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "readOnly": true, + "title": "Beta headers", + "type": "array", + "x-array-display": "list", + "x-captain-option": { + "nativeName": "--betas", + "note": "Captain does not expose per-run Claude beta headers.", + "support": "unsupported" + }, + "x-clicky-order": 280, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, "brief": { - "title": "Brief mode", "description": "Whether Claude emits a shorter initial response.", - "type": "boolean", "readOnly": true, "x-clicky-section": "prompt", "x-clicky-order": 290, - "x-captain-option": {"nativeName": "--brief", "support": "unsupported", "note": "Captain does not enable Claude Code brief mode."} + "description": "Whether Claude emits a shorter initial response.", + "readOnly": true, + "title": "Brief mode", + "type": "boolean", + "x-captain-option": { + "nativeName": "--brief", + "note": "Captain does not enable Claude Code brief mode.", + "support": "unsupported" + }, + "x-clicky-order": 290, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, "chrome": { - "title": "Chrome integration", "description": "Whether Claude Code connects to the Chrome browser integration.", - "type": "boolean", "readOnly": true, "x-clicky-section": "environment", "x-clicky-order": 300, - "x-captain-option": {"nativeName": "--chrome", "support": "unsupported", "note": "Captain does not control Claude Code's Chrome integration."} - }, - "noChrome": { - "title": "Disable Chrome integration", "description": "Whether Claude Code explicitly avoids the Chrome browser integration.", - "type": "boolean", "readOnly": true, "x-clicky-section": "environment", "x-clicky-order": 310, - "x-captain-option": {"nativeName": "--no-chrome", "support": "unsupported", "note": "Captain does not control Claude Code's Chrome integration."} + "description": "Whether Claude Code connects to the Chrome browser integration.", + "readOnly": true, + "title": "Chrome integration", + "type": "boolean", + "x-captain-option": { + "nativeName": "--chrome", + "note": "Captain does not control Claude Code's Chrome integration.", + "support": "unsupported" + }, + "x-clicky-order": 300, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, "cloud": { - "title": "Cloud session", "description": "Whether the prompt is executed as a Claude Code cloud session.", - "type": "boolean", "readOnly": true, "x-clicky-section": "environment", "x-clicky-order": 320, - "x-captain-option": {"nativeName": "--cloud", "support": "unsupported", "note": "Captain runs the installed local Claude Code process."} + "description": "Whether the prompt is executed as a Claude Code cloud session.", + "readOnly": true, + "title": "Cloud session", + "type": "boolean", + "x-captain-option": { + "nativeName": "--cloud", + "note": "Captain runs the installed local Claude Code process.", + "support": "unsupported" + }, + "x-clicky-order": 320, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, "continue": { - "title": "Continue recent session", "description": "Whether Claude continues the most recent session in the working directory.", - "type": "boolean", "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 330, - "x-captain-option": {"nativeName": "--continue", "support": "unsupported", "note": "Captain resumes only an explicit session identifier."} + "description": "Whether Claude continues the most recent session in the working directory.", + "readOnly": true, + "title": "Continue recent session", + "type": "boolean", + "x-captain-option": { + "nativeName": "--continue", + "note": "Captain resumes only an explicit session identifier.", + "support": "unsupported" + }, + "x-clicky-order": 330, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, "dangerouslySkipPermissions": { - "title": "Skip permissions", "description": "Whether all permission checks are bypassed.", - "type": "boolean", "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 340, - "x-captain-option": {"nativeName": "--dangerously-skip-permissions", "support": "unsupported", "note": "Captain maps explicit bypass requests through --permission-mode after policy validation."} + "description": "Whether all permission checks are bypassed.", + "readOnly": true, + "title": "Skip permissions", + "type": "boolean", + "x-captain-option": { + "nativeName": "--dangerously-skip-permissions", + "note": "Captain maps explicit bypass requests through --permission-mode after policy validation.", + "support": "unsupported" + }, + "x-clicky-order": 340, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, "debug": { - "title": "Debug", "description": "Debug category selector or switch for Claude Code diagnostics.", - "oneOf": [{"type": "boolean"}, {"type": "string"}], "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 350, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "--debug", "support": "unsupported", "note": "Captain does not expose Claude Code debug categories."} + "description": "Debug category selector or switch for Claude Code diagnostics.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "oneOf": [ + { + "description": "Debug configuration. See the linked native reference for semantics and availability.", + "title": "Debug", + "type": "boolean", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "description": "Debug configuration. See the linked native reference for semantics and availability.", + "title": "Debug", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + ], + "readOnly": true, + "title": "Debug", + "x-captain-option": { + "nativeName": "--debug", + "note": "Captain does not expose Claude Code debug categories.", + "support": "unsupported" + }, + "x-clicky-order": 350, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, "debugFile": { - "title": "Debug file", "description": "Path receiving Claude Code diagnostic logs.", - "type": "string", "format": "path", "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 360, - "x-captain-option": {"nativeName": "--debug-file", "support": "unsupported", "note": "Captain captures the child process streams instead of configuring a native debug file."} + "description": "Path receiving Claude Code diagnostic logs.", + "format": "path", + "readOnly": true, + "title": "Debug file", + "type": "string", + "x-captain-option": { + "nativeName": "--debug-file", + "note": "Captain captures the child process streams instead of configuring a native debug file.", + "support": "unsupported" + }, + "x-clicky-order": 360, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "desktop": { + "description": "Open a continued or resumed session in the Claude Desktop application.", + "readOnly": true, + "title": "Desktop app", + "type": "boolean", + "x-captain-option": { + "nativeName": "--desktop", + "note": "Captain supervises the headless CLI child process.", + "support": "unsupported" + }, + "x-clicky-order": 190, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "disableSlashCommands": { + "description": "Whether skills and slash commands are disabled.", + "title": "Disable slash commands", + "type": "boolean", + "x-captain-option": { + "nativeName": "--disable-slash-commands", + "specPath": "memory.skipSkills", + "support": "mapped" + }, + "x-clicky-order": 130, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "disallowedTools": { + "description": "Claude Code tools denied by Captain's tool policy.", + "items": { + "description": "Disallowed Tools value configuration. See the linked native reference for semantics and availability.", + "title": "Disallowed Tools value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Disallowed tools", + "type": "array", + "x-array-display": "list", + "x-captain-option": { + "aliases": [ + "--disallowedTools", + "--disallowed-tools" + ], + "nativeName": "--disallowedTools", + "specPath": "permissions.tools.deny", + "support": "mapped" + }, + "x-clicky-order": 100, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "effort": { + "description": "Reasoning effort requested from supported Claude models.", + "enum": [ + "low", + "medium", + "high", + "xhigh", + "max" + ], + "title": "Effort", + "type": "string", + "x-captain-option": { + "nativeName": "--effort", + "specPath": "model.effort", + "support": "mapped" + }, + "x-clicky-order": 60, + "x-clicky-section": "model", + "x-enum-display": "combobox", + "x-enum-labels": { + "high": "High", + "low": "Low", + "max": "Max", + "medium": "Medium", + "xhigh": "Xhigh" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, "environment": { - "title": "Environment", "description": "Remote cloud environment selected for the session.", - "type": "string", "readOnly": true, "x-clicky-section": "environment", "x-clicky-order": 370, - "x-captain-option": {"nativeName": "--environment", "support": "unsupported", "note": "Captain runs the local Claude Code environment."} + "description": "Remote cloud environment selected for the session.", + "readOnly": true, + "title": "Environment", + "type": "string", + "x-captain-option": { + "nativeName": "--environment", + "note": "Captain runs the local Claude Code environment.", + "support": "unsupported" + }, + "x-clicky-order": 370, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, "excludeDynamicSystemPromptSections": { - "title": "Excluded system prompt sections", "description": "Dynamic Claude Code system-prompt sections omitted from the request.", - "type": "array", "items": {"type": "string"}, "readOnly": true, "x-clicky-section": "prompt", "x-clicky-order": 380, "x-array-display": "list", - "x-captain-option": {"nativeName": "--exclude-dynamic-system-prompt-sections", "support": "unsupported", "note": "Captain does not filter Claude Code's dynamic system prompt."} + "description": "Dynamic Claude Code system-prompt sections omitted from the request.", + "items": { + "description": "Exclude Dynamic System Prompt Sections value configuration. See the linked native reference for semantics and availability.", + "title": "Exclude Dynamic System Prompt Sections value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "readOnly": true, + "title": "Excluded system prompt sections", + "type": "array", + "x-array-display": "list", + "x-captain-option": { + "nativeName": "--exclude-dynamic-system-prompt-sections", + "note": "Captain does not filter Claude Code's dynamic system prompt.", + "support": "unsupported" + }, + "x-clicky-order": 380, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, "fallbackModel": { - "title": "Fallback model", "description": "Model used if the requested model is overloaded.", - "type": "string", "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 390, - "x-captain-option": {"nativeName": "--fallback-model", "support": "unsupported", "note": "Captain performs fallback selection in its provider registry."} + "description": "Model used if the requested model is overloaded.", + "readOnly": true, + "title": "Fallback model", + "type": "string", + "x-captain-option": { + "nativeName": "--fallback-model", + "note": "Captain performs fallback selection in its provider registry.", + "support": "unsupported" + }, + "x-clicky-order": 390, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, "file": { - "title": "Files", "description": "File resources downloaded and supplied to the conversation at startup.", - "type": "array", "items": {"type": "string"}, "readOnly": true, "x-clicky-section": "prompt", "x-clicky-order": 400, "x-array-display": "list", - "x-captain-option": {"nativeName": "--file", "support": "unsupported", "note": "Captain sends local attachments through its composed prompt rather than file-resource mappings."} + "description": "File resources downloaded and supplied to the conversation at startup.", + "items": { + "description": "File value configuration. See the linked native reference for semantics and availability.", + "title": "File value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "readOnly": true, + "title": "Files", + "type": "array", + "x-array-display": "list", + "x-captain-option": { + "nativeName": "--file", + "note": "Captain sends local attachments through its composed prompt rather than file-resource mappings.", + "support": "unsupported" + }, + "x-clicky-order": 400, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, "forkSession": { - "title": "Fork session", "description": "Whether resuming creates a new session identifier.", - "type": "boolean", "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 410, - "x-captain-option": {"nativeName": "--fork-session", "support": "unsupported", "note": "Captain resumes the requested session in place."} + "description": "Whether resuming creates a new session identifier.", + "readOnly": true, + "title": "Fork session", + "type": "boolean", + "x-captain-option": { + "nativeName": "--fork-session", + "note": "Captain resumes the requested session in place.", + "support": "unsupported" + }, + "x-clicky-order": 410, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, "forwardSubagentText": { - "title": "Forward subagent text", "description": "Whether subagent text is forwarded into the parent output stream.", - "type": "boolean", "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 420, - "x-captain-option": {"nativeName": "--forward-subagent-text", "support": "unsupported", "note": "Captain does not enable native Claude subagent text forwarding."} + "description": "Whether subagent text is forwarded into the parent output stream.", + "readOnly": true, + "title": "Forward subagent text", + "type": "boolean", + "x-captain-option": { + "nativeName": "--forward-subagent-text", + "note": "Captain does not enable native Claude subagent text forwarding.", + "support": "unsupported" + }, + "x-clicky-order": 420, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, "fromPr": { - "title": "Resume from pull request", "description": "Pull request number whose linked Claude session is resumed.", - "type": "integer", "minimum": 1, "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 430, - "x-captain-option": {"nativeName": "--from-pr", "support": "unsupported", "note": "Captain resumes by session identifier, not pull request."} + "description": "Pull request number whose linked Claude session is resumed.", + "minimum": 1, + "readOnly": true, + "title": "Resume from pull request", + "type": "integer", + "x-captain-option": { + "nativeName": "--from-pr", + "note": "Captain resumes by session identifier, not pull request.", + "support": "unsupported" + }, + "x-clicky-order": 430, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "help": { + "description": "Whether Claude Code prints command help and exits.", + "readOnly": true, + "title": "Help", + "type": "boolean", + "x-captain-option": { + "nativeName": "--help", + "note": "Captain executes requests rather than CLI help.", + "support": "unsupported" + }, + "x-clicky-order": 650, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, "ide": { - "title": "IDE integration", "description": "Whether Claude Code connects automatically to an available IDE.", - "type": "boolean", "readOnly": true, "x-clicky-section": "environment", "x-clicky-order": 440, - "x-captain-option": {"nativeName": "--ide", "support": "unsupported", "note": "Captain does not enable Claude Code IDE integration."} + "description": "Whether Claude Code connects automatically to an available IDE.", + "readOnly": true, + "title": "IDE integration", + "type": "boolean", + "x-captain-option": { + "nativeName": "--ide", + "note": "Captain does not enable Claude Code IDE integration.", + "support": "unsupported" + }, + "x-clicky-order": 440, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, "includeHookEvents": { - "title": "Include hook events", "description": "Whether hook lifecycle events appear in stream-json output.", - "type": "boolean", "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 450, - "x-captain-option": {"nativeName": "--include-hook-events", "support": "unsupported", "note": "Captain receives monitoring hooks through generated settings."} + "description": "Whether hook lifecycle events appear in stream-json output.", + "readOnly": true, + "title": "Include hook events", + "type": "boolean", + "x-captain-option": { + "nativeName": "--include-hook-events", + "note": "Captain receives monitoring hooks through generated settings.", + "support": "unsupported" + }, + "x-clicky-order": 450, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, "includePartialMessages": { - "title": "Include partial messages", "description": "Whether partial assistant chunks appear in stream-json output.", - "type": "boolean", "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 460, - "x-captain-option": {"nativeName": "--include-partial-messages", "support": "unsupported", "note": "Captain parses complete stream-json message events."} + "description": "Whether partial assistant chunks appear in stream-json output.", + "readOnly": true, + "title": "Include partial messages", + "type": "boolean", + "x-captain-option": { + "nativeName": "--include-partial-messages", + "note": "Captain parses complete stream-json message events.", + "support": "unsupported" + }, + "x-clicky-order": 460, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, "inputFormat": { - "title": "Input format", "description": "Format used to parse standard input.", - "type": "string", "enum": ["text", "stream-json"], "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 470, "x-enum-display": "segmented", - "x-captain-option": {"nativeName": "--input-format", "support": "unsupported", "note": "Captain writes plain prompt text to standard input."} + "description": "Format used to parse standard input.", + "enum": [ + "text", + "stream-json" + ], + "readOnly": true, + "title": "Input format", + "type": "string", + "x-captain-option": { + "nativeName": "--input-format", + "note": "Captain writes plain prompt text to standard input.", + "support": "unsupported" + }, + "x-clicky-order": 470, + "x-clicky-section": "cli", + "x-enum-display": "segmented", + "x-enum-labels": { + "stream-json": "Stream json", + "text": "Text" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "jsonSchema": { + "additionalProperties": { + "description": "JSON Schema value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "JSON Schema value", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "description": "JSON Schema constraining Claude's final response.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "JSON Schema", + "type": "object", + "x-captain-option": { + "nativeName": "--json-schema", + "specPath": [ + "prompt.schema", + "prompt.schemaJson" + ], + "support": "mapped" + }, + "x-clicky-order": 170, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "maxBudgetUsd": { + "description": "Maximum spend in US dollars for the CLI request.", + "minimum": 0, + "title": "Maximum budget", + "type": "number", + "x-captain-option": { + "nativeName": "--max-budget-usd", + "specPath": "budget.cost", + "support": "mapped" + }, + "x-clicky-order": 70, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "mcpConfig": { + "description": "MCP server configuration files or inline JSON passed to Claude Code.", + "items": { + "description": "Mcp Config value configuration. See the linked native reference for semantics and availability.", + "title": "Mcp Config value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "MCP configuration", + "type": "array", + "x-array-display": "list", + "x-captain-option": { + "nativeName": "--mcp-config", + "specPath": "permissions.mcp", + "support": "mapped" + }, + "x-clicky-order": 150, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "model": { + "description": "Model alias or full model identifier passed to Claude Code.", + "title": "Model", + "type": "string", + "x-captain-option": { + "nativeName": "--model", + "specPath": "model.name", + "support": "mapped" + }, + "x-clicky-order": 20, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + }, + "x-icon": "sparkles" }, "name": { - "title": "Session name", "description": "Display name assigned to the Claude Code session.", - "type": "string", "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 480, - "x-captain-option": {"nativeName": "--name", "support": "unsupported", "note": "Captain does not assign a native Claude session name."} + "description": "Display name assigned to the Claude Code session.", + "readOnly": true, + "title": "Session name", + "type": "string", + "x-captain-option": { + "nativeName": "--name", + "note": "Captain does not assign a native Claude session name.", + "support": "unsupported" + }, + "x-clicky-order": 480, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "noChrome": { + "description": "Whether Claude Code explicitly avoids the Chrome browser integration.", + "readOnly": true, + "title": "Disable Chrome integration", + "type": "boolean", + "x-captain-option": { + "nativeName": "--no-chrome", + "note": "Captain does not control Claude Code's Chrome integration.", + "support": "unsupported" + }, + "x-clicky-order": 310, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, "noSessionPersistence": { - "title": "Disable session persistence", "description": "Whether Claude Code avoids saving the session to disk.", - "type": "boolean", "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 490, - "x-captain-option": {"nativeName": "--no-session-persistence", "support": "unsupported", "note": "Captain does not override Claude Code session persistence."} + "description": "Whether Claude Code avoids saving the session to disk.", + "readOnly": true, + "title": "Disable session persistence", + "type": "boolean", + "x-captain-option": { + "nativeName": "--no-session-persistence", + "note": "Captain does not override Claude Code session persistence.", + "support": "unsupported" + }, + "x-clicky-order": 490, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "outputFormat": { + "const": "stream-json", + "description": "Format used for Claude Code output.", + "readOnly": true, + "title": "Output format", + "type": "string", + "x-captain-option": { + "nativeName": "--output-format", + "note": "Captain requires stream-json for typed event parsing.", + "support": "managed" + }, + "x-clicky-order": 200, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "permissionMode": { + "description": "Claude Code permission posture translated from Captain policy.", + "enum": [ + "acceptEdits", + "auto", + "bypassPermissions", + "manual", + "dontAsk", + "plan" + ], + "title": "Permission mode", + "type": "string", + "x-captain-option": { + "nativeName": "--permission-mode", + "specPath": "permissions.mode", + "support": "mapped" + }, + "x-clicky-order": 80, + "x-clicky-section": "permissions", + "x-enum-display": "combobox", + "x-enum-labels": { + "acceptEdits": "Accept Edits", + "auto": "Auto", + "bypassPermissions": "Bypass Permissions", + "dontAsk": "Dont Ask", + "manual": "Manual", + "plan": "Plan" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, "permissionPrompts": { - "title": "Permission prompts", "description": "Transport used for permission prompts in non-interactive mode.", - "type": "string", "enum": ["host", "none"], "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 500, "x-enum-display": "segmented", - "x-captain-option": {"nativeName": "--permission-prompts", "support": "unsupported", "note": "Captain uses Claude Code's permission mode and tool allow or deny lists."} + "description": "Transport used for permission prompts in non-interactive mode.", + "enum": [ + "host", + "none" + ], + "readOnly": true, + "title": "Permission prompts", + "type": "string", + "x-captain-option": { + "nativeName": "--permission-prompts", + "note": "Captain uses Claude Code's permission mode and tool allow or deny lists.", + "support": "unsupported" + }, + "x-clicky-order": 500, + "x-clicky-section": "permissions", + "x-enum-display": "segmented", + "x-enum-labels": { + "host": "Host", + "none": "None" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "pluginDir": { + "description": "Claude Code plugin directories loaded for this session.", + "items": { + "description": "Plugin Dir value configuration. See the linked native reference for semantics and availability.", + "format": "path", + "title": "Plugin Dir value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Plugin directories", + "type": "array", + "x-array-display": "list", + "x-captain-option": { + "nativeName": "--plugin-dir", + "specPath": "memory.skills", + "support": "mapped" + }, + "x-clicky-order": 120, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, "pluginUrl": { - "title": "Plugin URLs", "description": "Remote plugin URLs downloaded and loaded for the session.", - "type": "array", "items": {"type": "string", "format": "uri"}, "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 510, "x-array-display": "list", - "x-captain-option": {"nativeName": "--plugin-url", "support": "unsupported", "note": "Captain accepts local skill directories and does not download Claude plugins."} + "description": "Remote plugin URLs downloaded and loaded for the session.", + "items": { + "description": "Plugin Url value configuration. See the linked native reference for semantics and availability.", + "format": "uri", + "title": "Plugin Url value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "readOnly": true, + "title": "Plugin URLs", + "type": "array", + "x-array-display": "list", + "x-captain-option": { + "nativeName": "--plugin-url", + "note": "Captain accepts local skill directories and does not download Claude plugins.", + "support": "unsupported" + }, + "x-clicky-order": 510, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "print": { + "const": true, + "description": "Whether Claude prints one response and exits instead of opening an interactive session.", + "readOnly": true, + "title": "Print mode", + "type": "boolean", + "x-captain-option": { + "nativeName": "--print", + "note": "Captain always invokes Claude Code in print mode.", + "support": "managed" + }, + "x-clicky-order": 180, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "prompt": { + "description": "Prompt text written to Claude Code standard input.", + "title": "Prompt", + "type": "string", + "x-captain-option": { + "nativeName": "stdin", + "specPath": [ + "prompt.user", + "prompt.attachments" + ], + "support": "mapped" + }, + "x-clicky-order": 10, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, "promptSuggestions": { - "title": "Prompt suggestions", "description": "Whether Claude emits suggested follow-up prompts.", - "type": "boolean", "readOnly": true, "x-clicky-section": "prompt", "x-clicky-order": 520, - "x-captain-option": {"nativeName": "--prompt-suggestions", "support": "unsupported", "note": "Captain does not request native prompt suggestions."} + "description": "Whether Claude emits suggested follow-up prompts.", + "readOnly": true, + "title": "Prompt suggestions", + "type": "boolean", + "x-captain-option": { + "nativeName": "--prompt-suggestions", + "note": "Captain does not request native prompt suggestions.", + "support": "unsupported" + }, + "x-clicky-order": 520, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, "remoteControl": { - "title": "Remote control", "description": "Whether the local session can be controlled from claude.ai.", - "type": "boolean", "readOnly": true, "x-clicky-section": "environment", "x-clicky-order": 530, - "x-captain-option": {"nativeName": "--remote-control", "support": "unsupported", "note": "Captain owns the local child process and does not enable remote control."} + "description": "Whether the local session can be controlled from claude.ai.", + "readOnly": true, + "title": "Remote control", + "type": "boolean", + "x-captain-option": { + "nativeName": "--remote-control", + "note": "Captain owns the local child process and does not enable remote control.", + "support": "unsupported" + }, + "x-clicky-order": 530, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, "remoteControlSessionNamePrefix": { - "title": "Remote session name prefix", "description": "Prefix used for remote-control session names.", - "type": "string", "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 540, - "x-captain-option": {"nativeName": "--remote-control-session-name-prefix", "support": "unsupported", "note": "Captain does not enable Claude remote-control sessions."} + "description": "Prefix used for remote-control session names.", + "readOnly": true, + "title": "Remote session name prefix", + "type": "string", + "x-captain-option": { + "nativeName": "--remote-control-session-name-prefix", + "note": "Captain does not enable Claude remote-control sessions.", + "support": "unsupported" + }, + "x-clicky-order": 540, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, "replayUserMessages": { - "title": "Replay user messages", "description": "Whether stdin user messages are echoed back into stream-json output.", - "type": "boolean", "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 550, - "x-captain-option": {"nativeName": "--replay-user-messages", "support": "unsupported", "note": "Captain already owns the canonical input message."} + "description": "Whether stdin user messages are echoed back into stream-json output.", + "readOnly": true, + "title": "Replay user messages", + "type": "boolean", + "x-captain-option": { + "nativeName": "--replay-user-messages", + "note": "Captain already owns the canonical input message.", + "support": "unsupported" + }, + "x-clicky-order": 550, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, "restricted": { - "title": "Restricted mode", "description": "Whether networking and filesystem access are restricted.", - "type": "boolean", "readOnly": true, "x-clicky-section": "sandbox", "x-clicky-order": 560, - "x-captain-option": {"nativeName": "--restricted", "support": "unsupported", "note": "Captain maps its explicit permissions instead of enabling this CLI preset."} + "description": "Whether networking and filesystem access are restricted.", + "readOnly": true, + "title": "Restricted mode", + "type": "boolean", + "x-captain-option": { + "nativeName": "--restricted", + "note": "Captain maps its explicit permissions instead of enabling this CLI preset.", + "support": "unsupported" + }, + "x-clicky-order": 560, + "x-clicky-section": "sandbox", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "resume": { + "description": "Session identifier resumed by Claude Code.", + "title": "Resume session", + "type": "string", + "x-captain-option": { + "nativeName": "--resume", + "specPath": "sessionId", + "support": "mapped" + }, + "x-clicky-order": 50, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, "safeMode": { - "title": "Safe mode", "description": "Whether built-in skills, hooks, filesystem MCP servers, and command files are disabled.", - "type": "boolean", "readOnly": true, "x-clicky-section": "sandbox", "x-clicky-order": 570, - "x-captain-option": {"nativeName": "--safe-mode", "support": "unsupported", "note": "Captain maps its bare and permission settings separately."} + "description": "Whether built-in skills, hooks, filesystem MCP servers, and command files are disabled.", + "readOnly": true, + "title": "Safe mode", + "type": "boolean", + "x-captain-option": { + "nativeName": "--safe-mode", + "note": "Captain maps its bare and permission settings separately.", + "support": "unsupported" + }, + "x-clicky-order": 570, + "x-clicky-section": "sandbox", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, "sessionId": { - "title": "New session ID", "description": "Explicit UUID assigned to a new Claude Code session.", - "type": "string", "format": "uuid", "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 580, - "x-captain-option": {"nativeName": "--session-id", "support": "unsupported", "note": "Captain reads the session identifier emitted by Claude Code."} + "description": "Explicit UUID assigned to a new Claude Code session.", + "format": "uuid", + "readOnly": true, + "title": "New session ID", + "type": "string", + "x-captain-option": { + "nativeName": "--session-id", + "note": "Captain reads the session identifier emitted by Claude Code.", + "support": "unsupported" + }, + "x-clicky-order": 580, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, "settingSources": { - "title": "Setting sources", "description": "Filesystem setting scopes loaded by Claude Code.", - "type": "array", "items": {"type": "string", "enum": ["user", "project", "local"]}, "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 590, "x-array-display": "list", - "x-captain-option": {"nativeName": "--setting-sources", "support": "unsupported", "note": "Captain does not override Claude Code's settings-source discovery."} + "description": "Filesystem setting scopes loaded by Claude Code.", + "items": { + "description": "Setting Sources value configuration. See the linked native reference for semantics and availability.", + "enum": [ + "user", + "project", + "local" + ], + "title": "Setting Sources value", + "type": "string", + "x-enum-display": "segmented", + "x-enum-labels": { + "local": "Local", + "project": "Project", + "user": "User" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "readOnly": true, + "title": "Setting sources", + "type": "array", + "x-captain-option": { + "nativeName": "--setting-sources", + "note": "Captain does not override Claude Code's settings-source discovery.", + "support": "unsupported" + }, + "x-clicky-order": 590, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "settings": { + "description": "Settings file or inline JSON generated for sandbox and monitoring behavior.", + "title": "Settings", + "type": "string", + "x-captain-option": { + "nativeName": "--settings", + "specPath": [ + "permissions", + "monitoring" + ], + "support": "mapped" + }, + "x-clicky-order": 160, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "strictMcpConfig": { + "const": true, + "description": "Whether Claude uses only MCP servers supplied by --mcp-config.", + "readOnly": true, + "title": "Strict MCP configuration", + "type": "boolean", + "x-captain-option": { + "nativeName": "--strict-mcp-config", + "note": "Captain enables strict MCP configuration whenever it supplies or disables MCP servers.", + "support": "managed" + }, + "x-clicky-order": 210, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "systemPrompt": { + "description": "System prompt replacing Claude Code's default instructions.", + "title": "System prompt", + "type": "string", + "x-captain-option": { + "nativeName": "--system-prompt", + "specPath": "prompt.system", + "support": "mapped" + }, + "x-clicky-order": 30, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, "systemPromptSnapshot": { - "title": "System prompt snapshot", "description": "Snapshot file supplying system-prompt content.", - "type": "string", "format": "path", "readOnly": true, "x-clicky-section": "prompt", "x-clicky-order": 600, - "x-captain-option": {"nativeName": "--system-prompt-snapshot", "support": "unsupported", "note": "Captain sends its system prompt directly."} + "description": "Snapshot file supplying system-prompt content.", + "format": "path", + "readOnly": true, + "title": "System prompt snapshot", + "type": "string", + "x-captain-option": { + "nativeName": "--system-prompt-snapshot", + "note": "Captain sends its system prompt directly.", + "support": "unsupported" + }, + "x-clicky-order": 600, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, "teleport": { - "title": "Teleport session", "description": "Whether a remote Claude session is teleported into the local terminal.", - "type": "boolean", "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 610, - "x-captain-option": {"nativeName": "--teleport", "support": "unsupported", "note": "Captain does not import remote Claude sessions."} + "description": "Whether a remote Claude session is teleported into the local terminal.", + "readOnly": true, + "title": "Teleport session", + "type": "boolean", + "x-captain-option": { + "nativeName": "--teleport", + "note": "Captain does not import remote Claude sessions.", + "support": "unsupported" + }, + "x-clicky-order": 610, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, "tmux": { - "title": "Tmux mode", "description": "Whether Claude creates a tmux worktree session.", - "type": "boolean", "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 620, - "x-captain-option": {"nativeName": "--tmux", "support": "unsupported", "note": "Captain manages its own process and working directory."} + "description": "Whether Claude creates a tmux worktree session.", + "readOnly": true, + "title": "Tmux mode", + "type": "boolean", + "x-captain-option": { + "nativeName": "--tmux", + "note": "Captain manages its own process and working directory.", + "support": "unsupported" + }, + "x-clicky-order": 620, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, "tools": { - "title": "Tool set", "description": "Built-in Claude Code tool names made available to the session.", - "type": "array", "items": {"type": "string"}, "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 630, "x-array-display": "list", - "x-captain-option": {"nativeName": "--tools", "support": "unsupported", "note": "Captain maps allow and deny policies instead of replacing Claude's tool set."} + "description": "Built-in Claude Code tool names made available to the session.", + "items": { + "description": "Tools value configuration. See the linked native reference for semantics and availability.", + "title": "Tools value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "readOnly": true, + "title": "Tool set", + "type": "array", + "x-array-display": "list", + "x-captain-option": { + "nativeName": "--tools", + "note": "Captain maps allow and deny policies instead of replacing Claude's tool set.", + "support": "unsupported" + }, + "x-clicky-order": 630, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, - "worktree": { - "title": "Worktree", "description": "Whether Claude starts in an isolated Git worktree, optionally using a supplied name.", - "oneOf": [{"type": "boolean"}, {"type": "string"}], "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 640, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "--worktree", "support": "unsupported", "note": "Captain executes in the working directory supplied by its context."} - }, - "help": { - "title": "Help", "description": "Whether Claude Code prints command help and exits.", - "type": "boolean", "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 650, - "x-captain-option": {"nativeName": "--help", "support": "unsupported", "note": "Captain executes requests rather than CLI help."} + "verbose": { + "const": true, + "description": "Whether Claude emits complete stream-json diagnostic events.", + "readOnly": true, + "title": "Verbose", + "type": "boolean", + "x-captain-option": { + "nativeName": "--verbose", + "note": "Captain enables verbose output so the adapter receives the complete event stream.", + "support": "managed" + }, + "x-clicky-order": 190, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } }, "version": { - "title": "Version", "description": "Whether Claude Code prints its version and exits.", - "type": "boolean", "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 660, - "x-captain-option": {"nativeName": "--version", "support": "unsupported", "note": "Captain resolves the installed CLI version outside request execution."} + "description": "Whether Claude Code prints its version and exits.", + "readOnly": true, + "title": "Version", + "type": "boolean", + "x-captain-option": { + "nativeName": "--version", + "note": "Captain resolves the installed CLI version outside request execution.", + "support": "unsupported" + }, + "x-clicky-order": 660, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + "worktree": { + "description": "Whether Claude starts in an isolated Git worktree, optionally using a supplied name.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "oneOf": [ + { + "description": "Worktree configuration. See the linked native reference for semantics and availability.", + "title": "Worktree", + "type": "boolean", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + }, + { + "description": "Worktree configuration. See the linked native reference for semantics and availability.", + "title": "Worktree", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } + } + ], + "readOnly": true, + "title": "Worktree", + "x-captain-option": { + "nativeName": "--worktree", + "note": "Captain executes in the working directory supplied by its context.", + "support": "unsupported" + }, + "x-clicky-order": 640, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] + } } + }, + "title": "Anthropic CLI options", + "type": "object", + "x-captain-adapter": { + "mode": "cli", + "provider": "anthropic", + "sources": [ + { + "kind": "cli-help", + "reference": "claude -p --help", + "version": "2.1.309" + }, + { + "kind": "implementation", + "reference": "pkg/ai/provider/claude_cli.go", + "version": "6a2b56cbd26702b18905865f21fc66d44cc864cc" + } + ] + }, + "x-captain-inventory": { + "flags": [ + "--add-dir", + "--agent", + "--agents", + "--allow-dangerously-skip-permissions", + "--allowed-tools", + "--allowedTools", + "--append-system-prompt", + "--autocompact", + "--ax-screen-reader", + "--background", + "--bare", + "--betas", + "--bg", + "--brief", + "--chrome", + "--cloud", + "--continue", + "--dangerously-skip-permissions", + "--debug", + "--debug-file", + "--desktop", + "--disable-slash-commands", + "--disallowed-tools", + "--disallowedTools", + "--effort", + "--environment", + "--exclude-dynamic-system-prompt-sections", + "--fallback-model", + "--file", + "--fork-session", + "--forward-subagent-text", + "--from-pr", + "--help", + "--ide", + "--include-hook-events", + "--include-partial-messages", + "--input-format", + "--json-schema", + "--max-budget-usd", + "--mcp-config", + "--model", + "--name", + "--no-chrome", + "--no-session-persistence", + "--output-format", + "--permission-mode", + "--permission-prompts", + "--plugin-dir", + "--plugin-url", + "--print", + "--prompt-suggestions", + "--remote-control", + "--remote-control-session-name-prefix", + "--replay-user-messages", + "--restricted", + "--resume", + "--safe-mode", + "--session-id", + "--setting-sources", + "--settings", + "--strict-mcp-config", + "--system-prompt", + "--system-prompt-snapshot", + "--teleport", + "--tmux", + "--tools", + "--verbose", + "--version", + "--worktree" + ], + "version": "claude-cli 2.1.309" + }, + "x-help": { + "links": [ + { + "href": "https://code.claude.com/docs/en/settings-reference", + "label": "Documentation" + } + ] } } diff --git a/pkg/adapters/arbitrary_json_ginkgo_test.go b/pkg/adapters/arbitrary_json_ginkgo_test.go new file mode 100644 index 00000000..a12185e3 --- /dev/null +++ b/pkg/adapters/arbitrary_json_ginkgo_test.go @@ -0,0 +1,35 @@ +package adapters + +import ( + "github.com/flanksource/captain/pkg/adapters/presentation" + "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +var _ = ginkgo.Describe("arbitrary native JSON presentation", func() { + ginkgo.It("removes string-list hints when native array items require enum or structured controls", func() { + for _, items := range []map[string]any{ + {"$ref": "#/$defs/Include"}, {"type": "string", "enum": []any{"read", "write"}}, + } { + schema := map[string]any{"type": "array", "items": items, "x-array-display": "list"} + presentation.AnnotateSchema(schema, "https://example.com/schema") + Expect(schema).NotTo(HaveKeyWithValue("x-array-display", "list")) + } + }) + + ginkgo.It("uses typed JSON editors for untyped values without constraining their native type", func() { + schema := map[string]any{"type": "object", "properties": map[string]any{ + "payload": map[string]any{}, + "options": map[string]any{"type": "object", "additionalProperties": true}, + "label": map[string]any{"type": "string"}, + }} + presentation.AnnotateSchema(schema, "https://example.com/schema") + properties := schema["properties"].(map[string]any) + payload := properties["payload"].(map[string]any) + Expect(payload).To(HaveKeyWithValue("format", "json")) + Expect(payload).NotTo(HaveKey("type")) + options := properties["options"].(map[string]any)["additionalProperties"] + Expect(options).To(HaveKeyWithValue("format", "json")) + Expect(properties["label"]).To(HaveKeyWithValue("type", "string")) + }) +}) diff --git a/pkg/adapters/backend_resources.go b/pkg/adapters/backend_resources.go new file mode 100644 index 00000000..cb2ed4f9 --- /dev/null +++ b/pkg/adapters/backend_resources.go @@ -0,0 +1,49 @@ +package adapters + +import ( + "encoding/json" + + "github.com/flanksource/captain/pkg/adapters/presentation" + "github.com/flanksource/captain/pkg/api" +) + +func backendResourceSchemas() ([]SchemaDocument, error) { + raw, err := schemaFiles.ReadFile("resources/captain-backends.json") + if err != nil { + return nil, err + } + var source map[string]any + if err := json.Unmarshal(raw, &source); err != nil { + return nil, err + } + hooks, err := api.SchemaJSON(struct { + Sidecar *api.Workflow `json:"sidecar,omitempty"` + Supervisor *api.Workflow `json:"supervisor,omitempty"` + }{}) + if err != nil { + return nil, err + } + var hookSchema map[string]any + if err := json.Unmarshal(hooks, &hookSchema); err != nil { + return nil, err + } + var documents []SchemaDocument + for _, name := range []string{"docker", "git-agent"} { + schema := source["$defs"].(map[string]any)[name].(map[string]any) + schema["$schema"] = source["$schema"] + if name == "git-agent" { + schema["properties"].(map[string]any)["hooks"] = hookSchema + if definitions, ok := hookSchema["$defs"]; ok { + schema["$defs"] = definitions + delete(hookSchema, "$defs") + } + } + presentation.AnnotateSchema(schema, "https://github.com/flanksource/captain/tree/main/pkg/sandbox/adapter") + document, err := resourceDocument("captain", name+"-backend", schema) + if err != nil { + return nil, err + } + documents = append(documents, document) + } + return documents, nil +} diff --git a/pkg/adapters/bash/api.schema.json b/pkg/adapters/bash/api.schema.json index 9fdacc45..9450fe5c 100644 --- a/pkg/adapters/bash/api.schema.json +++ b/pkg/adapters/bash/api.schema.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "BashAPIOptions", + "title": "Bash API options", "description": "The command Captain's bash runtime runs with bash -c in the run's directory; its output is the response and its exit code the structured output.", "type": "object", "additionalProperties": false, @@ -8,21 +8,70 @@ "provider": "bash", "mode": "api", "sources": [ - {"kind": "official-docs", "reference": "https://www.gnu.org/software/bash/manual/bash.html#Invoking-Bash", "version": "retrieved 2026-11-06"}, - {"kind": "implementation", "reference": "pkg/ai/provider/bash/provider.go", "version": "working tree 2026-11-06 based on b0d2ff31d41eeea6ae7ead0db81987b133ec6aeb"} + { + "kind": "official-docs", + "reference": "https://www.gnu.org/software/bash/manual/bash.html#Invoking-Bash", + "version": "retrieved 2026-11-06" + }, + { + "kind": "implementation", + "reference": "pkg/ai/provider/bash/provider.go", + "version": "working tree 2026-11-06 based on b0d2ff31d41eeea6ae7ead0db81987b133ec6aeb" + } ] }, - "required": ["command"], + "required": [ + "command" + ], "properties": { "command": { - "title": "Command", "description": "The bash command the run runs, as bash -c's argument.", - "type": "string", "minLength": 1, "x-clicky-section": "prompt", "x-clicky-order": 10, - "x-captain-option": {"nativeName": "-c", "support": "mapped", "specPath": "prompt.user"} + "title": "Command", + "description": "The bash command the run runs, as bash -c's argument.", + "type": "string", + "minLength": 1, + "x-clicky-section": "prompt", + "x-clicky-order": 10, + "x-captain-option": { + "nativeName": "-c", + "support": "mapped", + "specPath": "prompt.user" + }, + "x-help": { + "links": [ + { + "label": "Documentation", + "href": "https://www.gnu.org/software/bash/manual/bash.html#Invoking-Bash" + } + ] + } }, "dir": { - "title": "Directory", "description": "The directory the command runs in.", - "type": "string", "x-clicky-section": "workspace", "x-clicky-order": 20, - "x-captain-option": {"nativeName": "dir", "support": "mapped", "specPath": "setup.cwd"} + "title": "Directory", + "description": "The directory the command runs in.", + "type": "string", + "x-clicky-section": "workspace", + "x-clicky-order": 20, + "x-captain-option": { + "nativeName": "dir", + "support": "mapped", + "specPath": "setup.cwd" + }, + "x-help": { + "links": [ + { + "label": "Documentation", + "href": "https://www.gnu.org/software/bash/manual/bash.html#Invoking-Bash" + } + ] + } } + }, + "x-help": { + "links": [ + { + "label": "Documentation", + "href": "https://www.gnu.org/software/bash/manual/bash.html#Invoking-Bash" + } + ] } } diff --git a/pkg/adapters/catalog.go b/pkg/adapters/catalog.go index 3223d461..5d42b849 100644 --- a/pkg/adapters/catalog.go +++ b/pkg/adapters/catalog.go @@ -8,19 +8,21 @@ import ( "github.com/flanksource/captain/pkg/api/registry" ) -//go:embed */*.schema.json +//go:embed */*.schema.json resources var schemaFiles embed.FS -// SchemaDocument is one native runtime contract exposed to schema viewers. +// SchemaDocument is one execution, configuration or resource contract. type SchemaDocument struct { + ID string `json:"id"` + Kind string `json:"kind"` Provider string `json:"provider"` - Mode string `json:"mode"` + Mode string `json:"mode,omitempty"` Title string `json:"title"` Description string `json:"description"` Schema json.RawMessage `json:"schema"` } -// Schemas returns every non-cmux native runtime schema in canonical registry order. +// Schemas returns non-cmux execution schemas followed by native and Captain resources. func Schemas() ([]SchemaDocument, error) { var documents []SchemaDocument for _, provider := range registry.Providers() { @@ -36,7 +38,11 @@ func Schemas() ([]SchemaDocument, error) { documents = append(documents, document) } } - return documents, nil + resources, err := resourceSchemas() + if err != nil { + return nil, err + } + return append(documents, resources...), nil } func readSchemaDocument(path string) (SchemaDocument, error) { @@ -59,6 +65,7 @@ func readSchemaDocument(path string) (SchemaDocument, error) { return SchemaDocument{}, fmt.Errorf("adapter schema %s has incomplete viewer metadata", path) } return SchemaDocument{ + ID: metadata.Adapter.Provider + "/" + metadata.Adapter.Mode, Kind: "execution", Provider: metadata.Adapter.Provider, Mode: metadata.Adapter.Mode, Title: metadata.Title, Description: metadata.Description, Schema: raw, }, nil diff --git a/pkg/adapters/deepseek/api.schema.json b/pkg/adapters/deepseek/api.schema.json index 1f6ce451..6e1be85f 100644 --- a/pkg/adapters/deepseek/api.schema.json +++ b/pkg/adapters/deepseek/api.schema.json @@ -1,116 +1,3585 @@ { + "$defs": { + "DeepseekAPIChatCompletionAssistantMessageParam": { + "additionalProperties": false, + "description": "Messages sent by the model in response to user messages.\n\nThe property Role is required.\n", + "properties": { + "audio": { + "$ref": "#/$defs/DeepseekAPIChatCompletionAssistantMessageParamAudio", + "description": "Data about a previous audio response from the model.\n[Learn more](https://platform.openai.com/docs/guides/audio).\n", + "title": "Audio", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "content": { + "$ref": "#/$defs/DeepseekAPIChatCompletionAssistantMessageParamContentUnion", + "description": "The contents of the assistant message. Required unless `tool_calls` or\n`function_call` is specified.\n", + "title": "Content", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "function_call": { + "$ref": "#/$defs/DeepseekAPIChatCompletionAssistantMessageParamFunctionCall", + "description": "Deprecated and replaced by `tool_calls`. The name and arguments of a function\nthat should be called, as generated by the model.\n\nDeprecated: deprecated\n", + "title": "Function call", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "name": { + "description": "An optional name for the participant. Provides the model information to\ndifferentiate between participants of the same role.\n", + "title": "Name", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "refusal": { + "description": "The refusal message by the assistant.\n", + "title": "Refusal", + "type": "string", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "role": { + "const": "assistant", + "description": "The role of the messages author, in this case `assistant`.\n\nThis field can be elided, and will marshal its zero value as \"assistant\".\n", + "title": "Role", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "tool_calls": { + "description": "The tool calls generated by the model, such as function calls.\n", + "items": { + "$ref": "#/$defs/DeepseekAPIChatCompletionMessageToolCallParam", + "description": "Tool calls value configuration. See the linked native reference for semantics and availability.", + "title": "Tool calls value", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "title": "Tool calls", + "type": "array", + "x-clicky-order": 70, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "role" + ], + "title": "DeepSeek APIChat Completion Assistant Message Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIChatCompletionAssistantMessageParamAudio": { + "additionalProperties": false, + "description": "Data about a previous audio response from the model.\n[Learn more](https://platform.openai.com/docs/guides/audio).\n\nThe property ID is required.\n", + "properties": { + "id": { + "description": "Unique identifier for a previous audio response from the model.\n", + "title": "Id", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "id" + ], + "title": "DeepSeek APIChat Completion Assistant Message Param Audio", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIChatCompletionAssistantMessageParamContentArrayOfContentPartUnion": { + "anyOf": [ + { + "$ref": "#/$defs/DeepseekAPIChatCompletionContentPartTextParam", + "description": "DeepSeek APIChat Completion Assistant Message Param Content Array Of Content Part Union configuration. See the linked native reference for semantics and availability.", + "title": "DeepSeek APIChat Completion Assistant Message Param Content Array Of Content Part Union", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/DeepseekAPIChatCompletionContentPartRefusalParam", + "description": "DeepSeek APIChat Completion Assistant Message Param Content Array Of Content Part Union configuration. See the linked native reference for semantics and availability.", + "title": "DeepSeek APIChat Completion Assistant Message Param Content Array Of Content Part Union", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + ], + "description": "DeepSeek APIChat Completion Assistant Message Param Content Array Of Content Part Union configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "DeepSeek APIChat Completion Assistant Message Param Content Array Of Content Part Union", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIChatCompletionAssistantMessageParamContentUnion": { + "anyOf": [ + { + "description": "DeepSeek APIChat Completion Assistant Message Param Content Union configuration. See the linked native reference for semantics and availability.", + "title": "DeepSeek APIChat Completion Assistant Message Param Content Union", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + { + "description": "DeepSeek APIChat Completion Assistant Message Param Content Union configuration. See the linked native reference for semantics and availability.", + "items": { + "$ref": "#/$defs/DeepseekAPIChatCompletionAssistantMessageParamContentArrayOfContentPartUnion", + "description": "DeepSeek APIChat Completion Assistant Message Param Content Union value configuration. See the linked native reference for semantics and availability.", + "title": "DeepSeek APIChat Completion Assistant Message Param Content Union value", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "title": "DeepSeek APIChat Completion Assistant Message Param Content Union", + "type": "array", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + ], + "description": "DeepSeek APIChat Completion Assistant Message Param Content Union configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "DeepSeek APIChat Completion Assistant Message Param Content Union", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIChatCompletionAssistantMessageParamFunctionCall": { + "additionalProperties": false, + "description": "Deprecated and replaced by `tool_calls`. The name and arguments of a function\nthat should be called, as generated by the model.\n\nDeprecated: deprecated\n\nThe properties Arguments, Name are required.\n", + "properties": { + "arguments": { + "description": "The arguments to call the function with, as generated by the model in JSON\nformat. Note that the model does not always generate valid JSON, and may\nhallucinate parameters not defined by your function schema. Validate the\narguments in your code before calling your function.\n", + "title": "Arguments", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "name": { + "description": "The name of the function to call.\n", + "title": "Name", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "arguments", + "name" + ], + "title": "DeepSeek APIChat Completion Assistant Message Param Function Call", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIChatCompletionAudioParam": { + "additionalProperties": false, + "description": "Parameters for audio output. Required when audio output is requested with\n`modalities: [\"audio\"]`.\n[Learn more](https://platform.openai.com/docs/guides/audio).\n\nThe properties Format, Voice are required.\n", + "properties": { + "format": { + "description": "Specifies the output audio format. Must be one of `wav`, `mp3`, `flac`, `opus`,\nor `pcm16`.\n\nAny of \"wav\", \"aac\", \"mp3\", \"flac\", \"opus\", \"pcm16\".\n", + "enum": [ + "wav", + "aac", + "mp3", + "flac", + "opus", + "pcm16" + ], + "title": "Format", + "type": "string", + "x-clicky-order": 10, + "x-enum-display": "combobox", + "x-enum-labels": { + "aac": "Aac", + "flac": "Flac", + "mp3": "Mp3", + "opus": "Opus", + "pcm16": "Pcm16", + "wav": "Wav" + }, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "voice": { + "description": "The voice the model uses to respond. Supported voices are `alloy`, `ash`,\n`ballad`, `coral`, `echo`, `fable`, `nova`, `onyx`, `sage`, and `shimmer`.\n", + "enum": [ + "alloy", + "ash", + "ballad", + "coral", + "echo", + "sage", + "shimmer", + "verse" + ], + "title": "Voice", + "type": "string", + "x-clicky-order": 20, + "x-enum-display": "combobox", + "x-enum-labels": { + "alloy": "Alloy", + "ash": "Ash", + "ballad": "Ballad", + "coral": "Coral", + "echo": "Echo", + "sage": "Sage", + "shimmer": "Shimmer", + "verse": "Verse" + }, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "format", + "voice" + ], + "title": "DeepSeek APIChat Completion Audio Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIChatCompletionContentPartFileFileParam": { + "additionalProperties": false, + "description": "DeepSeek APIChat Completion Content Part File File Param configuration. See the linked native reference for semantics and availability.", + "properties": { + "file_data": { + "description": "The base64 encoded file data, used when passing the file to the model as a\nstring.\n", + "title": "File data", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "file_id": { + "description": "The ID of an uploaded file to use as input.\n", + "title": "File id", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "filename": { + "description": "The name of the file, used when passing the file to the model as a string.\n", + "title": "Filename", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + }, + "title": "DeepSeek APIChat Completion Content Part File File Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIChatCompletionContentPartFileParam": { + "additionalProperties": false, + "description": "Learn about [file inputs](https://platform.openai.com/docs/guides/text) for text\ngeneration.\n\nThe properties File, Type are required.\n", + "properties": { + "file": { + "$ref": "#/$defs/DeepseekAPIChatCompletionContentPartFileFileParam", + "description": "File configuration. See the linked native reference for semantics and availability.", + "title": "File", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "file", + "description": "The type of the content part. Always `file`.\n\nThis field can be elided, and will marshal its zero value as \"file\".\n", + "title": "Type", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "file", + "type" + ], + "title": "DeepSeek APIChat Completion Content Part File Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIChatCompletionContentPartImageImageURLParam": { + "additionalProperties": false, + "description": "The property URL is required.\n", + "properties": { + "detail": { + "description": "Specifies the detail level of the image. Learn more in the\n[Vision guide](https://platform.openai.com/docs/guides/vision#low-or-high-fidelity-image-understanding).\n\nAny of \"auto\", \"low\", \"high\".\n", + "title": "Detail", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "Either a URL of the image or the base64 encoded image data.\n", + "title": "Url", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "url" + ], + "title": "DeepSeek APIChat Completion Content Part Image Image URLParam", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIChatCompletionContentPartImageParam": { + "additionalProperties": false, + "description": "Learn about [image inputs](https://platform.openai.com/docs/guides/vision).\n\nThe properties ImageURL, Type are required.\n", + "properties": { + "image_url": { + "$ref": "#/$defs/DeepseekAPIChatCompletionContentPartImageImageURLParam", + "description": "Image url configuration. See the linked native reference for semantics and availability.", + "title": "Image url", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "image_url", + "description": "The type of the content part.\n\nThis field can be elided, and will marshal its zero value as \"image_url\".\n", + "title": "Type", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "image_url", + "type" + ], + "title": "DeepSeek APIChat Completion Content Part Image Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIChatCompletionContentPartInputAudioInputAudioParam": { + "additionalProperties": false, + "description": "The properties Data, Format are required.\n", + "properties": { + "data": { + "description": "Base64 encoded audio data.\n", + "title": "Data", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "format": { + "description": "The format of the encoded audio data. Currently supports \"wav\" and \"mp3\".\n\nAny of \"wav\", \"mp3\".\n", + "title": "Format", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "data", + "format" + ], + "title": "DeepSeek APIChat Completion Content Part Input Audio Input Audio Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIChatCompletionContentPartInputAudioParam": { + "additionalProperties": false, + "description": "Learn about [audio inputs](https://platform.openai.com/docs/guides/audio).\n\nThe properties InputAudio, Type are required.\n", + "properties": { + "input_audio": { + "$ref": "#/$defs/DeepseekAPIChatCompletionContentPartInputAudioInputAudioParam", + "description": "Input audio configuration. See the linked native reference for semantics and availability.", + "title": "Input audio", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "input_audio", + "description": "The type of the content part. Always `input_audio`.\n\nThis field can be elided, and will marshal its zero value as \"input_audio\".\n", + "title": "Type", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "input_audio", + "type" + ], + "title": "DeepSeek APIChat Completion Content Part Input Audio Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIChatCompletionContentPartRefusalParam": { + "additionalProperties": false, + "description": "The properties Refusal, Type are required.\n", + "properties": { + "refusal": { + "description": "The refusal message generated by the model.\n", + "title": "Refusal", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "refusal", + "description": "The type of the content part.\n\nThis field can be elided, and will marshal its zero value as \"refusal\".\n", + "title": "Type", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "refusal", + "type" + ], + "title": "DeepSeek APIChat Completion Content Part Refusal Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIChatCompletionContentPartTextParam": { + "additionalProperties": false, + "description": "Learn about\n[text inputs](https://platform.openai.com/docs/guides/text-generation).\n\nThe properties Text, Type are required.\n", + "properties": { + "text": { + "description": "The text content.\n", + "title": "Text", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "text", + "description": "The type of the content part.\n\nThis field can be elided, and will marshal its zero value as \"text\".\n", + "title": "Type", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "text", + "type" + ], + "title": "DeepSeek APIChat Completion Content Part Text Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIChatCompletionContentPartUnionParam": { + "anyOf": [ + { + "$ref": "#/$defs/DeepseekAPIChatCompletionContentPartTextParam", + "description": "DeepSeek APIChat Completion Content Part Union Param configuration. See the linked native reference for semantics and availability.", + "title": "DeepSeek APIChat Completion Content Part Union Param", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/DeepseekAPIChatCompletionContentPartImageParam", + "description": "DeepSeek APIChat Completion Content Part Union Param configuration. See the linked native reference for semantics and availability.", + "title": "DeepSeek APIChat Completion Content Part Union Param", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/DeepseekAPIChatCompletionContentPartInputAudioParam", + "description": "DeepSeek APIChat Completion Content Part Union Param configuration. See the linked native reference for semantics and availability.", + "title": "DeepSeek APIChat Completion Content Part Union Param", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/DeepseekAPIChatCompletionContentPartFileParam", + "description": "DeepSeek APIChat Completion Content Part Union Param configuration. See the linked native reference for semantics and availability.", + "title": "DeepSeek APIChat Completion Content Part Union Param", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + ], + "description": "DeepSeek APIChat Completion Content Part Union Param configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "DeepSeek APIChat Completion Content Part Union Param", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIChatCompletionDeveloperMessageParam": { + "additionalProperties": false, + "description": "Developer-provided instructions that the model should follow, regardless of\nmessages sent by the user. With o1 models and newer, `developer` messages\nreplace the previous `system` messages.\n\nThe properties Content, Role are required.\n", + "properties": { + "content": { + "$ref": "#/$defs/DeepseekAPIChatCompletionDeveloperMessageParamContentUnion", + "description": "The contents of the developer message.\n", + "title": "Content", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "name": { + "description": "An optional name for the participant. Provides the model information to\ndifferentiate between participants of the same role.\n", + "title": "Name", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "role": { + "const": "developer", + "description": "The role of the messages author, in this case `developer`.\n\nThis field can be elided, and will marshal its zero value as \"developer\".\n", + "title": "Role", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "content", + "role" + ], + "title": "DeepSeek APIChat Completion Developer Message Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIChatCompletionDeveloperMessageParamContentUnion": { + "anyOf": [ + { + "description": "DeepSeek APIChat Completion Developer Message Param Content Union configuration. See the linked native reference for semantics and availability.", + "title": "DeepSeek APIChat Completion Developer Message Param Content Union", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + { + "description": "DeepSeek APIChat Completion Developer Message Param Content Union configuration. See the linked native reference for semantics and availability.", + "items": { + "$ref": "#/$defs/DeepseekAPIChatCompletionContentPartTextParam", + "description": "DeepSeek APIChat Completion Developer Message Param Content Union value configuration. See the linked native reference for semantics and availability.", + "title": "DeepSeek APIChat Completion Developer Message Param Content Union value", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "title": "DeepSeek APIChat Completion Developer Message Param Content Union", + "type": "array", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + ], + "description": "DeepSeek APIChat Completion Developer Message Param Content Union configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "DeepSeek APIChat Completion Developer Message Param Content Union", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIChatCompletionFunctionCallOptionParam": { + "additionalProperties": false, + "description": "Specifying a particular function via `{\"name\": \"my_function\"}` forces the model\nto call that function.\n\nThe property Name is required.\n", + "properties": { + "name": { + "description": "The name of the function to call.\n", + "title": "Name", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "name" + ], + "title": "DeepSeek APIChat Completion Function Call Option Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIChatCompletionFunctionMessageParam": { + "additionalProperties": false, + "description": "Deprecated: deprecated\n\nThe properties Content, Name, Role are required.\n", + "properties": { + "content": { + "description": "The contents of the function message.\n", + "title": "Content", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "name": { + "description": "The name of the function to call.\n", + "title": "Name", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "role": { + "const": "function", + "description": "The role of the messages author, in this case `function`.\n\nThis field can be elided, and will marshal its zero value as \"function\".\n", + "title": "Role", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "content", + "name", + "role" + ], + "title": "DeepSeek APIChat Completion Function Message Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIChatCompletionMessageParamUnion": { + "anyOf": [ + { + "$ref": "#/$defs/DeepseekAPIChatCompletionDeveloperMessageParam", + "description": "DeepSeek APIChat Completion Message Param Union configuration. See the linked native reference for semantics and availability.", + "title": "DeepSeek APIChat Completion Message Param Union", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/DeepseekAPIChatCompletionSystemMessageParam", + "description": "DeepSeek APIChat Completion Message Param Union configuration. See the linked native reference for semantics and availability.", + "title": "DeepSeek APIChat Completion Message Param Union", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/DeepseekAPIChatCompletionUserMessageParam", + "description": "DeepSeek APIChat Completion Message Param Union configuration. See the linked native reference for semantics and availability.", + "title": "DeepSeek APIChat Completion Message Param Union", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/DeepseekAPIChatCompletionAssistantMessageParam", + "description": "DeepSeek APIChat Completion Message Param Union configuration. See the linked native reference for semantics and availability.", + "title": "DeepSeek APIChat Completion Message Param Union", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/DeepseekAPIChatCompletionToolMessageParam", + "description": "DeepSeek APIChat Completion Message Param Union configuration. See the linked native reference for semantics and availability.", + "title": "DeepSeek APIChat Completion Message Param Union", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/DeepseekAPIChatCompletionFunctionMessageParam", + "description": "DeepSeek APIChat Completion Message Param Union configuration. See the linked native reference for semantics and availability.", + "title": "DeepSeek APIChat Completion Message Param Union", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + ], + "description": "DeepSeek APIChat Completion Message Param Union configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "DeepSeek APIChat Completion Message Param Union", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIChatCompletionMessageToolCallFunctionParam": { + "additionalProperties": false, + "description": "The function that the model called.\n\nThe properties Arguments, Name are required.\n", + "properties": { + "arguments": { + "description": "The arguments to call the function with, as generated by the model in JSON\nformat. Note that the model does not always generate valid JSON, and may\nhallucinate parameters not defined by your function schema. Validate the\narguments in your code before calling your function.\n", + "title": "Arguments", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "name": { + "description": "The name of the function to call.\n", + "title": "Name", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "arguments", + "name" + ], + "title": "DeepSeek APIChat Completion Message Tool Call Function Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIChatCompletionMessageToolCallParam": { + "additionalProperties": false, + "description": "The properties ID, Function, Type are required.\n", + "properties": { + "function": { + "$ref": "#/$defs/DeepseekAPIChatCompletionMessageToolCallFunctionParam", + "description": "The function that the model called.\n", + "title": "Function", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "id": { + "description": "The ID of the tool call.\n", + "title": "Id", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "function", + "description": "The type of the tool. Currently, only `function` is supported.\n\nThis field can be elided, and will marshal its zero value as \"function\".\n", + "title": "Type", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "id", + "function", + "type" + ], + "title": "DeepSeek APIChat Completion Message Tool Call Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIChatCompletionNamedToolChoiceFunctionParam": { + "additionalProperties": false, + "description": "The property Name is required.\n", + "properties": { + "name": { + "description": "The name of the function to call.\n", + "title": "Name", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "name" + ], + "title": "DeepSeek APIChat Completion Named Tool Choice Function Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIChatCompletionNamedToolChoiceParam": { + "additionalProperties": false, + "description": "Specifies a tool the model should use. Use to force the model to call a specific\nfunction.\n\nThe properties Function, Type are required.\n", + "properties": { + "function": { + "$ref": "#/$defs/DeepseekAPIChatCompletionNamedToolChoiceFunctionParam", + "description": "Function configuration. See the linked native reference for semantics and availability.", + "title": "Function", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "function", + "description": "The type of the tool. Currently, only `function` is supported.\n\nThis field can be elided, and will marshal its zero value as \"function\".\n", + "title": "Type", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "function", + "type" + ], + "title": "DeepSeek APIChat Completion Named Tool Choice Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIChatCompletionNewParamsFunction": { + "additionalProperties": false, + "description": "Deprecated: deprecated\n\nThe property Name is required.\n", + "properties": { + "description": { + "description": "A description of what the function does, used by the model to choose when and\nhow to call the function.\n", + "title": "Description", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "name": { + "description": "The name of the function to be called. Must be a-z, A-Z, 0-9, or contain\nunderscores and dashes, with a maximum length of 64.\n", + "title": "Name", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "parameters": { + "additionalProperties": { + "description": "Parameters value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Parameters value", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "description": "The parameters the functions accepts, described as a JSON Schema object. See the\n[guide](https://platform.openai.com/docs/guides/function-calling) for examples,\nand the\n[JSON Schema reference](https://json-schema.org/understanding-json-schema/) for\ndocumentation about the format.\n\nOmitting `parameters` defines a function with an empty parameter list.\n", + "title": "Parameters", + "type": "object", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "name" + ], + "title": "DeepSeek APIChat Completion New Params Function", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIChatCompletionNewParamsFunctionCallUnion": { + "anyOf": [ + { + "description": "DeepSeek APIChat Completion New Params Function Call Union configuration. See the linked native reference for semantics and availability.", + "title": "DeepSeek APIChat Completion New Params Function Call Union", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/DeepseekAPIChatCompletionFunctionCallOptionParam", + "description": "DeepSeek APIChat Completion New Params Function Call Union configuration. See the linked native reference for semantics and availability.", + "title": "DeepSeek APIChat Completion New Params Function Call Union", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + ], + "description": "DeepSeek APIChat Completion New Params Function Call Union configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "DeepSeek APIChat Completion New Params Function Call Union", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIChatCompletionNewParamsResponseFormatUnion": { + "anyOf": [ + { + "$ref": "#/$defs/DeepseekAPIResponseFormatTextParam", + "description": "DeepSeek APIChat Completion New Params Response Format Union configuration. See the linked native reference for semantics and availability.", + "title": "DeepSeek APIChat Completion New Params Response Format Union", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/DeepseekAPIResponseFormatJSONSchemaParam", + "description": "DeepSeek APIChat Completion New Params Response Format Union configuration. See the linked native reference for semantics and availability.", + "title": "DeepSeek APIChat Completion New Params Response Format Union", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/DeepseekAPIResponseFormatJSONObjectParam", + "description": "DeepSeek APIChat Completion New Params Response Format Union configuration. See the linked native reference for semantics and availability.", + "title": "DeepSeek APIChat Completion New Params Response Format Union", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + ], + "description": "DeepSeek APIChat Completion New Params Response Format Union configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "DeepSeek APIChat Completion New Params Response Format Union", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIChatCompletionNewParamsStopUnion": { + "anyOf": [ + { + "description": "DeepSeek APIChat Completion New Params Stop Union configuration. See the linked native reference for semantics and availability.", + "title": "DeepSeek APIChat Completion New Params Stop Union", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + { + "description": "DeepSeek APIChat Completion New Params Stop Union configuration. See the linked native reference for semantics and availability.", + "items": { + "description": "DeepSeek APIChat Completion New Params Stop Union value configuration. See the linked native reference for semantics and availability.", + "title": "DeepSeek APIChat Completion New Params Stop Union value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "title": "DeepSeek APIChat Completion New Params Stop Union", + "type": "array", + "x-array-display": "list", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + ], + "description": "DeepSeek APIChat Completion New Params Stop Union configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "DeepSeek APIChat Completion New Params Stop Union", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIChatCompletionNewParamsWebSearchOptions": { + "additionalProperties": false, + "description": "This tool searches the web for relevant results to use in a response. Learn more\nabout the\n[web search tool](https://platform.openai.com/docs/guides/tools-web-search?api-mode=chat).\n", + "properties": { + "search_context_size": { + "description": "High level guidance for the amount of context window space to use for the\nsearch. One of `low`, `medium`, or `high`. `medium` is the default.\n\nAny of \"low\", \"medium\", \"high\".\n", + "title": "Search context size", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "user_location": { + "$ref": "#/$defs/DeepseekAPIChatCompletionNewParamsWebSearchOptionsUserLocation", + "description": "Approximate location parameters for the search.\n", + "title": "User location", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + }, + "title": "DeepSeek APIChat Completion New Params Web Search Options", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIChatCompletionNewParamsWebSearchOptionsUserLocation": { + "additionalProperties": false, + "description": "Approximate location parameters for the search.\n\nThe properties Approximate, Type are required.\n", + "properties": { + "approximate": { + "$ref": "#/$defs/DeepseekAPIChatCompletionNewParamsWebSearchOptionsUserLocationApproximate", + "description": "Approximate location parameters for the search.\n", + "title": "Approximate", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "approximate", + "description": "The type of location approximation. Always `approximate`.\n\nThis field can be elided, and will marshal its zero value as \"approximate\".\n", + "title": "Type", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "approximate", + "type" + ], + "title": "DeepSeek APIChat Completion New Params Web Search Options User Location", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIChatCompletionNewParamsWebSearchOptionsUserLocationApproximate": { + "additionalProperties": false, + "description": "Approximate location parameters for the search.\n", + "properties": { + "city": { + "description": "Free text input for the city of the user, e.g. `San Francisco`.\n", + "title": "City", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "country": { + "description": "The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of\nthe user, e.g. `US`.\n", + "title": "Country", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "region": { + "description": "Free text input for the region of the user, e.g. `California`.\n", + "title": "Region", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "timezone": { + "description": "The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the\nuser, e.g. `America/Los_Angeles`.\n", + "title": "Timezone", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + }, + "title": "DeepSeek APIChat Completion New Params Web Search Options User Location Approximate", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIChatCompletionPredictionContentContentUnionParam": { + "anyOf": [ + { + "description": "DeepSeek APIChat Completion Prediction Content Content Union Param configuration. See the linked native reference for semantics and availability.", + "title": "DeepSeek APIChat Completion Prediction Content Content Union Param", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + { + "description": "DeepSeek APIChat Completion Prediction Content Content Union Param configuration. See the linked native reference for semantics and availability.", + "items": { + "$ref": "#/$defs/DeepseekAPIChatCompletionContentPartTextParam", + "description": "DeepSeek APIChat Completion Prediction Content Content Union Param value configuration. See the linked native reference for semantics and availability.", + "title": "DeepSeek APIChat Completion Prediction Content Content Union Param value", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "title": "DeepSeek APIChat Completion Prediction Content Content Union Param", + "type": "array", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + ], + "description": "DeepSeek APIChat Completion Prediction Content Content Union Param configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "DeepSeek APIChat Completion Prediction Content Content Union Param", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIChatCompletionPredictionContentParam": { + "additionalProperties": false, + "description": "Static predicted output content, such as the content of a text file that is\nbeing regenerated.\n\nThe properties Content, Type are required.\n", + "properties": { + "content": { + "$ref": "#/$defs/DeepseekAPIChatCompletionPredictionContentContentUnionParam", + "description": "The content that should be matched when generating a model response. If\ngenerated tokens would match this content, the entire model response can be\nreturned much more quickly.\n", + "title": "Content", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "content", + "description": "The type of the predicted content you want to provide. This type is currently\nalways `content`.\n\nThis field can be elided, and will marshal its zero value as \"content\".\n", + "title": "Type", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "content", + "type" + ], + "title": "DeepSeek APIChat Completion Prediction Content Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIChatCompletionStreamOptionsParam": { + "additionalProperties": false, + "description": "Options for streaming response. Only set this when you set `stream: true`.\n", + "properties": { + "include_usage": { + "description": "If set, an additional chunk will be streamed before the `data: [DONE]` message.\nThe `usage` field on this chunk shows the token usage statistics for the entire\nrequest, and the `choices` field will always be an empty array.\n\nAll other chunks will also include a `usage` field, but with a null value.\n**NOTE:** If the stream is interrupted, you may not receive the final usage\nchunk which contains the total token usage for the request.\n", + "title": "Include usage", + "type": "boolean", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + }, + "title": "DeepSeek APIChat Completion Stream Options Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIChatCompletionSystemMessageParam": { + "additionalProperties": false, + "description": "Developer-provided instructions that the model should follow, regardless of\nmessages sent by the user. With o1 models and newer, use `developer` messages\nfor this purpose instead.\n\nThe properties Content, Role are required.\n", + "properties": { + "content": { + "$ref": "#/$defs/DeepseekAPIChatCompletionSystemMessageParamContentUnion", + "description": "The contents of the system message.\n", + "title": "Content", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "name": { + "description": "An optional name for the participant. Provides the model information to\ndifferentiate between participants of the same role.\n", + "title": "Name", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "role": { + "const": "system", + "description": "The role of the messages author, in this case `system`.\n\nThis field can be elided, and will marshal its zero value as \"system\".\n", + "title": "Role", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "content", + "role" + ], + "title": "DeepSeek APIChat Completion System Message Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIChatCompletionSystemMessageParamContentUnion": { + "anyOf": [ + { + "description": "DeepSeek APIChat Completion System Message Param Content Union configuration. See the linked native reference for semantics and availability.", + "title": "DeepSeek APIChat Completion System Message Param Content Union", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + { + "description": "DeepSeek APIChat Completion System Message Param Content Union configuration. See the linked native reference for semantics and availability.", + "items": { + "$ref": "#/$defs/DeepseekAPIChatCompletionContentPartTextParam", + "description": "DeepSeek APIChat Completion System Message Param Content Union value configuration. See the linked native reference for semantics and availability.", + "title": "DeepSeek APIChat Completion System Message Param Content Union value", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "title": "DeepSeek APIChat Completion System Message Param Content Union", + "type": "array", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + ], + "description": "DeepSeek APIChat Completion System Message Param Content Union configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "DeepSeek APIChat Completion System Message Param Content Union", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIChatCompletionToolChoiceOptionUnionParam": { + "anyOf": [ + { + "description": "DeepSeek APIChat Completion Tool Choice Option Union Param configuration. See the linked native reference for semantics and availability.", + "title": "DeepSeek APIChat Completion Tool Choice Option Union Param", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/DeepseekAPIChatCompletionNamedToolChoiceParam", + "description": "DeepSeek APIChat Completion Tool Choice Option Union Param configuration. See the linked native reference for semantics and availability.", + "title": "DeepSeek APIChat Completion Tool Choice Option Union Param", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + ], + "description": "DeepSeek APIChat Completion Tool Choice Option Union Param configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "DeepSeek APIChat Completion Tool Choice Option Union Param", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIChatCompletionToolMessageParam": { + "additionalProperties": false, + "description": "The properties Content, Role, ToolCallID are required.\n", + "properties": { + "content": { + "$ref": "#/$defs/DeepseekAPIChatCompletionToolMessageParamContentUnion", + "description": "The contents of the tool message.\n", + "title": "Content", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "role": { + "const": "tool", + "description": "The role of the messages author, in this case `tool`.\n\nThis field can be elided, and will marshal its zero value as \"tool\".\n", + "title": "Role", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "tool_call_id": { + "description": "Tool call that this message is responding to.\n", + "title": "Tool call id", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "content", + "tool_call_id", + "role" + ], + "title": "DeepSeek APIChat Completion Tool Message Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIChatCompletionToolMessageParamContentUnion": { + "anyOf": [ + { + "description": "DeepSeek APIChat Completion Tool Message Param Content Union configuration. See the linked native reference for semantics and availability.", + "title": "DeepSeek APIChat Completion Tool Message Param Content Union", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + { + "description": "DeepSeek APIChat Completion Tool Message Param Content Union configuration. See the linked native reference for semantics and availability.", + "items": { + "$ref": "#/$defs/DeepseekAPIChatCompletionContentPartTextParam", + "description": "DeepSeek APIChat Completion Tool Message Param Content Union value configuration. See the linked native reference for semantics and availability.", + "title": "DeepSeek APIChat Completion Tool Message Param Content Union value", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "title": "DeepSeek APIChat Completion Tool Message Param Content Union", + "type": "array", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + ], + "description": "DeepSeek APIChat Completion Tool Message Param Content Union configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "DeepSeek APIChat Completion Tool Message Param Content Union", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIChatCompletionToolParam": { + "additionalProperties": false, + "description": "The properties Function, Type are required.\n", + "properties": { + "function": { + "$ref": "#/$defs/DeepseekAPIFunctionDefinitionParam", + "description": "Function configuration. See the linked native reference for semantics and availability.", + "title": "Function", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "function", + "description": "The type of the tool. Currently, only `function` is supported.\n\nThis field can be elided, and will marshal its zero value as \"function\".\n", + "title": "Type", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "function", + "type" + ], + "title": "DeepSeek APIChat Completion Tool Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIChatCompletionUserMessageParam": { + "additionalProperties": false, + "description": "Messages sent by an end user, containing prompts or additional context\ninformation.\n\nThe properties Content, Role are required.\n", + "properties": { + "content": { + "$ref": "#/$defs/DeepseekAPIChatCompletionUserMessageParamContentUnion", + "description": "The contents of the user message.\n", + "title": "Content", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "name": { + "description": "An optional name for the participant. Provides the model information to\ndifferentiate between participants of the same role.\n", + "title": "Name", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "role": { + "const": "user", + "description": "The role of the messages author, in this case `user`.\n\nThis field can be elided, and will marshal its zero value as \"user\".\n", + "title": "Role", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "content", + "role" + ], + "title": "DeepSeek APIChat Completion User Message Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIChatCompletionUserMessageParamContentUnion": { + "anyOf": [ + { + "description": "DeepSeek APIChat Completion User Message Param Content Union configuration. See the linked native reference for semantics and availability.", + "title": "DeepSeek APIChat Completion User Message Param Content Union", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + { + "description": "DeepSeek APIChat Completion User Message Param Content Union configuration. See the linked native reference for semantics and availability.", + "items": { + "$ref": "#/$defs/DeepseekAPIChatCompletionContentPartUnionParam", + "description": "DeepSeek APIChat Completion User Message Param Content Union value configuration. See the linked native reference for semantics and availability.", + "title": "DeepSeek APIChat Completion User Message Param Content Union value", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "title": "DeepSeek APIChat Completion User Message Param Content Union", + "type": "array", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + ], + "description": "DeepSeek APIChat Completion User Message Param Content Union configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "DeepSeek APIChat Completion User Message Param Content Union", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIFunctionDefinitionParam": { + "additionalProperties": false, + "description": "The property Name is required.\n", + "properties": { + "description": { + "description": "A description of what the function does, used by the model to choose when and\nhow to call the function.\n", + "title": "Description", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "name": { + "description": "The name of the function to be called. Must be a-z, A-Z, 0-9, or contain\nunderscores and dashes, with a maximum length of 64.\n", + "title": "Name", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "parameters": { + "additionalProperties": { + "description": "Parameters value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Parameters value", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "description": "The parameters the functions accepts, described as a JSON Schema object. See the\n[guide](https://platform.openai.com/docs/guides/function-calling) for examples,\nand the\n[JSON Schema reference](https://json-schema.org/understanding-json-schema/) for\ndocumentation about the format.\n\nOmitting `parameters` defines a function with an empty parameter list.\n", + "title": "Parameters", + "type": "object", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "strict": { + "description": "Whether to enable strict schema adherence when generating the function call. If\nset to true, the model will follow the exact schema defined in the `parameters`\nfield. Only a subset of JSON Schema is supported when `strict` is `true`. Learn\nmore about Structured Outputs in the\n[function calling guide](https://platform.openai.com/docs/guides/function-calling).\n", + "title": "Strict", + "type": "boolean", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "name" + ], + "title": "DeepSeek APIFunction Definition Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIResponseFormatJSONObjectParam": { + "additionalProperties": false, + "description": "JSON object response format. An older method of generating JSON responses. Using\n`json_schema` is recommended for models that support it. Note that the model\nwill not generate JSON without a system or user message instructing it to do so.\n\nThis struct has a constant value, construct it with\n[NewResponseFormatJSONObjectParam].\n", + "properties": { + "type": { + "const": "json_object", + "description": "The type of response format being defined. Always `json_object`.\n", + "title": "Type", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type" + ], + "title": "DeepSeek APIResponse Format JSONObject Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIResponseFormatJSONSchemaJSONSchemaParam": { + "additionalProperties": false, + "description": "Structured Outputs configuration options, including a JSON Schema.\n\nThe property Name is required.\n", + "properties": { + "description": { + "description": "A description of what the response format is for, used by the model to determine\nhow to respond in the format.\n", + "title": "Description", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "name": { + "description": "The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores\nand dashes, with a maximum length of 64.\n", + "title": "Name", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "schema": { + "description": "The schema for the response format, described as a JSON Schema object. Learn how\nto build JSON schemas [here](https://json-schema.org/).\n", + "format": "json", + "title": "Schema", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "strict": { + "description": "Whether to enable strict schema adherence when generating the output. If set to\ntrue, the model will always follow the exact schema defined in the `schema`\nfield. Only a subset of JSON Schema is supported when `strict` is `true`. To\nlearn more, read the\n[Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).\n", + "title": "Strict", + "type": "boolean", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "name" + ], + "title": "DeepSeek APIResponse Format JSONSchema JSONSchema Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIResponseFormatJSONSchemaParam": { + "additionalProperties": false, + "description": "JSON Schema response format. Used to generate structured JSON responses. Learn\nmore about\n[Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).\n\nThe properties JSONSchema, Type are required.\n", + "properties": { + "json_schema": { + "$ref": "#/$defs/DeepseekAPIResponseFormatJSONSchemaJSONSchemaParam", + "description": "Structured Outputs configuration options, including a JSON Schema.\n", + "title": "JSON schema", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "json_schema", + "description": "The type of response format being defined. Always `json_schema`.\n\nThis field can be elided, and will marshal its zero value as \"json_schema\".\n", + "title": "Type", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "json_schema", + "type" + ], + "title": "DeepSeek APIResponse Format JSONSchema Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "DeepseekAPIResponseFormatTextParam": { + "additionalProperties": false, + "description": "Default response format. Used to generate text responses.\n\nThis struct has a constant value, construct it with\n[NewResponseFormatTextParam].\n", + "properties": { + "type": { + "const": "text", + "description": "The type of response format being defined. Always `text`.\n", + "title": "Type", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type" + ], + "title": "DeepSeek APIResponse Format Text Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + } + }, "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "DeepSeekAPIOptions", - "description": "Native DeepSeek Chat Completions request options used by Captain's OpenAI-compatible API runtime.", - "type": "object", "additionalProperties": false, - "x-captain-adapter": { - "provider": "deepseek", - "mode": "api", - "sources": [ - {"kind": "official-docs", "reference": "https://api-docs.deepseek.com/api/create-chat-completion/", "version": "retrieved 2026-09-11"}, - {"kind": "sdk", "reference": "github.com/openai/openai-go.ChatCompletionNewParams", "version": "v1.12.0"}, - {"kind": "implementation", "reference": "pkg/ai/provider/genkit/options.go and firebase/genkit plugins/compat_oai", "version": "6a2b56cbd26702b18905865f21fc66d44cc864cc"} - ] - }, - "required": ["messages", "model"], + "description": "Native DeepSeek Chat Completions request options used by Captain's OpenAI-compatible API runtime.", "properties": { - "model": { - "title": "Model", "description": "DeepSeek chat or reasoner model identifier.", - "type": "string", "enum": ["deepseek-chat", "deepseek-reasoner"], "x-clicky-section": "model", "x-clicky-order": 10, "x-enum-display": "combobox", "x-icon": "sparkles", - "x-captain-option": {"nativeName": "model", "support": "mapped", "specPath": "model.name"} + "audio": { + "$ref": "#/$defs/DeepseekAPIChatCompletionAudioParam", + "description": "Audio configuration. See the linked native reference for semantics and availability.", + "readOnly": true, + "title": "Audio", + "x-captain-option": { + "nativeName": "audio", + "note": "Declared by github.com/openai/openai-go v1.12.0; Captain does not construct this request option.", + "support": "unsupported" + }, + "x-clicky-order": 10, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } }, - "messages": { - "title": "Messages", "description": "Conversation messages and tool results sent to DeepSeek.", - "type": "array", "items": {"type": "object", "additionalProperties": true}, "x-clicky-section": "prompt", "x-clicky-order": 20, "x-array-display": "stacked", - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "messages", "support": "mapped", "specPath": ["messages", "prompt.system", "prompt.user", "prompt.attachments", "toolApproval"]} + "frequency_penalty": { + "description": "Deprecated penalty based on how frequently a token has appeared.", + "maximum": 2, + "minimum": -2, + "readOnly": true, + "title": "Frequency penalty", + "type": "number", + "x-captain-option": { + "nativeName": "frequency_penalty", + "note": "DeepSeek documents this option as deprecated and without effect.", + "support": "unsupported" + }, + "x-clicky-order": 170, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "function_call": { + "$ref": "#/$defs/DeepseekAPIChatCompletionNewParamsFunctionCallUnion", + "description": "Function call configuration. See the linked native reference for semantics and availability.", + "readOnly": true, + "title": "Function call", + "x-captain-option": { + "nativeName": "function_call", + "note": "Declared by github.com/openai/openai-go v1.12.0; Captain does not construct this request option.", + "support": "unsupported" + }, + "x-clicky-order": 30, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "functions": { + "description": "Functions configuration. See the linked native reference for semantics and availability.", + "items": { + "$ref": "#/$defs/DeepseekAPIChatCompletionNewParamsFunction", + "description": "Functions value configuration. See the linked native reference for semantics and availability.", + "title": "Functions value", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "readOnly": true, + "title": "Functions", + "type": "array", + "x-captain-option": { + "nativeName": "functions", + "note": "Declared by github.com/openai/openai-go v1.12.0; Captain does not construct this request option.", + "support": "unsupported" + }, + "x-clicky-order": 40, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "logit_bias": { + "additionalProperties": { + "description": "Logit bias value configuration. See the linked native reference for semantics and availability.", + "title": "Logit bias value", + "type": "integer", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "description": "Logit bias configuration. See the linked native reference for semantics and availability.", + "readOnly": true, + "title": "Logit bias", + "type": "object", + "x-captain-option": { + "nativeName": "logit_bias", + "note": "Declared by github.com/openai/openai-go v1.12.0; Captain does not construct this request option.", + "support": "unsupported" + }, + "x-clicky-order": 50, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "logprobs": { + "description": "Whether token log probabilities are included in the response.", + "readOnly": true, + "title": "Log probabilities", + "type": "boolean", + "x-captain-option": { + "nativeName": "logprobs", + "note": "Captain does not request token log probabilities.", + "support": "unsupported" + }, + "x-clicky-order": 140, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "max_completion_tokens": { + "description": "Max completion tokens configuration. See the linked native reference for semantics and availability.", + "readOnly": true, + "title": "Max completion tokens", + "type": "integer", + "x-captain-option": { + "nativeName": "max_completion_tokens", + "note": "Declared by github.com/openai/openai-go v1.12.0; Captain does not construct this request option.", + "support": "unsupported" + }, + "x-clicky-order": 70, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } }, "max_tokens": { - "title": "Maximum output tokens", "description": "Maximum number of tokens generated in the completion.", - "type": "integer", "minimum": 1, "x-clicky-section": "model", "x-clicky-order": 30, - "x-captain-option": {"nativeName": "max_tokens", "support": "mapped", "specPath": "budget.maxTokens"} + "description": "Maximum number of tokens generated in the completion.", + "minimum": 1, + "title": "Maximum output tokens", + "type": "integer", + "x-captain-option": { + "nativeName": "max_tokens", + "specPath": "budget.maxTokens", + "support": "mapped" + }, + "x-clicky-order": 30, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } }, - "temperature": { - "title": "Temperature", "description": "Sampling temperature between zero and two.", - "type": "number", "minimum": 0, "maximum": 2, "x-clicky-section": "model", "x-clicky-order": 40, - "x-captain-option": {"nativeName": "temperature", "support": "mapped", "specPath": "model.temperature"} + "messages": { + "description": "Conversation messages and tool results sent to DeepSeek.", + "items": { + "$ref": "#/$defs/DeepseekAPIChatCompletionMessageParamUnion", + "description": "Messages value configuration. See the linked native reference for semantics and availability.", + "title": "Messages value", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "title": "Messages", + "type": "array", + "x-array-display": "stacked", + "x-captain-option": { + "nativeName": "messages", + "specPath": [ + "messages", + "prompt.system", + "prompt.user", + "prompt.attachments", + "toolApproval" + ], + "support": "mapped" + }, + "x-clicky-order": 20, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "metadata": { + "additionalProperties": { + "description": "Metadata value configuration. See the linked native reference for semantics and availability.", + "title": "Metadata value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "description": "Metadata configuration. See the linked native reference for semantics and availability.", + "readOnly": true, + "title": "Metadata", + "type": "object", + "x-captain-option": { + "nativeName": "metadata", + "note": "Declared by github.com/openai/openai-go v1.12.0; Captain does not construct this request option.", + "support": "unsupported" + }, + "x-clicky-order": 100, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "modalities": { + "description": "Modalities configuration. See the linked native reference for semantics and availability.", + "items": { + "description": "Modalities value configuration. See the linked native reference for semantics and availability.", + "title": "Modalities value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "readOnly": true, + "title": "Modalities", + "type": "array", + "x-array-display": "list", + "x-captain-option": { + "nativeName": "modalities", + "note": "Declared by github.com/openai/openai-go v1.12.0; Captain does not construct this request option.", + "support": "unsupported" + }, + "x-clicky-order": 110, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "model": { + "description": "DeepSeek chat or reasoner model identifier.", + "enum": [ + "deepseek-chat", + "deepseek-reasoner" + ], + "title": "Model", + "type": "string", + "x-captain-option": { + "nativeName": "model", + "specPath": "model.name", + "support": "mapped" + }, + "x-clicky-order": 10, + "x-clicky-section": "model", + "x-enum-display": "combobox", + "x-enum-labels": { + "deepseek-chat": "Deepseek chat", + "deepseek-reasoner": "Deepseek reasoner" + }, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + }, + "x-icon": "sparkles" + }, + "n": { + "description": "N configuration. See the linked native reference for semantics and availability.", + "readOnly": true, + "title": "N", + "type": "integer", + "x-captain-option": { + "nativeName": "n", + "note": "Declared by github.com/openai/openai-go v1.12.0; Captain does not construct this request option.", + "support": "unsupported" + }, + "x-clicky-order": 130, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "parallel_tool_calls": { + "description": "Parallel tool calls configuration. See the linked native reference for semantics and availability.", + "readOnly": true, + "title": "Parallel tool calls", + "type": "boolean", + "x-captain-option": { + "nativeName": "parallel_tool_calls", + "note": "Declared by github.com/openai/openai-go v1.12.0; Captain does not construct this request option.", + "support": "unsupported" + }, + "x-clicky-order": 140, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "prediction": { + "$ref": "#/$defs/DeepseekAPIChatCompletionPredictionContentParam", + "description": "Prediction configuration. See the linked native reference for semantics and availability.", + "readOnly": true, + "title": "Prediction", + "x-captain-option": { + "nativeName": "prediction", + "note": "Declared by github.com/openai/openai-go v1.12.0; Captain does not construct this request option.", + "support": "unsupported" + }, + "x-clicky-order": 150, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "presence_penalty": { + "description": "Deprecated penalty based on whether a token has appeared.", + "maximum": 2, + "minimum": -2, + "readOnly": true, + "title": "Presence penalty", + "type": "number", + "x-captain-option": { + "nativeName": "presence_penalty", + "note": "DeepSeek documents this option as deprecated and without effect.", + "support": "unsupported" + }, + "x-clicky-order": 180, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "prompt_cache_key": { + "description": "Prompt cache key configuration. See the linked native reference for semantics and availability.", + "readOnly": true, + "title": "Prompt cache key", + "type": "string", + "x-captain-option": { + "nativeName": "prompt_cache_key", + "note": "Declared by github.com/openai/openai-go v1.12.0; Captain does not construct this request option.", + "support": "unsupported" + }, + "x-clicky-order": 170, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "reasoning_effort": { + "description": "Relative reasoning effort requested from supported DeepSeek models.", + "enum": [ + "low", + "medium", + "high" + ], + "readOnly": true, + "title": "Reasoning effort", + "type": "string", + "x-captain-option": { + "nativeName": "reasoning_effort", + "note": "Captain's Genkit compatibility provider does not send DeepSeek's native reasoning_effort field.", + "support": "unsupported" + }, + "x-clicky-order": 110, + "x-clicky-section": "model", + "x-enum-display": "combobox", + "x-enum-labels": { + "high": "High", + "low": "Low", + "medium": "Medium" + }, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } }, "response_format": { - "title": "Response format", "description": "Plain-text or JSON-object response format.", - "type": "object", "additionalProperties": true, "x-clicky-section": "prompt", "x-clicky-order": 50, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "response_format", "support": "mapped", "specPath": ["prompt.schema", "prompt.schemaJson"]} + "$ref": "#/$defs/DeepseekAPIChatCompletionNewParamsResponseFormatUnion", + "description": "Plain-text or JSON-object response format.", + "title": "Response format", + "x-captain-option": { + "nativeName": "response_format", + "specPath": [ + "prompt.schema", + "prompt.schemaJson" + ], + "support": "mapped" + }, + "x-clicky-order": 50, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } }, - "tools": { - "title": "Tools", "description": "Function tool definitions derived from Captain caller tools.", - "type": "array", "items": {"type": "object", "additionalProperties": true}, "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 60, "x-array-display": "stacked", - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "tools", "support": "managed", "note": "Captain converts runtime Config.Tools into OpenAI-compatible function definitions."} + "safety_identifier": { + "description": "Safety identifier configuration. See the linked native reference for semantics and availability.", + "readOnly": true, + "title": "Safety identifier", + "type": "string", + "x-captain-option": { + "nativeName": "safety_identifier", + "note": "Declared by github.com/openai/openai-go v1.12.0; Captain does not construct this request option.", + "support": "unsupported" + }, + "x-clicky-order": 200, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } }, - "tool_choice": { - "title": "Tool choice", "description": "Policy selecting whether and which function tool the model may call.", - "oneOf": [{"type": "string", "enum": ["none", "auto", "required"]}, {"type": "object", "additionalProperties": true}], "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 70, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "tool_choice", "support": "managed", "note": "Captain derives tool-call availability from the active tool loop."} + "seed": { + "description": "Seed configuration. See the linked native reference for semantics and availability.", + "readOnly": true, + "title": "Seed", + "type": "integer", + "x-captain-option": { + "nativeName": "seed", + "note": "Declared by github.com/openai/openai-go v1.12.0; Captain does not construct this request option.", + "support": "unsupported" + }, + "x-clicky-order": 210, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "service_tier": { + "description": "Service tier configuration. See the linked native reference for semantics and availability.", + "enum": [ + "auto", + "default", + "flex", + "scale", + "priority" + ], + "readOnly": true, + "title": "Service tier", + "type": "string", + "x-captain-option": { + "nativeName": "service_tier", + "note": "Declared by github.com/openai/openai-go v1.12.0; Captain does not construct this request option.", + "support": "unsupported" + }, + "x-clicky-order": 220, + "x-clicky-section": "environment", + "x-enum-display": "combobox", + "x-enum-labels": { + "auto": "Auto", + "default": "Default", + "flex": "Flex", + "priority": "Priority", + "scale": "Scale" + }, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "stop": { + "$ref": "#/$defs/DeepseekAPIChatCompletionNewParamsStopUnion", + "description": "One or more text sequences that stop token generation.", + "readOnly": true, + "title": "Stop sequences", + "x-array-display": "list", + "x-captain-option": { + "nativeName": "stop", + "note": "Captain has no stop-sequence Spec field.", + "support": "unsupported" + }, + "x-clicky-order": 120, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "store": { + "description": "Store configuration. See the linked native reference for semantics and availability.", + "readOnly": true, + "title": "Store", + "type": "boolean", + "x-captain-option": { + "nativeName": "store", + "note": "Declared by github.com/openai/openai-go v1.12.0; Captain does not construct this request option.", + "support": "unsupported" + }, + "x-clicky-order": 240, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } }, "stream": { - "title": "Stream", "description": "Whether the completion is returned as server-sent streaming events.", - "type": "boolean", "const": true, "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 80, - "x-captain-option": {"nativeName": "stream", "support": "managed", "note": "Captain uses the provider streaming method for ExecuteStream."} + "const": true, + "description": "Whether the completion is returned as server-sent streaming events.", + "readOnly": true, + "title": "Stream", + "type": "boolean", + "x-captain-option": { + "nativeName": "stream", + "note": "Captain uses the provider streaming method for ExecuteStream.", + "support": "managed" + }, + "x-clicky-order": 80, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } }, "stream_options": { - "title": "Stream options", "description": "Additional behavior such as including a final usage chunk in the stream.", - "type": "object", "additionalProperties": true, "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 90, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "stream_options", "support": "managed", "note": "Captain's compatibility adapter controls streaming metadata."} + "$ref": "#/$defs/DeepseekAPIChatCompletionStreamOptionsParam", + "description": "Additional behavior such as including a final usage chunk in the stream.", + "readOnly": true, + "title": "Stream options", + "x-captain-option": { + "nativeName": "stream_options", + "note": "Captain's compatibility adapter controls streaming metadata.", + "support": "managed" + }, + "x-clicky-order": 90, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "temperature": { + "description": "Sampling temperature between zero and two.", + "maximum": 2, + "minimum": 0, + "title": "Temperature", + "type": "number", + "x-captain-option": { + "nativeName": "temperature", + "specPath": "model.temperature", + "support": "mapped" + }, + "x-clicky-order": 40, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } }, "thinking": { - "title": "Thinking", "description": "Whether DeepSeek thinking mode is enabled for the request.", - "type": "object", "additionalProperties": true, "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 100, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "thinking", "support": "unsupported", "note": "Captain selects deepseek-reasoner by model ID instead of sending the native thinking object."} + "additionalProperties": { + "description": "Thinking value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Thinking value", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "description": "Whether DeepSeek thinking mode is enabled for the request.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "readOnly": true, + "title": "Thinking", + "type": "object", + "x-captain-option": { + "nativeName": "thinking", + "note": "Captain selects deepseek-reasoner by model ID instead of sending the native thinking object.", + "support": "unsupported" + }, + "x-clicky-order": 100, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } }, - "reasoning_effort": { - "title": "Reasoning effort", "description": "Relative reasoning effort requested from supported DeepSeek models.", - "type": "string", "enum": ["low", "medium", "high", "xhigh", "max"], "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 110, "x-enum-display": "combobox", - "x-captain-option": {"nativeName": "reasoning_effort", "support": "unsupported", "note": "Captain's Genkit compatibility provider does not send DeepSeek's native reasoning_effort field."} + "tool_choice": { + "$ref": "#/$defs/DeepseekAPIChatCompletionToolChoiceOptionUnionParam", + "description": "Policy selecting whether and which function tool the model may call.", + "readOnly": true, + "title": "Tool choice", + "x-captain-option": { + "nativeName": "tool_choice", + "note": "Captain derives tool-call availability from the active tool loop.", + "support": "managed" + }, + "x-clicky-order": 70, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } }, - "stop": { - "title": "Stop sequences", "description": "One or more text sequences that stop token generation.", - "oneOf": [{"type": "string"}, {"type": "array", "items": {"type": "string"}}], "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 120, "x-array-display": "list", - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "stop", "support": "unsupported", "note": "Captain has no stop-sequence Spec field."} + "tools": { + "description": "Function tool definitions derived from Captain caller tools.", + "items": { + "$ref": "#/$defs/DeepseekAPIChatCompletionToolParam", + "description": "Tools value configuration. See the linked native reference for semantics and availability.", + "title": "Tools value", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } + }, + "readOnly": true, + "title": "Tools", + "type": "array", + "x-array-display": "stacked", + "x-captain-option": { + "nativeName": "tools", + "note": "Captain converts runtime Config.Tools into OpenAI-compatible function definitions.", + "support": "managed" + }, + "x-clicky-order": 60, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } }, - "top_p": { - "title": "Top P", "description": "Cumulative probability mass retained during nucleus sampling.", - "type": "number", "minimum": 0, "maximum": 1, "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 130, - "x-captain-option": {"nativeName": "top_p", "support": "unsupported", "note": "Captain has no native top-p Spec field."} + "top_logprobs": { + "description": "Number of likely tokens returned with log probabilities at each position.", + "maximum": 20, + "minimum": 0, + "readOnly": true, + "title": "Top log probabilities", + "type": "integer", + "x-captain-option": { + "nativeName": "top_logprobs", + "note": "Captain does not expose token log-probability controls.", + "support": "unsupported" + }, + "x-clicky-order": 150, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } }, - "logprobs": { - "title": "Log probabilities", "description": "Whether token log probabilities are included in the response.", - "type": "boolean", "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 140, - "x-captain-option": {"nativeName": "logprobs", "support": "unsupported", "note": "Captain does not request token log probabilities."} + "top_p": { + "description": "Cumulative probability mass retained during nucleus sampling.", + "maximum": 1, + "minimum": 0, + "readOnly": true, + "title": "Top P", + "type": "number", + "x-captain-option": { + "nativeName": "top_p", + "note": "Captain has no native top-p Spec field.", + "support": "unsupported" + }, + "x-clicky-order": 130, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } }, - "top_logprobs": { - "title": "Top log probabilities", "description": "Number of likely tokens returned with log probabilities at each position.", - "type": "integer", "minimum": 0, "maximum": 20, "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 150, - "x-captain-option": {"nativeName": "top_logprobs", "support": "unsupported", "note": "Captain does not expose token log-probability controls."} + "user": { + "description": "User configuration. See the linked native reference for semantics and availability.", + "readOnly": true, + "title": "User", + "type": "string", + "x-captain-option": { + "nativeName": "user", + "note": "Declared by github.com/openai/openai-go v1.12.0; Captain does not construct this request option.", + "support": "unsupported" + }, + "x-clicky-order": 330, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } }, "user_id": { - "title": "User ID", "description": "Stable end-user identifier used by DeepSeek for abuse detection.", - "type": "string", "readOnly": true, "x-clicky-section": "environment", "x-clicky-order": 160, - "x-captain-option": {"nativeName": "user_id", "support": "unsupported", "note": "Captain does not send a per-request DeepSeek user identifier."} + "description": "Stable end-user identifier used by DeepSeek for abuse detection.", + "readOnly": true, + "title": "User ID", + "type": "string", + "x-captain-option": { + "nativeName": "user_id", + "note": "Captain does not send a per-request DeepSeek user identifier.", + "support": "unsupported" + }, + "x-clicky-order": 160, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } }, - "frequency_penalty": { - "title": "Frequency penalty", "description": "Deprecated penalty based on how frequently a token has appeared.", - "type": "number", "minimum": -2, "maximum": 2, "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 170, - "x-captain-option": {"nativeName": "frequency_penalty", "support": "unsupported", "note": "DeepSeek documents this option as deprecated and without effect."} - }, - "presence_penalty": { - "title": "Presence penalty", "description": "Deprecated penalty based on whether a token has appeared.", - "type": "number", "minimum": -2, "maximum": 2, "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 180, - "x-captain-option": {"nativeName": "presence_penalty", "support": "unsupported", "note": "DeepSeek documents this option as deprecated and without effect."} + "web_search_options": { + "$ref": "#/$defs/DeepseekAPIChatCompletionNewParamsWebSearchOptions", + "description": "Web search options configuration. See the linked native reference for semantics and availability.", + "readOnly": true, + "title": "Web search options", + "x-captain-option": { + "nativeName": "web_search_options", + "note": "Declared by github.com/openai/openai-go v1.12.0; Captain does not construct this request option.", + "support": "unsupported" + }, + "x-clicky-order": 350, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] + } } + }, + "required": [ + "messages", + "model" + ], + "title": "DeepSeek API options", + "type": "object", + "x-captain-adapter": { + "mode": "api", + "provider": "deepseek", + "sources": [ + { + "kind": "official-docs", + "reference": "https://api-docs.deepseek.com/api/create-chat-completion/", + "version": "retrieved 2026-09-11" + }, + { + "kind": "sdk", + "reference": "github.com/openai/openai-go.ChatCompletionNewParams", + "version": "v1.12.0" + }, + { + "kind": "implementation", + "reference": "pkg/ai/provider/genkit/options.go and firebase/genkit plugins/compat_oai", + "version": "6a2b56cbd26702b18905865f21fc66d44cc864cc" + } + ] + }, + "x-captain-inventory": { + "sourceType": "openai.ChatCompletionNewParams", + "version": "github.com/openai/openai-go v1.12.0" + }, + "x-help": { + "links": [ + { + "href": "https://api-docs.deepseek.com/api/create-chat-completion/", + "label": "Documentation" + } + ] } } diff --git a/pkg/adapters/generate.go b/pkg/adapters/generate.go index fc06bde8..6efa11bc 100644 --- a/pkg/adapters/generate.go +++ b/pkg/adapters/generate.go @@ -1,13 +1,14 @@ package adapters -//go:generate go tool go-jsonschema --only-models --struct-name-from-title --extra-imports --package adapters --tags json --output zz_generated_anthropic_api.go anthropic/api.schema.json -//go:generate go tool go-jsonschema --only-models --struct-name-from-title --extra-imports --package adapters --tags json --output zz_generated_anthropic_agent.go anthropic/agent.schema.json -//go:generate go tool go-jsonschema --only-models --struct-name-from-title --extra-imports --package adapters --tags json --output zz_generated_anthropic_cli.go anthropic/cli.schema.json -//go:generate go tool go-jsonschema --only-models --struct-name-from-title --extra-imports --package adapters --tags json --output zz_generated_openai_api.go openai/api.schema.json -//go:generate go tool go-jsonschema --only-models --struct-name-from-title --extra-imports --package adapters --tags json --output zz_generated_openai_agent.go openai/agent.schema.json -//go:generate go tool go-jsonschema --only-models --struct-name-from-title --extra-imports --package adapters --tags json --output zz_generated_openai_cli.go openai/cli.schema.json -//go:generate go tool go-jsonschema --only-models --struct-name-from-title --extra-imports --package adapters --tags json --output zz_generated_google_api.go google/api.schema.json -//go:generate go tool go-jsonschema --only-models --struct-name-from-title --extra-imports --package adapters --tags json --output zz_generated_google_cli.go google/cli.schema.json -//go:generate go tool go-jsonschema --only-models --struct-name-from-title --extra-imports --package adapters --tags json --output zz_generated_deepseek_api.go deepseek/api.schema.json -//go:generate go tool go-jsonschema --only-models --struct-name-from-title --extra-imports --package adapters --tags json --output zz_generated_jev_api.go jev/api.schema.json -//go:generate go tool go-jsonschema --only-models --struct-name-from-title --extra-imports --package adapters --tags json --output zz_generated_bash_api.go bash/api.schema.json +//go:generate go tool go-jsonschema --only-models --schema-root-type =AnthropicAPIOptions --extra-imports --package adapters --tags json --output zz_generated_anthropic_api.go anthropic/api.schema.json +//go:generate go tool go-jsonschema --only-models --schema-root-type =AnthropicAgentOptions --extra-imports --package adapters --tags json --output zz_generated_anthropic_agent.go anthropic/agent.schema.json +//go:generate go tool go-jsonschema --only-models --schema-root-type =AnthropicCLIOptions --extra-imports --package adapters --tags json --output zz_generated_anthropic_cli.go anthropic/cli.schema.json +//go:generate go tool go-jsonschema --only-models --schema-root-type =OpenAIAPIOptions --extra-imports --package adapters --tags json --output zz_generated_openai_api.go openai/api.schema.json +//go:generate go tool go-jsonschema --only-models --schema-root-type =OpenAIAgentOptions --extra-imports --package adapters --tags json --output zz_generated_openai_agent.go openai/agent.schema.json +//go:generate go tool go-jsonschema --only-models --schema-root-type =OpenAICLIOptions --extra-imports --package adapters --tags json --output zz_generated_openai_cli.go openai/cli.schema.json +//go:generate go tool go-jsonschema --only-models --schema-root-type =GoogleAPIOptions --extra-imports --package adapters --tags json --output zz_generated_google_api.go google/api.schema.json +//go:generate go tool go-jsonschema --only-models --schema-root-type =GoogleCLIOptions --extra-imports --package adapters --tags json --output zz_generated_google_cli.go google/cli.schema.json +//go:generate go tool go-jsonschema --only-models --schema-root-type =DeepSeekAPIOptions --extra-imports --package adapters --tags json --output zz_generated_deepseek_api.go deepseek/api.schema.json +//go:generate go tool go-jsonschema --only-models --schema-root-type =JevAPIOptions --extra-imports --package adapters --tags json --output zz_generated_jev_api.go jev/api.schema.json +//go:generate go tool go-jsonschema --only-models --schema-root-type =BashAPIOptions --extra-imports --package adapters --tags json --output zz_generated_bash_api.go bash/api.schema.json +//go:generate go run ../../hack/adapterdto diff --git a/pkg/adapters/google/api.schema.json b/pkg/adapters/google/api.schema.json index b3f9fc26..ade1978e 100644 --- a/pkg/adapters/google/api.schema.json +++ b/pkg/adapters/google/api.schema.json @@ -1,208 +1,6286 @@ { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "GoogleAPIOptions", - "description": "Native Google Gen AI GenerateContent arguments and configuration used by Captain's API runtime.", - "type": "object", - "additionalProperties": false, - "x-captain-adapter": { - "provider": "google", - "mode": "api", - "sources": [ - {"kind": "sdk", "reference": "google.golang.org/genai.GenerateContentConfig", "version": "v1.57.0"}, - {"kind": "official-docs", "reference": "https://googleapis.github.io/js-genai/release_docs/interfaces/types.GenerateContentConfig.html", "version": "retrieved 2026-09-11"}, - {"kind": "implementation", "reference": "pkg/ai/provider/genkit/options.go and firebase/genkit plugins/googlegenai", "version": "6a2b56cbd26702b18905865f21fc66d44cc864cc"} - ] - }, - "required": ["model", "contents"], - "properties": { - "model": { - "title": "Model", "description": "Google model identifier passed to GenerateContent.", - "type": "string", "minLength": 1, "x-clicky-section": "model", "x-clicky-order": 10, "x-icon": "sparkles", - "x-captain-option": {"nativeName": "model", "support": "mapped", "specPath": "model.name"} + "$defs": { + "GoogleAPIAPIAuth": { + "additionalProperties": false, + "description": "The generic reusable API auth config. Deprecated. Please use AuthConfig (google/cloud/aiplatform/master/auth.proto)\ninstead. This data type is not supported in Gemini API.\n", + "properties": { + "apiKeyConfig": { + "$ref": "#/$defs/GoogleAPIAPIAuthAPIKeyConfig", + "description": "The API secret.\n", + "title": "API Key Config", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIAPIAuth", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } }, - "contents": { - "title": "Contents", "description": "Conversation parts, user input, attachments, and tool results sent to the model.", - "type": "array", "items": {"type": "object", "additionalProperties": true}, "x-clicky-section": "prompt", "x-clicky-order": 20, "x-array-display": "stacked", - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "contents", "support": "mapped", "specPath": ["messages", "prompt.user", "prompt.attachments", "toolApproval"]} + "GoogleAPIAPIAuthAPIKeyConfig": { + "additionalProperties": false, + "description": "The API secret. This data type is not supported in Gemini API.\n", + "properties": { + "apiKeySecretVersion": { + "description": "Required. The SecretManager secret version resource name storing API key. e.g. projects/{project}/secrets/{secret}/versions/{version}\n", + "title": "API Key Secret Version", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "apiKeyString": { + "description": "The API key string. Either this or `api_key_secret_version` must be set.\n", + "title": "API Key String", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIAPIAuth APIKey Config", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } }, - "systemInstruction": { - "title": "System instruction", "description": "System instruction content supplied separately from the conversation.", - "type": "object", "additionalProperties": true, "x-clicky-section": "prompt", "x-clicky-order": 30, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "systemInstruction", "support": "mapped", "specPath": "prompt.system"} + "GoogleAPIAPIKeyConfig": { + "additionalProperties": false, + "description": "Config for authentication with API key. This data type is not supported in Gemini\nAPI.\n", + "properties": { + "apiKeySecret": { + "description": "Optional. The name of the SecretManager secret version resource storing the API key.\nFormat: `projects/{project}/secrets/{secrete}/versions/{version}` - If both `api_key_secret`\nand `api_key_string` are specified, this field takes precedence over `api_key_string`.\n- If specified, the `secretmanager.versions.access` permission should be granted\nto Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents)\non the specified resource.\n", + "title": "API Key Secret", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "apiKeyString": { + "description": "Optional. The API key to be used in the request directly.\n", + "title": "API Key String", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "httpElementLocation": { + "description": "Optional. The location of the API key.\n", + "enum": [ + "HTTP_IN_UNSPECIFIED", + "HTTP_IN_QUERY", + "HTTP_IN_HEADER", + "HTTP_IN_PATH", + "HTTP_IN_BODY", + "HTTP_IN_COOKIE" + ], + "title": "HTTP Element Location", + "type": "string", + "x-clicky-order": 30, + "x-enum-display": "combobox", + "x-enum-labels": { + "HTTP_IN_BODY": "HTTP IN BODY", + "HTTP_IN_COOKIE": "HTTP IN COOKIE", + "HTTP_IN_HEADER": "HTTP IN HEADER", + "HTTP_IN_PATH": "HTTP IN PATH", + "HTTP_IN_QUERY": "HTTP IN QUERY", + "HTTP_IN_UNSPECIFIED": "HTTP IN UNSPECIFIED" + }, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "name": { + "description": "Optional. The parameter name of the API key. E.g. If the API request is \"https://example.com/act?api_key=\",\n\"api_key\" would be the parameter name.\n", + "title": "Name", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIAPIKey Config", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } }, - "temperature": { - "title": "Temperature", "description": "Sampling temperature used for response generation.", - "type": "number", "minimum": 0, "maximum": 2, "x-clicky-section": "model", "x-clicky-order": 40, - "x-captain-option": {"nativeName": "temperature", "support": "mapped", "specPath": "model.temperature"} + "GoogleAPIAuthConfig": { + "additionalProperties": false, + "description": "The authentication config to access the API.\n", + "properties": { + "apiKey": { + "description": "Optional. The authentication config to access the API. Only API key is supported.\nThis field is not supported in Gemini API.\n", + "title": "API Key", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "apiKeyConfig": { + "$ref": "#/$defs/GoogleAPIAPIKeyConfig", + "description": "Config for API key auth.\n", + "title": "API Key Config", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "authType": { + "description": "Type of auth scheme.\n", + "enum": [ + "AUTH_TYPE_UNSPECIFIED", + "NO_AUTH", + "API_KEY_AUTH", + "HTTP_BASIC_AUTH", + "GOOGLE_SERVICE_ACCOUNT_AUTH", + "OAUTH", + "OIDC_AUTH" + ], + "title": "Auth Type", + "type": "string", + "x-clicky-order": 30, + "x-enum-display": "combobox", + "x-enum-labels": { + "API_KEY_AUTH": "API KEY AUTH", + "AUTH_TYPE_UNSPECIFIED": "AUTH TYPE UNSPECIFIED", + "GOOGLE_SERVICE_ACCOUNT_AUTH": "GOOGLE SERVICE ACCOUNT AUTH", + "HTTP_BASIC_AUTH": "HTTP BASIC AUTH", + "NO_AUTH": "NO AUTH", + "OAUTH": "OAUTH", + "OIDC_AUTH": "OIDC AUTH" + }, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "googleServiceAccountConfig": { + "$ref": "#/$defs/GoogleAPIAuthConfigGoogleServiceAccountConfig", + "description": "Config for Google Service Account auth.\n", + "title": "Google Service Account Config", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "httpBasicAuthConfig": { + "$ref": "#/$defs/GoogleAPIAuthConfigHTTPBasicAuthConfig", + "description": "Config for HTTP Basic auth.\n", + "title": "HTTP Basic Auth Config", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "oauthConfig": { + "$ref": "#/$defs/GoogleAPIAuthConfigOauthConfig", + "description": "Config for user oauth.\n", + "title": "Oauth Config", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "oidcConfig": { + "$ref": "#/$defs/GoogleAPIAuthConfigOidcConfig", + "description": "Config for user OIDC auth.\n", + "title": "Oidc Config", + "x-clicky-order": 70, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIAuth Config", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } }, - "maxOutputTokens": { - "title": "Maximum output tokens", "description": "Maximum number of tokens generated in the response.", - "type": "integer", "minimum": 1, "x-clicky-section": "model", "x-clicky-order": 50, - "x-captain-option": {"nativeName": "maxOutputTokens", "support": "mapped", "specPath": "budget.maxTokens"} + "GoogleAPIAuthConfigGoogleServiceAccountConfig": { + "additionalProperties": false, + "description": "Config for Google Service Account Authentication. This data type is not supported\nin Gemini API.\n", + "properties": { + "serviceAccount": { + "description": "Optional. The service account that the extension execution service runs as. - If\nthe service account is specified, the `iam.serviceAccounts.getAccessToken` permission\nshould be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents)\non the specified service account. - If not specified, the Vertex AI Extension Service\nAgent will be used to execute the Extension.\n", + "title": "Service Account", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIAuth Config Google Service Account Config", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } }, - "thinkingConfig": { - "title": "Thinking configuration", "description": "Thinking budget and inclusion settings for reasoning-capable Gemini models.", - "type": "object", "additionalProperties": true, "x-clicky-section": "model", "x-clicky-order": 60, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "thinkingConfig", "support": "mapped", "specPath": "model.effort"} + "GoogleAPIAuthConfigHTTPBasicAuthConfig": { + "additionalProperties": false, + "description": "Config for HTTP Basic Authentication. This data type is not supported in Gemini API.\n", + "properties": { + "credentialSecret": { + "description": "Required. The name of the SecretManager secret version resource storing the base64\nencoded credentials. Format: `projects/{project}/secrets/{secrete}/versions/{version}`\n- If specified, the `secretmanager.versions.access` permission should be granted\nto Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents)\non the specified resource.\n", + "title": "Credential Secret", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIAuth Config HTTPBasic Auth Config", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } }, - "responseMimeType": { - "title": "Response MIME type", "description": "MIME type requested for structured or plain-text output.", - "type": "string", "x-clicky-section": "prompt", "x-clicky-order": 70, - "x-captain-option": {"nativeName": "responseMimeType", "support": "mapped", "specPath": ["prompt.schema", "prompt.schemaJson"]} + "GoogleAPIAuthConfigOauthConfig": { + "additionalProperties": false, + "description": "Config for user oauth. This data type is not supported in Gemini API.\n", + "properties": { + "accessToken": { + "description": "Access token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]]\nat request time.\n", + "title": "Access Token", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "serviceAccount": { + "description": "The service account used to generate access tokens for executing the Extension. -\nIf the service account is specified, the `iam.serviceAccounts.getAccessToken` permission\nshould be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents)\non the provided service account.\n", + "title": "Service Account", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIAuth Config Oauth Config", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } }, - "responseSchema": { - "title": "Response schema", "description": "Google schema constraining a structured response.", - "type": "object", "additionalProperties": true, "x-clicky-section": "prompt", "x-clicky-order": 80, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "responseSchema", "support": "mapped", "specPath": ["prompt.schema", "prompt.schemaJson"]} + "GoogleAPIAuthConfigOidcConfig": { + "additionalProperties": false, + "description": "Config for user OIDC auth. This data type is not supported in Gemini API.\n", + "properties": { + "idToken": { + "description": "OpenID Connect formatted ID token for extension endpoint. Only used to propagate\ntoken from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.\n", + "title": "Id Token", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "serviceAccount": { + "description": "The service account used to generate an OpenID Connect (OIDC)-compatible JWT token\nsigned by the Google OIDC Provider (accounts.google.com) for extension endpoint (https://cloud.google.com/iam/docs/create-short-lived-credentials-direct#sa-credentials-oidc).\n- The audience for the token will be set to the URL in the server URL defined in\nthe OpenAPI spec. - If the service account is provided, the service account should\ngrant `iam.serviceAccounts.getOpenIDToken` permission to Vertex AI Extension Service\nAgent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents).\n", + "title": "Service Account", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIAuth Config Oidc Config", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } }, - "candidateCount": { - "title": "Candidate count", "description": "Number of candidate responses requested from the model.", - "type": "integer", "const": 1, "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 90, - "x-captain-option": {"nativeName": "candidateCount", "support": "managed", "note": "Captain requests exactly one candidate so each execution has one canonical response."} + "GoogleAPIBlob": { + "additionalProperties": false, + "description": "A content blob. A Blob contains data of a specific media type. It is used to represent\nimages, audio, and video.\n", + "properties": { + "data": { + "contentEncoding": "base64", + "description": "Required. The raw bytes of the data.\n", + "title": "Data", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "displayName": { + "description": "Optional. The display name of the blob. Used to provide a label or filename to distinguish\nblobs. This field is only returned in `PromptMessage` for prompt management. It is\nused in the Gemini calls only when server-side tools (`code_execution`, `google_search`,\nand `url_context`) are enabled. This field is not supported in Gemini API.\n", + "title": "Display Name", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "mimeType": { + "description": "Required. The IANA standard MIME type of the source data.\n", + "title": "Mime Type", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIBlob", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } }, - "tools": { - "title": "Tools", "description": "Native Google tool declarations derived from Captain caller tools.", - "type": "array", "items": {"type": "object", "additionalProperties": true}, "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 100, "x-array-display": "stacked", - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "tools", "support": "managed", "note": "Captain converts runtime Config.Tools into provider-native function declarations."} + "GoogleAPICodeExecutionResult": { + "additionalProperties": false, + "description": "Result of executing the `ExecutableCode`.\nGenerated only when the `CodeExecution` tool is used.\n", + "properties": { + "id": { + "description": "Optional. The identifier of the `ExecutableCode` part this result is for. Only populated\nif the corresponding `ExecutableCode` has an id.\n", + "title": "Id", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "outcome": { + "description": "Required. Outcome of the code execution.\n", + "enum": [ + "OUTCOME_UNSPECIFIED", + "OUTCOME_OK", + "OUTCOME_FAILED", + "OUTCOME_DEADLINE_EXCEEDED" + ], + "title": "Outcome", + "type": "string", + "x-clicky-order": 20, + "x-enum-display": "segmented", + "x-enum-labels": { + "OUTCOME_DEADLINE_EXCEEDED": "OUTCOME DEADLINE EXCEEDED", + "OUTCOME_FAILED": "OUTCOME FAILED", + "OUTCOME_OK": "OUTCOME OK", + "OUTCOME_UNSPECIFIED": "OUTCOME UNSPECIFIED" + }, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "output": { + "description": "Optional. Contains stdout when code execution is successful, stderr or other description\notherwise.\n", + "title": "Output", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APICode Execution Result", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } }, - "toolConfig": { - "title": "Tool configuration", "description": "Native policy controlling Google function-calling behavior.", - "type": "object", "additionalProperties": true, "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 110, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "toolConfig", "support": "managed", "note": "Captain derives the function-calling policy from its tool loop."} + "GoogleAPIComputerUse": { + "additionalProperties": false, + "description": "Tool to support computer use.\n", + "properties": { + "environment": { + "description": "Optional. Required. The environment being operated.\n", + "enum": [ + "ENVIRONMENT_UNSPECIFIED", + "ENVIRONMENT_BROWSER" + ], + "title": "Environment", + "type": "string", + "x-clicky-order": 10, + "x-enum-display": "segmented", + "x-enum-labels": { + "ENVIRONMENT_BROWSER": "ENVIRONMENT BROWSER", + "ENVIRONMENT_UNSPECIFIED": "ENVIRONMENT UNSPECIFIED" + }, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "excludedPredefinedFunctions": { + "description": "Optional. By default, predefined functions are included in the final model call.\nSome of them can be explicitly excluded from being automatically included.\nThis can serve two purposes:\n1. Using a more restricted / different action space.\n2. Improving the definitions / instructions of predefined functions.\n", + "items": { + "description": "Excluded Predefined Functions value configuration. See the linked native reference for semantics and availability.", + "title": "Excluded Predefined Functions value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "title": "Excluded Predefined Functions", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIComputer Use", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } }, - "stream": { - "title": "Stream", "description": "Whether GenerateContent returns a stream of response chunks.", - "type": "boolean", "const": true, "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 120, - "x-captain-option": {"nativeName": "stream", "support": "managed", "note": "Captain selects the streaming generation method for ExecuteStream."} + "GoogleAPIContent": { + "additionalProperties": false, + "description": "Contains the multi-part content of a message.\n", + "properties": { + "parts": { + "description": "Optional. List of parts that constitute a single message. Each part may have\na different IANA MIME type.\n", + "items": { + "$ref": "#/$defs/GoogleAPIPart", + "description": "Parts value configuration. See the linked native reference for semantics and availability.", + "title": "Parts value", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "title": "Parts", + "type": "array", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "role": { + "description": "Optional. The producer of the content. Must be either 'user' or 'model'. If not set,\nthe service will default to 'user'.\n", + "title": "Role", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIContent", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } }, - "httpOptions": { - "title": "HTTP options", "description": "Per-request HTTP transport and API version settings.", - "type": "object", "additionalProperties": true, "readOnly": true, "x-clicky-section": "environment", "x-clicky-order": 130, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "httpOptions", "support": "unsupported", "note": "Captain configures the SDK client rather than exposing per-request transport overrides."} + "GoogleAPIDynamicRetrievalConfig": { + "additionalProperties": false, + "description": "Describes the options to customize dynamic retrieval.\n", + "properties": { + "dynamicThreshold": { + "description": "Optional. The threshold to be used in dynamic retrieval. If empty, a system default\nvalue is used.\n", + "title": "Dynamic Threshold", + "type": "number", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "mode": { + "description": "The mode of the predictor to be used in dynamic retrieval.\n", + "enum": [ + "MODE_UNSPECIFIED", + "MODE_DYNAMIC" + ], + "title": "Mode", + "type": "string", + "x-clicky-order": 20, + "x-enum-display": "segmented", + "x-enum-labels": { + "MODE_DYNAMIC": "MODE DYNAMIC", + "MODE_UNSPECIFIED": "MODE UNSPECIFIED" + }, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIDynamic Retrieval Config", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } }, - "topP": { - "title": "Top P", "description": "Cumulative probability mass retained during nucleus sampling.", - "type": "number", "minimum": 0, "maximum": 1, "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 140, - "x-captain-option": {"nativeName": "topP", "support": "unsupported", "note": "Captain has no native top-p Spec field."} + "GoogleAPIEnterpriseWebSearch": { + "additionalProperties": false, + "description": "Tool to search public web data, powered by Vertex AI Search and Sec4 compliance.\nThis data type is not supported in Gemini API.\n", + "properties": { + "blockingConfidence": { + "description": "Optional. Sites with confidence level chosen \u0026 above this value will be blocked from\nthe search results.\n", + "enum": [ + "PHISH_BLOCK_THRESHOLD_UNSPECIFIED", + "BLOCK_LOW_AND_ABOVE", + "BLOCK_MEDIUM_AND_ABOVE", + "BLOCK_HIGH_AND_ABOVE", + "BLOCK_HIGHER_AND_ABOVE", + "BLOCK_VERY_HIGH_AND_ABOVE", + "BLOCK_ONLY_EXTREMELY_HIGH" + ], + "title": "Blocking Confidence", + "type": "string", + "x-clicky-order": 10, + "x-enum-display": "combobox", + "x-enum-labels": { + "BLOCK_HIGHER_AND_ABOVE": "BLOCK HIGHER AND ABOVE", + "BLOCK_HIGH_AND_ABOVE": "BLOCK HIGH AND ABOVE", + "BLOCK_LOW_AND_ABOVE": "BLOCK LOW AND ABOVE", + "BLOCK_MEDIUM_AND_ABOVE": "BLOCK MEDIUM AND ABOVE", + "BLOCK_ONLY_EXTREMELY_HIGH": "BLOCK ONLY EXTREMELY HIGH", + "BLOCK_VERY_HIGH_AND_ABOVE": "BLOCK VERY HIGH AND ABOVE", + "PHISH_BLOCK_THRESHOLD_UNSPECIFIED": "PHISH BLOCK THRESHOLD UNSPECIFIED" + }, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "excludeDomains": { + "description": "Optional. List of domains to be excluded from the search results. The default limit\nis 2000 domains.\n", + "items": { + "description": "Exclude Domains value configuration. See the linked native reference for semantics and availability.", + "title": "Exclude Domains value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "title": "Exclude Domains", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIEnterprise Web Search", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } }, - "topK": { - "title": "Top K", "description": "Number of highest-probability tokens retained during sampling.", - "type": "number", "minimum": 0, "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 150, - "x-captain-option": {"nativeName": "topK", "support": "unsupported", "note": "Captain has no native top-k Spec field."} + "GoogleAPIExecutableCode": { + "additionalProperties": false, + "description": "Model-generated code executed server-side, results returned to the model.\nOnly generated when using the `CodeExecution` tool, in which the code will\nbe automatically executed, and a corresponding `CodeExecutionResult` will\nalso be generated.\n", + "properties": { + "code": { + "description": "Required. The code to be executed.\n", + "title": "Code", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "id": { + "description": "Optional. Unique identifier of the `ExecutableCode` part. The server returns the\n`CodeExecutionResult` with the matching `id`.\n", + "title": "Id", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "language": { + "description": "Required. Programming language of the `code`.\n", + "enum": [ + "LANGUAGE_UNSPECIFIED", + "PYTHON" + ], + "title": "Language", + "type": "string", + "x-clicky-order": 30, + "x-enum-display": "segmented", + "x-enum-labels": { + "LANGUAGE_UNSPECIFIED": "LANGUAGE UNSPECIFIED", + "PYTHON": "PYTHON" + }, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIExecutable Code", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } }, - "stopSequences": { - "title": "Stop sequences", "description": "Text sequences that stop generation when encountered.", - "type": "array", "items": {"type": "string"}, "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 160, "x-array-display": "list", - "x-captain-option": {"nativeName": "stopSequences", "support": "unsupported", "note": "Captain has no stop-sequence Spec field."} + "GoogleAPIExternalAPI": { + "additionalProperties": false, + "description": "Retrieve from data source powered by external API for grounding. The external API\nis not owned by Google, but need to follow the pre-defined API spec. This data type\nis not supported in Gemini API.\n", + "properties": { + "apiAuth": { + "$ref": "#/$defs/GoogleAPIAPIAuth", + "description": "The authentication config to access the API. Deprecated. Please use auth_config instead.\n", + "title": "API Auth", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "apiSpec": { + "description": "The API spec that the external API implements.\n", + "enum": [ + "API_SPEC_UNSPECIFIED", + "SIMPLE_SEARCH", + "ELASTIC_SEARCH" + ], + "title": "API Spec", + "type": "string", + "x-clicky-order": 20, + "x-enum-display": "segmented", + "x-enum-labels": { + "API_SPEC_UNSPECIFIED": "API SPEC UNSPECIFIED", + "ELASTIC_SEARCH": "ELASTIC SEARCH", + "SIMPLE_SEARCH": "SIMPLE SEARCH" + }, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "authConfig": { + "$ref": "#/$defs/GoogleAPIAuthConfig", + "description": "The authentication config to access the API.\n", + "title": "Auth Config", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "elasticSearchParams": { + "$ref": "#/$defs/GoogleAPIExternalAPIElasticSearchParams", + "description": "Parameters for the elastic search API.\n", + "title": "Elastic Search Params", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "endpoint": { + "description": "The endpoint of the external API. The system will call the API at this endpoint to\nretrieve the data for grounding. Example: https://acme.com:443/search\n", + "title": "Endpoint", + "type": "string", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "simpleSearchParams": { + "$ref": "#/$defs/GoogleAPIExternalAPISimpleSearchParams", + "description": "Parameters for the simple search API.\n", + "title": "Simple Search Params", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIExternal API", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } }, - "responseLogprobs": { - "title": "Response log probabilities", "description": "Whether token log probabilities are included in the response.", - "type": "boolean", "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 170, - "x-captain-option": {"nativeName": "responseLogprobs", "support": "unsupported", "note": "Captain does not request token log probabilities."} + "GoogleAPIExternalAPIElasticSearchParams": { + "additionalProperties": false, + "description": "The search parameters to use for the ELASTIC_SEARCH spec. This data type is not supported\nin Gemini API.\n", + "properties": { + "index": { + "description": "The ElasticSearch index to use.\n", + "title": "Index", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "numHits": { + "description": "Optional. Number of hits (chunks) to request. When specified, it is passed to Elasticsearch\nas the `num_hits` param.\n", + "title": "Num Hits", + "type": "integer", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "searchTemplate": { + "description": "The ElasticSearch search template to use.\n", + "title": "Search Template", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIExternal APIElastic Search Params", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } }, - "logprobs": { - "title": "Log probabilities", "description": "Number of top token log probabilities returned per decoding step.", - "type": "integer", "minimum": 0, "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 180, - "x-captain-option": {"nativeName": "logprobs", "support": "unsupported", "note": "Captain does not expose Google log-probability controls."} + "GoogleAPIExternalAPISimpleSearchParams": { + "additionalProperties": false, + "description": "The search parameters to use for SIMPLE_SEARCH spec. This data type is not supported\nin Gemini API.\n", + "properties": {}, + "title": "Google APIExternal APISimple Search Params", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } }, - "presencePenalty": { - "title": "Presence penalty", "description": "Penalty applied when a token has appeared in the generated text.", - "type": "number", "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 190, - "x-captain-option": {"nativeName": "presencePenalty", "support": "unsupported", "note": "Captain has no native presence-penalty Spec field."} + "GoogleAPIFileData": { + "additionalProperties": false, + "description": "URI-based data. A FileData message contains a URI pointing to data of a specific\nmedia type. It is used to represent images, audio, and video stored in Google Cloud\nStorage.\n", + "properties": { + "displayName": { + "description": "Optional. The display name of the file. Used to provide a label or filename to distinguish\nfiles. This field is only returned in `PromptMessage` for prompt management. It is\nused in the Gemini calls only when server side tools (`code_execution`, `google_search`,\nand `url_context`) are enabled. This field is not supported in Gemini API.\n", + "title": "Display Name", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "fileUri": { + "description": "Required. The URI of the file in Google Cloud Storage.\n", + "title": "File Uri", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "mimeType": { + "description": "Required. The IANA standard MIME type of the source data.\n", + "title": "Mime Type", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIFile Data", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } }, - "frequencyPenalty": { - "title": "Frequency penalty", "description": "Penalty scaled by how often a token has appeared in generated text.", - "type": "number", "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 200, - "x-captain-option": {"nativeName": "frequencyPenalty", "support": "unsupported", "note": "Captain has no native frequency-penalty Spec field."} + "GoogleAPIFileSearch": { + "additionalProperties": false, + "description": "The FileSearch tool that retrieves knowledge from Semantic Retrieval corpora. Files\nare imported to Semantic Retrieval corpora using the ImportFile API. This data type\nis not supported in Vertex AI.\n", + "properties": { + "fileSearchStoreNames": { + "description": "Required. The names of the file_search_stores to retrieve from. Example: `fileSearchStores/my-file-search-store-123`\n", + "items": { + "description": "File Search Store Names value configuration. See the linked native reference for semantics and availability.", + "title": "File Search Store Names value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "title": "File Search Store Names", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "metadataFilter": { + "description": "Optional. Metadata filter to apply to the semantic retrieval documents and chunks.\n", + "title": "Metadata Filter", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "topK": { + "description": "Optional. The number of semantic retrieval chunks to retrieve.\n", + "title": "Top K", + "type": "integer", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIFile Search", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } }, - "seed": { - "title": "Seed", "description": "Fixed sampling seed used for best-effort deterministic generation.", - "type": "integer", "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 210, - "x-captain-option": {"nativeName": "seed", "support": "unsupported", "note": "Captain does not expose a generation seed."} + "GoogleAPIFunctionCall": { + "additionalProperties": false, + "description": "A function call.\n", + "properties": { + "args": { + "additionalProperties": { + "description": "Args value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Args value", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "description": "Optional. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters]\nfor parameter details.\n", + "title": "Args", + "type": "object", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "id": { + "description": "Optional. The unique ID of the function call. If populated, the client to execute\nthe\n`function_call` and return the response with the matching `id`.\n", + "title": "Id", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "name": { + "description": "Optional. Required. The name of the function to call. Matches [FunctionDeclaration.Name].\n", + "title": "Name", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "partialArgs": { + "description": "Optional. The partial argument value of the function call. If provided, represents\nthe arguments/fields that are streamed incrementally. This field is not supported\nin Gemini API.\n", + "items": { + "$ref": "#/$defs/GoogleAPIPartialArg", + "description": "Partial Args value configuration. See the linked native reference for semantics and availability.", + "title": "Partial Args value", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "title": "Partial Args", + "type": "array", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "willContinue": { + "description": "Optional. Whether this is the last part of the FunctionCall. If true, another partial\nmessage for the current FunctionCall is expected to follow. This field is not supported\nin Gemini API.\n", + "title": "Will Continue", + "type": "boolean", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIFunction Call", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } }, - "responseJsonSchema": { - "title": "Response JSON Schema", "description": "Raw JSON Schema constraining generated JSON output.", - "type": "object", "additionalProperties": true, "readOnly": true, "x-clicky-section": "prompt", "x-clicky-order": 220, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "responseJsonSchema", "support": "unsupported", "note": "Captain's Genkit adapter converts structured output through responseSchema."} + "GoogleAPIFunctionCallingConfig": { + "additionalProperties": false, + "description": "Function calling config.\n", + "properties": { + "allowedFunctionNames": { + "description": "Optional. Function names to call. Only set when the Mode is ANY. Function names should\nmatch [FunctionDeclaration.Name]. With mode set to ANY, model will predict a function\ncall from the set of function names provided.\n", + "items": { + "description": "Allowed Function Names value configuration. See the linked native reference for semantics and availability.", + "title": "Allowed Function Names value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "title": "Allowed Function Names", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "mode": { + "description": "Optional. Function calling mode.\n", + "enum": [ + "MODE_UNSPECIFIED", + "AUTO", + "ANY", + "NONE", + "VALIDATED" + ], + "title": "Mode", + "type": "string", + "x-clicky-order": 20, + "x-enum-display": "combobox", + "x-enum-labels": { + "ANY": "ANY", + "AUTO": "AUTO", + "MODE_UNSPECIFIED": "MODE UNSPECIFIED", + "NONE": "NONE", + "VALIDATED": "VALIDATED" + }, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "streamFunctionCallArguments": { + "description": "Optional. When set to true, arguments of a single function call will be streamed\nout in multiple parts/contents/responses. Partial parameter results will be returned\nin the [FunctionCall.partial_args] field. This field is not supported in Gemini API.\n", + "title": "Stream Function Call Arguments", + "type": "boolean", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIFunction Calling Config", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } }, - "routingConfig": { - "title": "Routing configuration", "description": "Model routing behavior for supported Google endpoints.", - "type": "object", "additionalProperties": true, "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 230, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "routingConfig", "support": "unsupported", "note": "Captain resolves one concrete model before calling the provider."} + "GoogleAPIFunctionDeclaration": { + "additionalProperties": false, + "description": "Structured representation of a function declaration as defined by the [OpenAPI 3.0\nspecification](https://spec.openapis.org/oas/v3.0.3). Included in this declaration\nare the function name, description, parameters and response type. This FunctionDeclaration\nis a representation of a block of code that can be used as a `Tool` by the model\nand executed by the client.\n", + "properties": { + "behavior": { + "description": "Optional. Specifies the function Behavior. Currently only non-blocking functions\nare supported. If not specified, the system keeps the current function call behavior.\nThis field is currently only supported by the BidiGenerateContent method.\n", + "enum": [ + "UNSPECIFIED", + "BLOCKING", + "NON_BLOCKING" + ], + "title": "Behavior", + "type": "string", + "x-clicky-order": 10, + "x-enum-display": "segmented", + "x-enum-labels": { + "BLOCKING": "BLOCKING", + "NON_BLOCKING": "NON BLOCKING", + "UNSPECIFIED": "UNSPECIFIED" + }, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "description": { + "description": "Optional. Description and purpose of the function. Model uses it to decide how and\nwhether to call the function.\n", + "title": "Description", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "name": { + "description": "Required. The name of the function to call. Must start with a letter or an underscore.\nMust be a-z, A-Z, 0-9, or contain underscores, dots, colons and dashes, with a maximum\nlength of 64.\n", + "title": "Name", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "parameters": { + "$ref": "#/$defs/GoogleAPISchema", + "description": "Optional. Describes the parameters to this function in JSON Schema Object format.\nReflects the Open API 3.03 Parameter Object. string Key: the name of the parameter.\nParameter names are case sensitive. Schema Value: the Schema defining the type used\nfor the parameter. For function with no parameters, this can be left unset. Parameter\nnames must start with a letter or an underscore and must only contain chars a-z,\nA-Z, 0-9, or underscores with a maximum length of 64. Example with 1 required and\n1 optional parameter: type: OBJECT properties: param1: type: STRING param2: type:\nINTEGER required: - param1\n", + "title": "Parameters", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "parametersJsonSchema": { + "description": "Optional. Describes the parameters to the function in JSON Schema format. The schema\nmust describe an object where the properties are the parameters to the function.\nFor example: ``` { \"type\": \"object\", \"properties\": { \"name\": { \"type\": \"string\" },\n\"age\": { \"type\": \"integer\" } }, \"additionalProperties\": false, \"required\": [\"name\",\n\"age\"], \"propertyOrdering\": [\"name\", \"age\"] } ``` This field is mutually exclusive\nwith `parameters`.\n", + "format": "json", + "title": "Parameters JSON Schema", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "response": { + "$ref": "#/$defs/GoogleAPISchema", + "description": "Optional. Describes the output from this function in JSON Schema format. Reflects\nthe Open API 3.03 Response Object. The Schema defines the type used for the response\nvalue of the function.\n", + "title": "Response", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "responseJsonSchema": { + "description": "Optional. Describes the output from this function in JSON Schema format. The value\nspecified by the schema is the response value of the function. This field is mutually\nexclusive with `response`.\n", + "format": "json", + "title": "Response JSON Schema", + "x-clicky-order": 70, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIFunction Declaration", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } }, - "modelSelectionConfig": { - "title": "Model selection configuration", "description": "Constraints used by automatic model selection.", - "type": "object", "additionalProperties": true, "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 240, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "modelSelectionConfig", "support": "unsupported", "note": "Captain's registry selects a concrete model before execution."} + "GoogleAPIFunctionResponse": { + "additionalProperties": false, + "description": "A function response.\n", + "properties": { + "id": { + "description": "Optional. The ID of the function call this response is for. Populated by the client\nto match the corresponding function call `id`.\n", + "title": "Id", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "name": { + "description": "Required. The name of the function to call. Matches [FunctionDeclaration.name] and\n[FunctionCall.name].\n", + "title": "Name", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "parts": { + "description": "Optional. List of parts that constitute a function response. Each part may\nhave a different IANA MIME type.\n", + "items": { + "$ref": "#/$defs/GoogleAPIFunctionResponsePart", + "description": "Parts value configuration. See the linked native reference for semantics and availability.", + "title": "Parts value", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "title": "Parts", + "type": "array", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "response": { + "additionalProperties": { + "description": "Response value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Response value", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "description": "Required. The function response in JSON object format. Use \"output\" key to specify\nfunction output and \"error\" key to specify error details (if any). If \"output\" and\n\"error\" keys are not specified, then whole \"response\" is treated as function output.\n", + "title": "Response", + "type": "object", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "scheduling": { + "description": "Optional. Specifies how the response should be scheduled in the conversation. Only\napplicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE.\n", + "enum": [ + "SCHEDULING_UNSPECIFIED", + "SILENT", + "WHEN_IDLE", + "INTERRUPT" + ], + "title": "Scheduling", + "type": "string", + "x-clicky-order": 50, + "x-enum-display": "segmented", + "x-enum-labels": { + "INTERRUPT": "INTERRUPT", + "SCHEDULING_UNSPECIFIED": "SCHEDULING UNSPECIFIED", + "SILENT": "SILENT", + "WHEN_IDLE": "WHEN IDLE" + }, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "willContinue": { + "description": "Optional. Signals that function call continues, and more responses will be returned,\nturning the function call into a generator. Is only applicable to NON_BLOCKING function\ncalls (see FunctionDeclaration.behavior for details), ignored otherwise. If false,\nthe default, future responses will not be considered. Is only applicable to NON_BLOCKING\nfunction calls, is ignored otherwise. If set to false, future responses will not\nbe considered. It is allowed to return empty `response` with `will_continue=False`\nto signal that the function call is finished.\n", + "title": "Will Continue", + "type": "boolean", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIFunction Response", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } }, - "safetySettings": { - "title": "Safety settings", "description": "Per-category content safety thresholds applied to the request.", - "type": "array", "items": {"type": "object", "additionalProperties": true}, "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 250, "x-array-display": "stacked", - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "safetySettings", "support": "unsupported", "note": "Captain does not expose per-request Google safety thresholds."} + "GoogleAPIFunctionResponseBlob": { + "additionalProperties": false, + "description": "Raw media bytes for function response.\nText should not be sent as raw bytes, use the FunctionResponse.response\nfield.\n", + "properties": { + "data": { + "contentEncoding": "base64", + "description": "Required. Inline media bytes.\n", + "title": "Data", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "displayName": { + "description": "Optional. Display name of the blob.\nUsed to provide a label or filename to distinguish blobs.\n", + "title": "Display Name", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "mimeType": { + "description": "Required. The IANA standard MIME type of the source data.\n", + "title": "Mime Type", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIFunction Response Blob", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } }, - "labels": { - "title": "Labels", "description": "String key-value labels attached to the request for billing and reporting.", - "type": "object", "additionalProperties": {"type": "string"}, "readOnly": true, "x-clicky-section": "environment", "x-clicky-order": 260, - "x-captain-option": {"nativeName": "labels", "support": "unsupported", "note": "Captain does not forward per-request Google labels."} + "GoogleAPIFunctionResponseFileData": { + "additionalProperties": false, + "description": "URI based data for function response.\n", + "properties": { + "displayName": { + "description": "Optional. Display name of the file.\nUsed to provide a label or filename to distinguish files.\n", + "title": "Display Name", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "fileUri": { + "description": "Required. URI.\n", + "title": "File Uri", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "mimeType": { + "description": "Required. The IANA standard MIME type of the source data.\n", + "title": "Mime Type", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIFunction Response File Data", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } }, - "cachedContent": { - "title": "Cached content", "description": "Resource name of previously cached content included in the request.", - "type": "string", "readOnly": true, "x-clicky-section": "prompt", "x-clicky-order": 270, - "x-captain-option": {"nativeName": "cachedContent", "support": "unsupported", "note": "Captain does not reference provider-managed cached content."} + "GoogleAPIFunctionResponsePart": { + "additionalProperties": false, + "description": "A datatype containing media that is part of a `FunctionResponse` message.\nA `FunctionResponsePart` consists of data which has an associated datatype. A\n`FunctionResponsePart` can only contain one of the accepted types in\n`FunctionResponsePart.data`.\nA `FunctionResponsePart` must have a fixed IANA MIME type identifying the\ntype and subtype of the media if the `inline_data` field is filled with raw\nbytes.\n", + "properties": { + "fileData": { + "$ref": "#/$defs/GoogleAPIFunctionResponseFileData", + "description": "Optional. URI based data.\n", + "title": "File Data", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "inlineData": { + "$ref": "#/$defs/GoogleAPIFunctionResponseBlob", + "description": "Optional. Inline media bytes.\n", + "title": "Inline Data", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIFunction Response Part", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } }, - "responseModalities": { - "title": "Response modalities", "description": "Requested output modalities such as text, image, or audio.", - "type": "array", "items": {"type": "string"}, "readOnly": true, "x-clicky-section": "prompt", "x-clicky-order": 280, "x-array-display": "list", - "x-captain-option": {"nativeName": "responseModalities", "support": "unsupported", "note": "Captain's API runtime currently consumes text and tool response parts."} + "GoogleAPIGenerationConfigRoutingConfig": { + "additionalProperties": false, + "description": "The configuration for routing the request to a specific model. This can be used to\ncontrol which model is used for the generation, either automatically or by specifying\na model name. This data type is not supported in Gemini API.\n", + "properties": { + "autoMode": { + "$ref": "#/$defs/GoogleAPIGenerationConfigRoutingConfigAutoRoutingMode", + "description": "In this mode, the model is selected automatically based on the content of the request.\n", + "title": "Auto Mode", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "manualMode": { + "$ref": "#/$defs/GoogleAPIGenerationConfigRoutingConfigManualRoutingMode", + "description": "In this mode, the model is specified manually.\n", + "title": "Manual Mode", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIGeneration Config Routing Config", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } }, - "mediaResolution": { - "title": "Media resolution", "description": "Resolution requested when the model processes media inputs.", - "type": "string", "readOnly": true, "x-clicky-section": "prompt", "x-clicky-order": 290, - "x-captain-option": {"nativeName": "mediaResolution", "support": "unsupported", "note": "Captain does not expose media-resolution selection."} + "GoogleAPIGenerationConfigRoutingConfigAutoRoutingMode": { + "additionalProperties": false, + "description": "The configuration for automated routing. When automated routing is specified, the\nrouting will be determined by the pretrained routing model and customer provided\nmodel routing preference. This data type is not supported in Gemini API.\n", + "properties": { + "modelRoutingPreference": { + "description": "The model routing preference.\n", + "title": "Model Routing Preference", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIGeneration Config Routing Config Auto Routing Mode", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } }, - "speechConfig": { - "title": "Speech configuration", "description": "Voice and language settings used for generated speech.", - "type": "object", "additionalProperties": true, "readOnly": true, "x-clicky-section": "prompt", "x-clicky-order": 300, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "speechConfig", "support": "unsupported", "note": "Captain's API runtime does not request speech output."} + "GoogleAPIGenerationConfigRoutingConfigManualRoutingMode": { + "additionalProperties": false, + "description": "The configuration for manual routing. When manual routing is specified, the model\nwill be selected based on the model name provided. This data type is not supported\nin Gemini API.\n", + "properties": { + "modelName": { + "description": "The name of the model to use. Only public LLM models are accepted.\n", + "title": "Model Name", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIGeneration Config Routing Config Manual Routing Mode", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPIGoogleMaps": { + "additionalProperties": false, + "description": "Tool to retrieve knowledge from Google Maps.\n", + "properties": { + "authConfig": { + "$ref": "#/$defs/GoogleAPIAuthConfig", + "description": "Optional. The authentication config to access the API. Only API key is supported.\nThis field is not supported in Gemini API.\n", + "title": "Auth Config", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "enableWidget": { + "description": "Optional. Whether to return a widget context token in the GroundingMetadata of the\nresponse. Developers can use the widget context token to render a Google Maps widget\nwith geospatial context related to the places that the model references in the response.\n", + "title": "Enable Widget", + "type": "boolean", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIGoogle Maps", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPIGoogleSearch": { + "additionalProperties": false, + "description": "GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google.\n", + "properties": { + "blockingConfidence": { + "description": "Optional. Sites with confidence level chosen \u0026 above this value will be blocked from\nthe search results. This field is not supported in Gemini API.\n", + "enum": [ + "PHISH_BLOCK_THRESHOLD_UNSPECIFIED", + "BLOCK_LOW_AND_ABOVE", + "BLOCK_MEDIUM_AND_ABOVE", + "BLOCK_HIGH_AND_ABOVE", + "BLOCK_HIGHER_AND_ABOVE", + "BLOCK_VERY_HIGH_AND_ABOVE", + "BLOCK_ONLY_EXTREMELY_HIGH" + ], + "title": "Blocking Confidence", + "type": "string", + "x-clicky-order": 10, + "x-enum-display": "combobox", + "x-enum-labels": { + "BLOCK_HIGHER_AND_ABOVE": "BLOCK HIGHER AND ABOVE", + "BLOCK_HIGH_AND_ABOVE": "BLOCK HIGH AND ABOVE", + "BLOCK_LOW_AND_ABOVE": "BLOCK LOW AND ABOVE", + "BLOCK_MEDIUM_AND_ABOVE": "BLOCK MEDIUM AND ABOVE", + "BLOCK_ONLY_EXTREMELY_HIGH": "BLOCK ONLY EXTREMELY HIGH", + "BLOCK_VERY_HIGH_AND_ABOVE": "BLOCK VERY HIGH AND ABOVE", + "PHISH_BLOCK_THRESHOLD_UNSPECIFIED": "PHISH BLOCK THRESHOLD UNSPECIFIED" + }, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "excludeDomains": { + "description": "Optional. List of domains to be excluded from the search results. The default limit\nis 2000 domains. Example: [\"amazon.com\", \"facebook.com\"]. This field is not supported\nin Gemini API.\n", + "items": { + "description": "Exclude Domains value configuration. See the linked native reference for semantics and availability.", + "title": "Exclude Domains value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "title": "Exclude Domains", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "searchTypes": { + "$ref": "#/$defs/GoogleAPISearchTypes", + "description": "Optional. The set of search types to enable. If not set, web search is enabled by\ndefault.\n", + "title": "Search Types", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "timeRangeFilter": { + "$ref": "#/$defs/GoogleAPIInterval", + "description": "Optional. Filter search results to a specific time range. If customers set a start\ntime, they must set an end time (and vice versa). This field is not supported in\nVertex AI.\n", + "title": "Time Range Filter", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIGoogle Search", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPIGoogleSearchRetrieval": { + "additionalProperties": false, + "description": "Tool to retrieve public web data for grounding, powered by Google.\n", + "properties": { + "dynamicRetrievalConfig": { + "$ref": "#/$defs/GoogleAPIDynamicRetrievalConfig", + "description": "Specifies the dynamic retrieval configuration for the given source.\n", + "title": "Dynamic Retrieval Config", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIGoogle Search Retrieval", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPIHTTPOptions": { + "additionalProperties": false, + "description": "HTTP options to be used in each of the requests.\n", + "properties": { + "apiVersion": { + "description": "Optional. APIVersion specifies the version of the API to use. If empty, defaults\nto \"v1beta\" for Gemini API and \"v1beta1\" for Gemini Enterprise Agent Platform.\n", + "title": "API Version", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "baseUrl": { + "description": "Optional. BaseURL specifies the base URL for the API endpoint. If empty, defaults\nto \"https://generativelanguage.googleapis.com/\" for the Gemini API backend, and location-specific\nGemini Enterprise Agent Platform endpoint (e.g., \"https://us-central1-aiplatform.googleapis.com/\n", + "title": "Base Url", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "baseUrlResourceScope": { + "description": "Optional. BaseURL specifies the base URL for the API endpoint. If empty, defaults\nto \"https://generativelanguage.googleapis.com/\" for the Gemini API backend, and location-specific\nGemini Enterprise Agent Platform endpoint (e.g., \"https://us-central1-aiplatform.googleapis.com/\n", + "enum": [ + "COLLECTION" + ], + "title": "Base Url Resource Scope", + "type": "string", + "x-clicky-order": 30, + "x-enum-display": "segmented", + "x-enum-labels": { + "COLLECTION": "COLLECTION" + }, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "extraBody": { + "additionalProperties": { + "description": "Extra Body value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Extra Body value", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "description": "Optional. Extra parameters to add to the request body.\nThe structure must match the backend API's request structure.\n - Gemini Enterprise Agent Platform backend API docs: https://cloud.google.com/vertex-ai/docs/reference/rest\n - GeminiAPI backend API docs: https://ai.google.dev/api/rest\n", + "title": "Extra Body", + "type": "object", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "headers": { + "additionalProperties": { + "description": "Headers value configuration. See the linked native reference for semantics and availability.", + "items": { + "description": "Headers value value configuration. See the linked native reference for semantics and availability.", + "title": "Headers value value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "title": "Headers value", + "type": "array", + "x-array-display": "list", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "description": "Optional. Additional HTTP headers to be sent with the request.\n", + "title": "Headers", + "type": "object", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "timeout": { + "description": "Optional. Timeout for the request in milliseconds.\n", + "title": "Timeout", + "type": "integer", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIHTTPOptions", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPIImageConfig": { + "additionalProperties": false, + "description": "The image generation configuration to be used in GenerateContentConfig.\n", + "properties": { + "aspectRatio": { + "description": "Optional. Aspect ratio of the generated images. Supported values are\n\"1:1\", \"2:3\", \"3:2\", \"3:4\", \"4:3\", \"9:16\", \"16:9\", and \"21:9\".\n", + "title": "Aspect Ratio", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "imageOutputOptions": { + "$ref": "#/$defs/GoogleAPIImageConfigImageOutputOptions", + "description": "Optional. The image output format for generated images. This field is not supported\nin Gemini API.\n", + "title": "Image Output Options", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "imageSize": { + "description": "Optional. Specifies the size of generated images. Supported\nvalues are `1K`, `2K`, `4K`. If not specified, the model will use default\nvalue `1K`.\n", + "title": "Image Size", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "outputCompressionQuality": { + "description": "Optional. Compression quality of the generated image (for\n``image/jpeg`` only). This field is not supported in Gemini API.\n", + "title": "Output Compression Quality", + "type": "integer", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "outputMimeType": { + "description": "Optional. MIME type of the generated image. This field is not\nsupported in Gemini API.\n", + "title": "Output Mime Type", + "type": "string", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "personGeneration": { + "description": "Optional. Controls the generation of people. Supported values are:\nALLOW_ALL, ALLOW_ADULT, ALLOW_NONE.\n", + "title": "Person Generation", + "type": "string", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "prominentPeople": { + "description": "Optional. Controls whether prominent people (celebrities) generation is allowed.\nIf used with personGeneration, personGeneration enum would take precedence. For instance,\nif ALLOW_NONE is set, all person generation would be blocked. If this field is unspecified,\nthe default behavior is to allow prominent people. This field is not supported in\nGemini API.\n", + "enum": [ + "PROMINENT_PEOPLE_UNSPECIFIED", + "ALLOW_PROMINENT_PEOPLE", + "BLOCK_PROMINENT_PEOPLE" + ], + "title": "Prominent People", + "type": "string", + "x-clicky-order": 70, + "x-enum-display": "segmented", + "x-enum-labels": { + "ALLOW_PROMINENT_PEOPLE": "ALLOW PROMINENT PEOPLE", + "BLOCK_PROMINENT_PEOPLE": "BLOCK PROMINENT PEOPLE", + "PROMINENT_PEOPLE_UNSPECIFIED": "PROMINENT PEOPLE UNSPECIFIED" + }, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIImage Config", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPIImageConfigImageOutputOptions": { + "additionalProperties": false, + "description": "The image output format for generated images. This data type is not supported in\nGemini API.\n", + "properties": { + "compressionQuality": { + "description": "Optional. The compression quality of the output image.\n", + "title": "Compression Quality", + "type": "integer", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "mimeType": { + "description": "Optional. The image format that the output should be saved as.\n", + "title": "Mime Type", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIImage Config Image Output Options", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPIImageSearch": { + "additionalProperties": false, + "description": "Image search for grounding and related configurations.\n", + "properties": {}, + "title": "Google APIImage Search", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPIInterval": { + "additionalProperties": false, + "description": "Represents a time interval, encoded as a Timestamp start (inclusive) and a Timestamp\nend (exclusive). The start must be less than or equal to the end. When the start\nequals the end, the interval is empty (matches no time). When both start and end\nare unspecified, the interval matches any time.\n", + "properties": { + "endTime": { + "description": "Optional. Exclusive end of the interval. If specified, a Timestamp matching this\ninterval will have to be before the end.\n", + "format": "date-time", + "title": "End Time", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "startTime": { + "description": "Optional. Inclusive start of the interval. If specified, a Timestamp matching this\ninterval will have to be the same or after the start.\n", + "format": "date-time", + "title": "Start Time", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIInterval", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPILatLng": { + "additionalProperties": false, + "description": "An object that represents a latitude/longitude pair.\nThis is expressed as a pair of doubles to represent degrees latitude and\ndegrees longitude. Unless specified otherwise, this object must conform to the\n\u003ca href=\"https://en.wikipedia.org/wiki/World_Geodetic_System#1984_version\"\u003e\nWGS84 standard\u003c/a\u003e. Values must be within normalized ranges.\n", + "properties": { + "latitude": { + "description": "Optional. The latitude in degrees. It must be in the range [-90.0, +90.0].\n", + "title": "Latitude", + "type": "number", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "longitude": { + "description": "Optional. The longitude in degrees. It must be in the range [-180.0, +180.0]\n", + "title": "Longitude", + "type": "number", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APILat Lng", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPIMCPServer": { + "additionalProperties": false, + "description": "A MCPServer is a server that can be called by the model to perform actions. It is\na server that implements the MCP protocol. Next ID: 5. This data type is not supported\nin Vertex AI.\n", + "properties": { + "name": { + "description": "The name of the MCPServer.\n", + "title": "Name", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "streamableHttpTransport": { + "$ref": "#/$defs/GoogleAPIStreamableHTTPTransport", + "description": "A transport that can stream HTTP requests and responses.\n", + "title": "Streamable HTTP Transport", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIMCPServer", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPIModelArmorConfig": { + "additionalProperties": false, + "description": "Configuration for Model Armor. Model Armor is a Google Cloud service that provides\nsafety and security filtering for prompts and responses. It helps protect your AI\napplications from risks such as harmful content, sensitive data leakage, and prompt\ninjection attacks. This data type is not supported in Gemini API.\n", + "properties": { + "promptTemplateName": { + "description": "Optional. The resource name of the Model Armor template to use for prompt screening.\nA Model Armor template is a set of customized filters and thresholds that define\nhow Model Armor screens content. If specified, Model Armor will use this template\nto check the user's prompt for safety and security risks before it is sent to the\nmodel. The name must be in the format `projects/{project}/locations/{location}/templates/{template}`.\n", + "title": "Prompt Template Name", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "responseTemplateName": { + "description": "Optional. The resource name of the Model Armor template to use for response screening.\nA Model Armor template is a set of customized filters and thresholds that define\nhow Model Armor screens content. If specified, Model Armor will use this template\nto check the model's response for safety and security risks before it is returned\nto the user. The name must be in the format `projects/{project}/locations/{location}/templates/{template}`.\n", + "title": "Response Template Name", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIModel Armor Config", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPIModelSelectionConfig": { + "additionalProperties": false, + "description": "Config for model selection.\n", + "properties": { + "featureSelectionPreference": { + "description": "Optional. Options for feature selection preference.\n", + "enum": [ + "FEATURE_SELECTION_PREFERENCE_UNSPECIFIED", + "PRIORITIZE_QUALITY", + "BALANCED", + "PRIORITIZE_COST" + ], + "title": "Feature Selection Preference", + "type": "string", + "x-clicky-order": 10, + "x-enum-display": "segmented", + "x-enum-labels": { + "BALANCED": "BALANCED", + "FEATURE_SELECTION_PREFERENCE_UNSPECIFIED": "FEATURE SELECTION PREFERENCE UNSPECIFIED", + "PRIORITIZE_COST": "PRIORITIZE COST", + "PRIORITIZE_QUALITY": "PRIORITIZE QUALITY" + }, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIModel Selection Config", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPIMultiSpeakerVoiceConfig": { + "additionalProperties": false, + "description": "Configuration for a multi-speaker text-to-speech request.\n", + "properties": { + "speakerVoiceConfigs": { + "description": "Required. A list of configurations for the voices of the speakers. Exactly two speaker\nvoice configurations must be provided.\n", + "items": { + "$ref": "#/$defs/GoogleAPISpeakerVoiceConfig", + "description": "Speaker Voice Configs value configuration. See the linked native reference for semantics and availability.", + "title": "Speaker Voice Configs value", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "title": "Speaker Voice Configs", + "type": "array", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIMulti Speaker Voice Config", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPIPart": { + "additionalProperties": false, + "description": "A datatype containing media content.\nExactly one field within a Part should be set, representing the specific type\nof content being conveyed. Using multiple fields within the same `Part`\ninstance is considered invalid.\n", + "properties": { + "codeExecutionResult": { + "$ref": "#/$defs/GoogleAPICodeExecutionResult", + "description": "Optional. The result of executing the ExecutableCode.\n", + "title": "Code Execution Result", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "executableCode": { + "$ref": "#/$defs/GoogleAPIExecutableCode", + "description": "Optional. Code generated by the model that is intended to be executed.\n", + "title": "Executable Code", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "fileData": { + "$ref": "#/$defs/GoogleAPIFileData", + "description": "Optional. The URI-based data of the part. This can be used to include files from\nGoogle Cloud Storage.\n", + "title": "File Data", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "functionCall": { + "$ref": "#/$defs/GoogleAPIFunctionCall", + "description": "Optional. A predicted [FunctionCall] returned from the model that contains a string\nrepresenting the [FunctionDeclaration.Name] with the parameters and their values.\n", + "title": "Function Call", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "functionResponse": { + "$ref": "#/$defs/GoogleAPIFunctionResponse", + "description": "Optional. The result output of a [FunctionCall] that contains a string representing\nthe [FunctionDeclaration.Name] and a structured JSON object containing any output\nfrom the function call. It is used as context to the model.\n", + "title": "Function Response", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "inlineData": { + "$ref": "#/$defs/GoogleAPIBlob", + "description": "Optional. The inline data content of the part. This can be used to include images,\naudio, or video in a request.\n", + "title": "Inline Data", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "mediaResolution": { + "$ref": "#/$defs/GoogleAPIPartMediaResolution", + "description": "Optional. Media resolution for the input media.\n", + "title": "Media Resolution", + "x-clicky-order": 70, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "partMetadata": { + "additionalProperties": { + "description": "Part Metadata value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Part Metadata value", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "description": "Custom metadata associated with the Part. Agents using genai.Part as content representation\nmay need to keep track of the additional information. For example it can be name\nof a file/source from which the Part originates or a way to multiplex multiple Part\nstreams. This field is not supported in Vertex AI.\n", + "title": "Part Metadata", + "type": "object", + "x-clicky-order": 80, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "text": { + "description": "Optional. The text content of the part. When sent from the VSCode Gemini Code Assist\nextension, references to @mentioned items will be converted to markdown boldface\ntext. For example `@my-repo` will be converted to and sent as `**my-repo**` by the\nIDE agent.\n", + "title": "Text", + "type": "string", + "x-clicky-order": 90, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "thought": { + "description": "Optional. Indicates whether the `part` represents the model's thought process or\nreasoning.\n", + "title": "Thought", + "type": "boolean", + "x-clicky-order": 100, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "thoughtSignature": { + "contentEncoding": "base64", + "description": "Optional. An opaque signature for the thought so it can be reused in subsequent requests.\n", + "title": "Thought Signature", + "type": "string", + "x-clicky-order": 110, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "toolCall": { + "$ref": "#/$defs/GoogleAPIToolCall", + "description": "Optional. Server-side tool call. This field is populated when the model predicts\na tool invocation that should be executed on the server. The client is expected to\necho this message back to the API.\n", + "title": "Tool Call", + "x-clicky-order": 120, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "toolResponse": { + "$ref": "#/$defs/GoogleAPIToolResponse", + "description": "Optional. The output from a server-side ToolCall execution. This field is populated\nby the client with the results of executing the corresponding ToolCall.\n", + "title": "Tool Response", + "x-clicky-order": 130, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "videoMetadata": { + "$ref": "#/$defs/GoogleAPIVideoMetadata", + "description": "Optional. Video metadata. The metadata should only be specified while the video data\nis presented in inline_data or file_data.\n", + "title": "Video Metadata", + "x-clicky-order": 140, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIPart", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPIPartMediaResolution": { + "additionalProperties": false, + "description": "Media resolution for the input media.\n", + "properties": { + "level": { + "description": "Optional. The tokenization quality used for given media.\n", + "enum": [ + "MEDIA_RESOLUTION_UNSPECIFIED", + "MEDIA_RESOLUTION_LOW", + "MEDIA_RESOLUTION_MEDIUM", + "MEDIA_RESOLUTION_HIGH", + "MEDIA_RESOLUTION_ULTRA_HIGH" + ], + "title": "Level", + "type": "string", + "x-clicky-order": 10, + "x-enum-display": "combobox", + "x-enum-labels": { + "MEDIA_RESOLUTION_HIGH": "MEDIA RESOLUTION HIGH", + "MEDIA_RESOLUTION_LOW": "MEDIA RESOLUTION LOW", + "MEDIA_RESOLUTION_MEDIUM": "MEDIA RESOLUTION MEDIUM", + "MEDIA_RESOLUTION_ULTRA_HIGH": "MEDIA RESOLUTION ULTRA HIGH", + "MEDIA_RESOLUTION_UNSPECIFIED": "MEDIA RESOLUTION UNSPECIFIED" + }, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "numTokens": { + "description": "Optional. Specifies the required sequence length for media tokenization.\n", + "title": "Num Tokens", + "type": "integer", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIPart Media Resolution", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPIPartialArg": { + "additionalProperties": false, + "description": "Partial argument value of the function call. This data type is not supported in Gemini\nAPI.\n", + "properties": { + "boolValue": { + "description": "Optional. Represents a boolean value.\n", + "title": "Bool Value", + "type": "boolean", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "jsonPath": { + "description": "Required. A JSON Path (RFC 9535) to the argument being streamed. https://datatracker.ietf.org/doc/html/rfc9535.\ne.g. \"$.foo.bar[0].data\".\n", + "title": "JSON Path", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "nullValue": { + "description": "Optional. Represents a NULL value.\n", + "title": "Null Value", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "numberValue": { + "description": "Optional. Represents a double value.\n", + "title": "Number Value", + "type": "number", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "stringValue": { + "description": "Optional. Represents a string value.\n", + "title": "String Value", + "type": "string", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "willContinue": { + "description": "Optional. Whether this is not the last part of the same json_path. If true, another\nPartialArg message for the current json_path is expected to follow.\n", + "title": "Will Continue", + "type": "boolean", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIPartial Arg", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPIPrebuiltVoiceConfig": { + "additionalProperties": false, + "description": "Configuration for a prebuilt voice.\n", + "properties": { + "voiceName": { + "description": "The name of the prebuilt voice to use.\n", + "title": "Voice Name", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIPrebuilt Voice Config", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPIRAGRetrievalConfig": { + "additionalProperties": false, + "description": "Specifies the context retrieval config. This data type is not supported in Gemini\nAPI.\n", + "properties": { + "filter": { + "$ref": "#/$defs/GoogleAPIRAGRetrievalConfigFilter", + "description": "Optional. Config for filters.\n", + "title": "Filter", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "hybridSearch": { + "$ref": "#/$defs/GoogleAPIRAGRetrievalConfigHybridSearch", + "description": "Optional. Config for Hybrid Search.\n", + "title": "Hybrid Search", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "ranking": { + "$ref": "#/$defs/GoogleAPIRAGRetrievalConfigRanking", + "description": "Optional. Config for ranking and reranking.\n", + "title": "Ranking", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "topK": { + "description": "Optional. The number of contexts to retrieve.\n", + "title": "Top K", + "type": "integer", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIRAGRetrieval Config", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPIRAGRetrievalConfigFilter": { + "additionalProperties": false, + "description": "Config for filters. This data type is not supported in Gemini API.\n", + "properties": { + "metadataFilter": { + "description": "Optional. String for metadata filtering.\n", + "title": "Metadata Filter", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "vectorDistanceThreshold": { + "description": "Optional. Only returns contexts with vector distance smaller than the threshold.\n", + "title": "Vector Distance Threshold", + "type": "number", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "vectorSimilarityThreshold": { + "description": "Optional. Only returns contexts with vector similarity larger than the threshold.\n", + "title": "Vector Similarity Threshold", + "type": "number", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIRAGRetrieval Config Filter", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPIRAGRetrievalConfigHybridSearch": { + "additionalProperties": false, + "description": "Config for Hybrid Search. This data type is not supported in Gemini API.\n", + "properties": { + "alpha": { + "description": "Optional. Alpha value controls the weight between dense and sparse vector search\nresults. The range is [0, 1], while 0 means sparse vector search only and 1 means\ndense vector search only. The default value is 0.5 which balances sparse and dense\nvector search equally.\n", + "title": "Alpha", + "type": "number", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIRAGRetrieval Config Hybrid Search", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPIRAGRetrievalConfigRanking": { + "additionalProperties": false, + "description": "Config for ranking and reranking. This data type is not supported in Gemini API.\n", + "properties": { + "llmRanker": { + "$ref": "#/$defs/GoogleAPIRAGRetrievalConfigRankingLlmRanker", + "description": "Optional. Config for LlmRanker.\n", + "title": "Llm Ranker", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "rankService": { + "$ref": "#/$defs/GoogleAPIRAGRetrievalConfigRankingRankService", + "description": "Optional. Config for Rank Service.\n", + "title": "Rank Service", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIRAGRetrieval Config Ranking", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPIRAGRetrievalConfigRankingLlmRanker": { + "additionalProperties": false, + "description": "Config for LlmRanker. This data type is not supported in Gemini API.\n", + "properties": { + "modelName": { + "description": "Optional. The model name used for ranking. See [Supported models](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/inference#supported-models).\n", + "title": "Model Name", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIRAGRetrieval Config Ranking Llm Ranker", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPIRAGRetrievalConfigRankingRankService": { + "additionalProperties": false, + "description": "Config for Rank Service. This data type is not supported in Gemini API.\n", + "properties": { + "modelName": { + "description": "Optional. The model name of the rank service. Format: `semantic-ranker-512@latest`\n", + "title": "Model Name", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIRAGRetrieval Config Ranking Rank Service", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPIReplicatedVoiceConfig": { + "additionalProperties": false, + "description": "The configuration for the replicated voice to use.\n", + "properties": { + "mimeType": { + "description": "Optional. The mimetype of the voice sample. The only currently supported\nvalue is `audio/wav`. This represents 16-bit signed little-endian wav\ndata, with a 24kHz sampling rate.\n", + "title": "Mime Type", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "voiceSampleAudio": { + "contentEncoding": "base64", + "description": "Optional. The sample of the custom voice.\n", + "title": "Voice Sample Audio", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIReplicated Voice Config", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPIRetrieval": { + "additionalProperties": false, + "description": "Defines a retrieval tool that model can call to access external knowledge. This data\ntype is not supported in Gemini API.\n", + "properties": { + "disableAttribution": { + "description": "Optional. Deprecated. This option is no longer supported.\n", + "title": "Disable Attribution", + "type": "boolean", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "externalApi": { + "$ref": "#/$defs/GoogleAPIExternalAPI", + "description": "Use data source powered by external API for grounding.\n", + "title": "External API", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "vertexAiSearch": { + "$ref": "#/$defs/GoogleAPIVertexAISearch", + "description": "Set to use data source powered by Vertex AI Search.\n", + "title": "Vertex Ai Search", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "vertexRagStore": { + "$ref": "#/$defs/GoogleAPIVertexRAGStore", + "description": "Set to use data source powered by Vertex RAG store. User data is uploaded via the\nVertexRAGDataService.\n", + "title": "Vertex Rag Store", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIRetrieval", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPIRetrievalConfig": { + "additionalProperties": false, + "description": "Retrieval config.\n", + "properties": { + "languageCode": { + "description": "The language code of the user.\n", + "title": "Language Code", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "latLng": { + "$ref": "#/$defs/GoogleAPILatLng", + "description": "Optional. The location of the user.\n", + "title": "Lat Lng", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIRetrieval Config", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPISafetySetting": { + "additionalProperties": false, + "description": "A safety setting that affects the safety-blocking behavior. A SafetySetting consists\nof a harm category and a threshold for that category.\n", + "properties": { + "category": { + "description": "Required. The harm category to be blocked.\n", + "enum": [ + "HARM_CATEGORY_UNSPECIFIED", + "HARM_CATEGORY_HARASSMENT", + "HARM_CATEGORY_HATE_SPEECH", + "HARM_CATEGORY_SEXUALLY_EXPLICIT", + "HARM_CATEGORY_DANGEROUS_CONTENT", + "HARM_CATEGORY_CIVIC_INTEGRITY", + "HARM_CATEGORY_IMAGE_HATE", + "HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT", + "HARM_CATEGORY_IMAGE_HARASSMENT", + "HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT", + "HARM_CATEGORY_JAILBREAK" + ], + "title": "Category", + "type": "string", + "x-clicky-order": 10, + "x-enum-display": "combobox", + "x-enum-labels": { + "HARM_CATEGORY_CIVIC_INTEGRITY": "HARM CATEGORY CIVIC INTEGRITY", + "HARM_CATEGORY_DANGEROUS_CONTENT": "HARM CATEGORY DANGEROUS CONTENT", + "HARM_CATEGORY_HARASSMENT": "HARM CATEGORY HARASSMENT", + "HARM_CATEGORY_HATE_SPEECH": "HARM CATEGORY HATE SPEECH", + "HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT": "HARM CATEGORY IMAGE DANGEROUS CONTENT", + "HARM_CATEGORY_IMAGE_HARASSMENT": "HARM CATEGORY IMAGE HARASSMENT", + "HARM_CATEGORY_IMAGE_HATE": "HARM CATEGORY IMAGE HATE", + "HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT": "HARM CATEGORY IMAGE SEXUALLY EXPLICIT", + "HARM_CATEGORY_JAILBREAK": "HARM CATEGORY JAILBREAK", + "HARM_CATEGORY_SEXUALLY_EXPLICIT": "HARM CATEGORY SEXUALLY EXPLICIT", + "HARM_CATEGORY_UNSPECIFIED": "HARM CATEGORY UNSPECIFIED" + }, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "method": { + "description": "Optional. The method for blocking content. If not specified, the default behavior\nis to use the probability score. This field is not supported in Gemini API.\n", + "enum": [ + "HARM_BLOCK_METHOD_UNSPECIFIED", + "SEVERITY", + "PROBABILITY" + ], + "title": "Method", + "type": "string", + "x-clicky-order": 20, + "x-enum-display": "segmented", + "x-enum-labels": { + "HARM_BLOCK_METHOD_UNSPECIFIED": "HARM BLOCK METHOD UNSPECIFIED", + "PROBABILITY": "PROBABILITY", + "SEVERITY": "SEVERITY" + }, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "threshold": { + "description": "Required. The threshold for blocking content. If the harm probability exceeds this\nthreshold, the content will be blocked.\n", + "enum": [ + "HARM_BLOCK_THRESHOLD_UNSPECIFIED", + "BLOCK_LOW_AND_ABOVE", + "BLOCK_MEDIUM_AND_ABOVE", + "BLOCK_ONLY_HIGH", + "BLOCK_NONE", + "OFF" + ], + "title": "Threshold", + "type": "string", + "x-clicky-order": 30, + "x-enum-display": "combobox", + "x-enum-labels": { + "BLOCK_LOW_AND_ABOVE": "BLOCK LOW AND ABOVE", + "BLOCK_MEDIUM_AND_ABOVE": "BLOCK MEDIUM AND ABOVE", + "BLOCK_NONE": "BLOCK NONE", + "BLOCK_ONLY_HIGH": "BLOCK ONLY HIGH", + "HARM_BLOCK_THRESHOLD_UNSPECIFIED": "HARM BLOCK THRESHOLD UNSPECIFIED", + "OFF": "OFF" + }, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APISafety Setting", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPISchema": { + "additionalProperties": false, + "description": "Schema is used to define the format of input/output data.\nRepresents a select subset of an [OpenAPI 3.0 schema\nobject](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may\nbe added in the future as needed.\nYou can find more details and examples at https://spec.openapis.org/oas/v3.0.3.html#schema-object\n", + "properties": { + "anyOf": { + "description": "Optional. The instance must be valid against any (one or more) of the subschemas\nlisted in `any_of`.\n", + "items": { + "$ref": "#/$defs/GoogleAPISchema", + "description": "Any Of value configuration. See the linked native reference for semantics and availability.", + "title": "Any Of value", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "title": "Any Of", + "type": "array", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "default": { + "description": "Optional. Default value to use if the field is not specified.\n", + "format": "json", + "title": "Default", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "description": { + "description": "Optional. Describes the data. The model uses this field to understand the purpose\nof the schema and how to use it. It is a best practice to provide a clear and descriptive\nexplanation for the schema and its properties here, rather than in the prompt.\n", + "title": "Description", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "enum": { + "description": "Optional. Possible values of the field. This field can be used to restrict a value\nto a fixed set of values. To mark a field as an enum, set `format` to `enum` and\nprovide the list of possible values in `enum`. For example: 1. To define directions:\n`{type:STRING, format:enum, enum:[\"EAST\", \"NORTH\", \"SOUTH\", \"WEST\"]}` 2. To define\napartment numbers: `{type:INTEGER, format:enum, enum:[\"101\", \"201\", \"301\"]}`\n", + "items": { + "description": "Enum value configuration. See the linked native reference for semantics and availability.", + "title": "Enum value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "title": "Enum", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "example": { + "description": "Optional. Example of an instance of this schema.\n", + "format": "json", + "title": "Example", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "format": { + "description": "Optional. The format of the data. For `NUMBER` type, format can be `float` or `double`.\nFor `INTEGER` type, format can be `int32` or `int64`. For `STRING` type, format can\nbe `email`, `byte`, `date`, `date-time`, `password`, and other formats to further\nrefine the data type.\n", + "title": "Format", + "type": "string", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "items": { + "$ref": "#/$defs/GoogleAPISchema", + "description": "Optional. If type is `ARRAY`, `items` specifies the schema of elements in the array.\n", + "title": "Items", + "x-clicky-order": 70, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "maxItems": { + "description": "Optional. If type is `ARRAY`, `max_items` specifies the maximum number of items in\nan array.\n", + "title": "Max Items", + "type": "integer", + "x-clicky-order": 80, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "maxLength": { + "description": "Optional. If type is `STRING`, `max_length` specifies the maximum length of the string.\n", + "title": "Max Length", + "type": "integer", + "x-clicky-order": 90, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "maxProperties": { + "description": "Optional. If type is `OBJECT`, `max_properties` specifies the maximum number of properties\nthat can be provided.\n", + "title": "Max Properties", + "type": "integer", + "x-clicky-order": 100, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "maximum": { + "description": "Optional. If type is `INTEGER` or `NUMBER`, `maximum` specifies the maximum allowed\nvalue.\n", + "title": "Maximum", + "type": "number", + "x-clicky-order": 110, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "minItems": { + "description": "Optional. If type is `ARRAY`, `min_items` specifies the minimum number of items in\nan array.\n", + "title": "Min Items", + "type": "integer", + "x-clicky-order": 120, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "minLength": { + "description": "Optional. If type is `STRING`, `min_length` specifies the minimum length of the string.\n", + "title": "Min Length", + "type": "integer", + "x-clicky-order": 130, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "minProperties": { + "description": "Optional. If type is `OBJECT`, `min_properties` specifies the minimum number of properties\nthat can be provided.\n", + "title": "Min Properties", + "type": "integer", + "x-clicky-order": 140, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "minimum": { + "description": "Optional. Minimum value of the Type.INTEGER and Type.NUMBER.\n", + "title": "Minimum", + "type": "number", + "x-clicky-order": 150, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "nullable": { + "description": "Optional. Indicates if the value of this field can be null.\n", + "title": "Nullable", + "type": "boolean", + "x-clicky-order": 160, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "pattern": { + "description": "Optional. If type is `STRING`, `pattern` specifies a regular expression that the\nstring must match.\n", + "title": "Pattern", + "type": "string", + "x-clicky-order": 170, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "properties": { + "additionalProperties": { + "$ref": "#/$defs/GoogleAPISchema", + "description": "Properties value configuration. See the linked native reference for semantics and availability.", + "title": "Properties value", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "description": "Optional. If type is `OBJECT`, `properties` is a map of property names to schema\ndefinitions for each property of the object.\n", + "title": "Properties", + "type": "object", + "x-clicky-order": 180, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "propertyOrdering": { + "description": "Optional. Order of properties displayed or used where order matters. This is not\na standard field in OpenAPI specification, but can be used to control the order of\nproperties.\n", + "items": { + "description": "Property Ordering value configuration. See the linked native reference for semantics and availability.", + "title": "Property Ordering value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "title": "Property Ordering", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 190, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "required": { + "description": "Optional. If type is `OBJECT`, `required` lists the names of properties that must\nbe present.\n", + "items": { + "description": "Required value configuration. See the linked native reference for semantics and availability.", + "title": "Required value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "title": "Required", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 200, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "title": { + "description": "Optional. Title for the schema.\n", + "title": "Title", + "type": "string", + "x-clicky-order": 210, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Optional. Data type of the schema field.\n", + "enum": [ + "TYPE_UNSPECIFIED", + "STRING", + "NUMBER", + "INTEGER", + "BOOLEAN", + "ARRAY", + "OBJECT", + "NULL" + ], + "title": "Type", + "type": "string", + "x-clicky-order": 220, + "x-enum-display": "combobox", + "x-enum-labels": { + "ARRAY": "ARRAY", + "BOOLEAN": "BOOLEAN", + "INTEGER": "INTEGER", + "NULL": "NULL", + "NUMBER": "NUMBER", + "OBJECT": "OBJECT", + "STRING": "STRING", + "TYPE_UNSPECIFIED": "TYPE UNSPECIFIED" + }, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "required" + ], + "title": "Google APISchema", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPISearchTypes": { + "additionalProperties": false, + "description": "Different types of search that can be enabled on the GoogleSearch tool.\n", + "properties": { + "imageSearch": { + "$ref": "#/$defs/GoogleAPIImageSearch", + "description": "Optional. Setting this field enables image search. Image bytes are returned.\n", + "title": "Image Search", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "webSearch": { + "$ref": "#/$defs/GoogleAPIWebSearch", + "description": "Optional. Setting this field enables web search. Only text results are returned.\n", + "title": "Web Search", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APISearch Types", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPISpeakerVoiceConfig": { + "additionalProperties": false, + "description": "Configuration for a single speaker in a multi-speaker setup.\n", + "properties": { + "speaker": { + "description": "Required. The name of the speaker. This should be the same as the speaker name used\nin the prompt.\n", + "title": "Speaker", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "voiceConfig": { + "$ref": "#/$defs/GoogleAPIVoiceConfig", + "description": "Required. The configuration for the voice of this speaker.\n", + "title": "Voice Config", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APISpeaker Voice Config", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPISpeechConfig": { + "additionalProperties": false, + "description": "Config for speech generation and transcription.\n", + "properties": { + "languageCode": { + "description": "Optional. The language code (ISO 639-1) for the speech synthesis.\n", + "title": "Language Code", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "multiSpeakerVoiceConfig": { + "$ref": "#/$defs/GoogleAPIMultiSpeakerVoiceConfig", + "description": "The configuration for a multi-speaker text-to-speech request. This field is mutually\nexclusive with `voice_config`.\n", + "title": "Multi Speaker Voice Config", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "voiceConfig": { + "$ref": "#/$defs/GoogleAPIVoiceConfig", + "description": "Optional. The configuration in case of single-voice output.\n", + "title": "Voice Config", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APISpeech Config", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPIStreamableHTTPTransport": { + "additionalProperties": false, + "description": "A transport that can stream HTTP requests and responses. Next ID: 6. This data type\nis not supported in Vertex AI.\n", + "properties": { + "headers": { + "additionalProperties": { + "description": "Headers value configuration. See the linked native reference for semantics and availability.", + "title": "Headers value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "description": "Optional. Optional: Fields for authentication headers, timeouts, etc., if needed.\n", + "title": "Headers", + "type": "object", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "sseReadTimeout": { + "description": "Timeout for SSE read operations.\n", + "title": "Sse Read Timeout", + "type": "integer", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "terminateOnClose": { + "description": "Whether to close the client session when the transport closes.\n", + "title": "Terminate On Close", + "type": "boolean", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "timeout": { + "description": "HTTP timeout for regular operations.\n", + "title": "Timeout", + "type": "integer", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "The full URL for the MCPServer endpoint. Example: \"https://api.example.com/mcp\".\n", + "title": "Url", + "type": "string", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIStreamable HTTPTransport", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPIThinkingConfig": { + "additionalProperties": false, + "description": "The thinking features configuration.\n", + "properties": { + "includeThoughts": { + "description": "Optional. Indicates whether to include thoughts in the response. If true, thoughts\nare returned only if the model supports thought and thoughts are available.\n", + "title": "Include Thoughts", + "type": "boolean", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "thinkingBudget": { + "description": "Optional. Indicates the thinking budget in tokens.\n", + "title": "Thinking Budget", + "type": "integer", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "thinkingLevel": { + "description": "Optional. The number of thoughts tokens that the model should generate.\n", + "enum": [ + "THINKING_LEVEL_UNSPECIFIED", + "MINIMAL", + "LOW", + "MEDIUM", + "HIGH" + ], + "title": "Thinking Level", + "type": "string", + "x-clicky-order": 30, + "x-enum-display": "combobox", + "x-enum-labels": { + "HIGH": "HIGH", + "LOW": "LOW", + "MEDIUM": "MEDIUM", + "MINIMAL": "MINIMAL", + "THINKING_LEVEL_UNSPECIFIED": "THINKING LEVEL UNSPECIFIED" + }, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIThinking Config", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPITool": { + "additionalProperties": false, + "description": "Tool details of a tool that the model may use to generate a response.\n", + "properties": { + "codeExecution": { + "$ref": "#/$defs/GoogleAPIToolCodeExecution", + "description": "Optional. CodeExecution tool type. Enables the model to execute code as part of generation.\n", + "title": "Code Execution", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "computerUse": { + "$ref": "#/$defs/GoogleAPIComputerUse", + "description": "Optional. Tool to support the model interacting directly with the\ncomputer. If enabled, it automatically populates computer-use specific\nFunction Declarations.\n", + "title": "Computer Use", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "enterpriseWebSearch": { + "$ref": "#/$defs/GoogleAPIEnterpriseWebSearch", + "description": "Optional. Tool to support searching public web data, powered by Vertex AI Search\nand Sec4 compliance. This field is not supported in Gemini API.\n", + "title": "Enterprise Web Search", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "fileSearch": { + "$ref": "#/$defs/GoogleAPIFileSearch", + "description": "Optional. FileSearch tool type. Tool to retrieve knowledge from Semantic Retrieval\ncorpora. This field is not supported in Vertex AI.\n", + "title": "File Search", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "functionDeclarations": { + "description": "Optional. Function tool type. One or more function declarations to be passed to the\nmodel along with the current user query. Model may decide to call a subset of these\nfunctions by populating FunctionCall in the response. User should provide a FunctionResponse\nfor each function call in the next turn. Based on the function responses, Model will\ngenerate the final response back to the user. Maximum 512 function declarations can\nbe provided.\n", + "items": { + "$ref": "#/$defs/GoogleAPIFunctionDeclaration", + "description": "Function Declarations value configuration. See the linked native reference for semantics and availability.", + "title": "Function Declarations value", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "title": "Function Declarations", + "type": "array", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "googleMaps": { + "$ref": "#/$defs/GoogleAPIGoogleMaps", + "description": "Optional. Tool that allows grounding the model's response with\ngeospatial context related to the user's query.\n", + "title": "Google Maps", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "googleSearch": { + "$ref": "#/$defs/GoogleAPIGoogleSearch", + "description": "Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered\nby Google.\n", + "title": "Google Search", + "x-clicky-order": 70, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "googleSearchRetrieval": { + "$ref": "#/$defs/GoogleAPIGoogleSearchRetrieval", + "description": "Optional. Specialized retrieval tool that is powered by Google Search.\n", + "title": "Google Search Retrieval", + "x-clicky-order": 80, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "mcpServers": { + "description": "Optional. MCP Servers to connect to. This field is not supported in Vertex AI.\n", + "items": { + "$ref": "#/$defs/GoogleAPIMCPServer", + "description": "MCP Servers value configuration. See the linked native reference for semantics and availability.", + "title": "MCP Servers value", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "title": "MCP Servers", + "type": "array", + "x-clicky-order": 90, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "parallelAiSearch": { + "$ref": "#/$defs/GoogleAPIToolParallelAISearch", + "description": "Optional. If specified, Vertex AI will use Parallel.ai to search for information\nto answer user queries. The search results will be grounded on Parallel.ai and presented\nto the model for response generation. This field is not supported in Gemini API.\n", + "title": "Parallel Ai Search", + "x-clicky-order": 100, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "retrieval": { + "$ref": "#/$defs/GoogleAPIRetrieval", + "description": "Optional. Retrieval tool type. System will always execute the provided retrieval\ntool(s) to get external knowledge to answer the prompt. Retrieval results are presented\nto the model for generation. This field is not supported in Gemini API.\n", + "title": "Retrieval", + "x-clicky-order": 110, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "urlContext": { + "$ref": "#/$defs/GoogleAPIURLContext", + "description": "Optional. Tool to support URL context retrieval.\n", + "title": "Url Context", + "x-clicky-order": 120, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APITool", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPIToolCall": { + "additionalProperties": false, + "description": "A predicted server-side `ToolCall` returned from the model.\nThis message contains information about a tool that the model wants to invoke.\nThe client is NOT expected to execute this `ToolCall`. Instead, the\nclient should pass this `ToolCall` back to the API in a subsequent turn\nwithin a `Content` message, along with the corresponding `ToolResponse`.\n", + "properties": { + "args": { + "additionalProperties": { + "description": "Args value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Args value", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "description": "Optional. The tool call arguments. Example: {\"arg1\": \"value1\", \"arg2\": \"value2\"}.\n", + "title": "Args", + "type": "object", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "id": { + "description": "Optional. Unique identifier of the tool call. The server returns the tool response\nwith the matching `id`.\n", + "title": "Id", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "toolType": { + "description": "Optional. The type of tool that was called.\n", + "enum": [ + "TOOL_TYPE_UNSPECIFIED", + "GOOGLE_SEARCH_WEB", + "GOOGLE_SEARCH_IMAGE", + "URL_CONTEXT", + "GOOGLE_MAPS", + "FILE_SEARCH" + ], + "title": "Tool Type", + "type": "string", + "x-clicky-order": 30, + "x-enum-display": "combobox", + "x-enum-labels": { + "FILE_SEARCH": "FILE SEARCH", + "GOOGLE_MAPS": "GOOGLE MAPS", + "GOOGLE_SEARCH_IMAGE": "GOOGLE SEARCH IMAGE", + "GOOGLE_SEARCH_WEB": "GOOGLE SEARCH WEB", + "TOOL_TYPE_UNSPECIFIED": "TOOL TYPE UNSPECIFIED", + "URL_CONTEXT": "URL CONTEXT" + }, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APITool Call", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPIToolCodeExecution": { + "additionalProperties": false, + "description": "Tool that executes code generated by the model, and automatically returns the result\nto the model. See also [ExecutableCode]and [CodeExecutionResult] which are input\nand output to this tool. This data type is not supported in Gemini API.\n", + "properties": {}, + "title": "Google APITool Code Execution", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPIToolConfig": { + "additionalProperties": false, + "description": "Tool config.\nThis config is shared for all tools provided in the request.\n", + "properties": { + "functionCallingConfig": { + "$ref": "#/$defs/GoogleAPIFunctionCallingConfig", + "description": "Optional. Function calling config.\n", + "title": "Function Calling Config", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "includeServerSideToolInvocations": { + "description": "Optional. If true, the API response will include the server-side tool calls and responses\nwithin the `Content` message. This allows clients to observe the server's tool invocations.\n", + "title": "Include Server Side Tool Invocations", + "type": "boolean", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "retrievalConfig": { + "$ref": "#/$defs/GoogleAPIRetrievalConfig", + "description": "Optional. Retrieval config.\n", + "title": "Retrieval Config", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APITool Config", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPIToolParallelAISearch": { + "additionalProperties": false, + "description": "ParallelAISearch tool type. A tool that uses the Parallel.ai search engine for grounding.\nThis data type is not supported in Gemini API.\n", + "properties": { + "apiKey": { + "description": "Optional. The API key for ParallelAISearch. If an API key is not provided, the system\nwill attempt to verify access by checking for an active Parallel.ai subscription\nthrough the Google Cloud Marketplace. See https://docs.parallel.ai/search/search-quickstart\nfor more details.\n", + "title": "API Key", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "customConfigs": { + "additionalProperties": { + "description": "Custom Configs value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Custom Configs value", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "description": "Optional. Custom configs for ParallelAISearch. This field can be used to pass any\nparameter from the Parallel.ai Search API. See the Parallel.ai documentation for\nthe full list of available parameters and their usage: https://docs.parallel.ai/api-reference/search-beta/search\nCurrently only `source_policy`, `excerpts`, `max_results`, `mode`, `fetch_policy`\ncan be set via this field. For example: { \"source_policy\": { \"include_domains\": [\"google.com\",\n\"wikipedia.org\"], \"exclude_domains\": [\"example.com\"] }, \"fetch_policy\": { \"max_age_seconds\":\n3600 } }\n", + "title": "Custom Configs", + "type": "object", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APITool Parallel AISearch", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPIToolResponse": { + "additionalProperties": false, + "description": "The output from a server-side `ToolCall` execution.\nThis message contains the results of a tool invocation that was initiated by a\n`ToolCall` from the model. The client should pass this `ToolResponse` back to\nthe API in a subsequent turn within a `Content` message, along with the\ncorresponding `ToolCall`.\n", + "properties": { + "id": { + "description": "Optional. The identifier of the tool call this response is for.\n", + "title": "Id", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "response": { + "additionalProperties": { + "description": "Response value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Response value", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "description": "Optional. The tool response.\n", + "title": "Response", + "type": "object", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "toolType": { + "description": "Optional. The type of tool that was called, matching the tool_type in the corresponding\nToolCall.\n", + "enum": [ + "TOOL_TYPE_UNSPECIFIED", + "GOOGLE_SEARCH_WEB", + "GOOGLE_SEARCH_IMAGE", + "URL_CONTEXT", + "GOOGLE_MAPS", + "FILE_SEARCH" + ], + "title": "Tool Type", + "type": "string", + "x-clicky-order": 30, + "x-enum-display": "combobox", + "x-enum-labels": { + "FILE_SEARCH": "FILE SEARCH", + "GOOGLE_MAPS": "GOOGLE MAPS", + "GOOGLE_SEARCH_IMAGE": "GOOGLE SEARCH IMAGE", + "GOOGLE_SEARCH_WEB": "GOOGLE SEARCH WEB", + "TOOL_TYPE_UNSPECIFIED": "TOOL TYPE UNSPECIFIED", + "URL_CONTEXT": "URL CONTEXT" + }, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APITool Response", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPIURLContext": { + "additionalProperties": false, + "description": "Tool to support URL context.\n", + "properties": {}, + "title": "Google APIURLContext", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPIVertexAISearch": { + "additionalProperties": false, + "description": "Retrieve from Vertex AI Search datastore or engine for grounding. datastore and engine\nare mutually exclusive. See https://cloud.google.com/products/agent-builder. This\ndata type is not supported in Gemini API.\n", + "properties": { + "dataStoreSpecs": { + "description": "Specifications that define the specific DataStores to be searched, along with configurations\nfor those data stores. This is only considered for Engines with multiple data stores.\nIt should only be set if engine is used.\n", + "items": { + "$ref": "#/$defs/GoogleAPIVertexAISearchDataStoreSpec", + "description": "Data Store Specs value configuration. See the linked native reference for semantics and availability.", + "title": "Data Store Specs value", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "title": "Data Store Specs", + "type": "array", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "datastore": { + "description": "Optional. Fully-qualified Vertex AI Search data store resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}`\n", + "title": "Datastore", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "engine": { + "description": "Optional. Fully-qualified Vertex AI Search engine resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}`\n", + "title": "Engine", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "filter": { + "description": "Optional. Filter strings to be passed to the search API.\n", + "title": "Filter", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "maxResults": { + "description": "Optional. Number of search results to return per query. The default value is 10.\nThe maximumm allowed value is 10.\n", + "title": "Max Results", + "type": "integer", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIVertex AISearch", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPIVertexAISearchDataStoreSpec": { + "additionalProperties": false, + "description": "Define data stores within engine to filter on in a search call and configurations\nfor those data stores. For more information, see https://cloud.google.com/generative-ai-app-builder/docs/reference/rpc/google.cloud.discoveryengine.v1#datastorespec.\nThis data type is not supported in Gemini API.\n", + "properties": { + "dataStore": { + "description": "Full resource name of DataStore, such as Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}`\n", + "title": "Data Store", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "filter": { + "description": "Optional. Filter specification to filter documents in the data store specified by\ndata_store field. For more information on filtering, see [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)\n", + "title": "Filter", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIVertex AISearch Data Store Spec", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } }, + "GoogleAPIVertexRAGStore": { + "additionalProperties": false, + "description": "Retrieve from Vertex RAG Store for grounding. This data type is not supported in\nGemini API. You can find API default values and more details at https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/rag-api-v1#parameters-list\n", + "properties": { + "ragCorpora": { + "description": "Optional. Deprecated. Please use rag_resources instead.\n", + "items": { + "description": "Rag Corpora value configuration. See the linked native reference for semantics and availability.", + "title": "Rag Corpora value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "title": "Rag Corpora", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "ragResources": { + "description": "Optional. The representation of the RAG source. It can be used to specify corpus\nonly or ragfiles. Currently only support one corpus or multiple files from one corpus.\nIn the future we may open up multiple corpora support.\n", + "items": { + "$ref": "#/$defs/GoogleAPIVertexRAGStoreRAGResource", + "description": "Rag Resources value configuration. See the linked native reference for semantics and availability.", + "title": "Rag Resources value", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "title": "Rag Resources", + "type": "array", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "ragRetrievalConfig": { + "$ref": "#/$defs/GoogleAPIRAGRetrievalConfig", + "description": "Optional. The retrieval config for the RAG query.\n", + "title": "Rag Retrieval Config", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "similarityTopK": { + "description": "Optional. Number of top k results to return from the selected corpora.\n", + "title": "Similarity Top K", + "type": "integer", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "storeContext": { + "description": "Optional. Currently only supported for Gemini Multimodal Live API. In Gemini Multimodal\nLive API, if `store_context` bool is specified, Gemini will leverage it to automatically\nmemorize the interactions between the client and Gemini, and retrieve context when\nneeded to augment the response generation for users' ongoing and future interactions.\n", + "title": "Store Context", + "type": "boolean", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "vectorDistanceThreshold": { + "description": "Optional. Only return results with vector distance smaller than the threshold.\n", + "title": "Vector Distance Threshold", + "type": "number", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIVertex RAGStore", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPIVertexRAGStoreRAGResource": { + "additionalProperties": false, + "description": "The definition of the RAG resource. This data type is not supported in Gemini API.\n", + "properties": { + "ragCorpus": { + "description": "Optional. RAGCorpora resource name. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`\n", + "title": "Rag Corpus", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "ragFileIds": { + "description": "Optional. rag_file_id. The files should be in the same rag_corpus set in rag_corpus\nfield.\n", + "items": { + "description": "Rag File Ids value configuration. See the linked native reference for semantics and availability.", + "title": "Rag File Ids value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "title": "Rag File Ids", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIVertex RAGStore RAGResource", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPIVideoMetadata": { + "additionalProperties": false, + "description": "Provides metadata for a video, including the start and end offsets for clipping and\nthe frame rate.\n", + "properties": { + "endOffset": { + "description": "Optional. The end offset of the video.\n", + "title": "End Offset", + "type": "integer", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "fps": { + "description": "Optional. The frame rate of the video sent to the model. If not specified, the default\nvalue is 1.0. The valid range is (0.0, 24.0].\n", + "title": "Fps", + "type": "number", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "startOffset": { + "description": "Optional. The start offset of the video.\n", + "title": "Start Offset", + "type": "integer", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIVideo Metadata", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPIVoiceConfig": { + "additionalProperties": false, + "description": "The configuration for the voice to use.\n", + "properties": { + "prebuiltVoiceConfig": { + "$ref": "#/$defs/GoogleAPIPrebuiltVoiceConfig", + "description": "The configuration for a prebuilt voice.\n", + "title": "Prebuilt Voice Config", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "replicatedVoiceConfig": { + "$ref": "#/$defs/GoogleAPIReplicatedVoiceConfig", + "description": "Optional. The configuration for a replicated voice, which is a clone of a\nuser's voice that can be used for speech synthesis. If this is unset, a\ndefault voice is used.\n", + "title": "Replicated Voice Config", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "title": "Google APIVoice Config", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "GoogleAPIWebSearch": { + "additionalProperties": false, + "description": "Standard web search for grounding and related configurations. Only text results are\nreturned.\n", + "properties": {}, + "title": "Google APIWeb Search", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + } + }, + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "description": "Native Google Gen AI GenerateContent arguments and configuration used by Captain's API runtime.", + "properties": { "audioTimestamp": { - "title": "Audio timestamp", "description": "Whether timestamps are requested for audio input or output.", - "type": "boolean", "readOnly": true, "x-clicky-section": "prompt", "x-clicky-order": 310, - "x-captain-option": {"nativeName": "audioTimestamp", "support": "unsupported", "note": "Captain does not expose Google audio timestamps."} + "description": "Whether timestamps are requested for audio input or output.", + "readOnly": true, + "title": "Audio timestamp", + "type": "boolean", + "x-captain-option": { + "nativeName": "audioTimestamp", + "note": "Captain does not expose Google audio timestamps.", + "support": "unsupported" + }, + "x-clicky-order": 310, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } }, - "imageConfig": { - "title": "Image configuration", "description": "Generation options for image response modalities.", - "type": "object", "additionalProperties": true, "readOnly": true, "x-clicky-section": "prompt", "x-clicky-order": 320, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "imageConfig", "support": "unsupported", "note": "Captain's API runtime does not request generated images."} + "cachedContent": { + "description": "Resource name of previously cached content included in the request.", + "readOnly": true, + "title": "Cached content", + "type": "string", + "x-captain-option": { + "nativeName": "cachedContent", + "note": "Captain does not reference provider-managed cached content.", + "support": "unsupported" + }, + "x-clicky-order": 270, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "candidateCount": { + "const": 1, + "description": "Number of candidate responses requested from the model.", + "readOnly": true, + "title": "Candidate count", + "type": "integer", + "x-captain-option": { + "nativeName": "candidateCount", + "note": "Captain requests exactly one candidate so each execution has one canonical response.", + "support": "managed" + }, + "x-clicky-order": 90, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "contents": { + "description": "Conversation parts, user input, attachments, and tool results sent to the model.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "items": { + "$ref": "#/$defs/GoogleAPIContent", + "description": "Contents value configuration. See the linked native reference for semantics and availability.", + "title": "Contents value", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "title": "Contents", + "type": "array", + "x-array-display": "stacked", + "x-captain-option": { + "nativeName": "contents", + "specPath": [ + "messages", + "prompt.user", + "prompt.attachments", + "toolApproval" + ], + "support": "mapped" + }, + "x-clicky-order": 20, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } }, "enableEnhancedCivicAnswers": { - "title": "Enhanced civic answers", "description": "Whether enhanced civic-information answers are enabled.", - "type": "boolean", "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 330, - "x-captain-option": {"nativeName": "enableEnhancedCivicAnswers", "support": "unsupported", "note": "Captain does not expose this Google search behavior."} + "description": "Whether enhanced civic-information answers are enabled.", + "readOnly": true, + "title": "Enhanced civic answers", + "type": "boolean", + "x-captain-option": { + "nativeName": "enableEnhancedCivicAnswers", + "note": "Captain does not expose this Google search behavior.", + "support": "unsupported" + }, + "x-clicky-order": 330, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "frequencyPenalty": { + "description": "Penalty scaled by how often a token has appeared in generated text.", + "readOnly": true, + "title": "Frequency penalty", + "type": "number", + "x-captain-option": { + "nativeName": "frequencyPenalty", + "note": "Captain has no native frequency-penalty Spec field.", + "support": "unsupported" + }, + "x-clicky-order": 200, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "httpOptions": { + "$ref": "#/$defs/GoogleAPIHTTPOptions", + "description": "Per-request HTTP transport and API version settings.", + "readOnly": true, + "title": "HTTP options", + "x-captain-option": { + "nativeName": "httpOptions", + "note": "Captain configures the SDK client rather than exposing per-request transport overrides.", + "support": "unsupported" + }, + "x-clicky-order": 130, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "imageConfig": { + "$ref": "#/$defs/GoogleAPIImageConfig", + "description": "Generation options for image response modalities.", + "readOnly": true, + "title": "Image configuration", + "x-captain-option": { + "nativeName": "imageConfig", + "note": "Captain's API runtime does not request generated images.", + "support": "unsupported" + }, + "x-clicky-order": 320, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "labels": { + "additionalProperties": { + "description": "Labels value configuration. See the linked native reference for semantics and availability.", + "title": "Labels value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "description": "String key-value labels attached to the request for billing and reporting.", + "readOnly": true, + "title": "Labels", + "type": "object", + "x-captain-option": { + "nativeName": "labels", + "note": "Captain does not forward per-request Google labels.", + "support": "unsupported" + }, + "x-clicky-order": 260, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "logprobs": { + "description": "Number of top token log probabilities returned per decoding step.", + "minimum": 0, + "readOnly": true, + "title": "Log probabilities", + "type": "integer", + "x-captain-option": { + "nativeName": "logprobs", + "note": "Captain does not expose Google log-probability controls.", + "support": "unsupported" + }, + "x-clicky-order": 180, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "maxOutputTokens": { + "description": "Maximum number of tokens generated in the response.", + "minimum": 1, + "title": "Maximum output tokens", + "type": "integer", + "x-captain-option": { + "nativeName": "maxOutputTokens", + "specPath": "budget.maxTokens", + "support": "mapped" + }, + "x-clicky-order": 50, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "mediaResolution": { + "description": "Resolution requested when the model processes media inputs.", + "enum": [ + "MEDIA_RESOLUTION_UNSPECIFIED", + "MEDIA_RESOLUTION_LOW", + "MEDIA_RESOLUTION_MEDIUM", + "MEDIA_RESOLUTION_HIGH" + ], + "readOnly": true, + "title": "Media resolution", + "type": "string", + "x-captain-option": { + "nativeName": "mediaResolution", + "note": "Captain does not expose media-resolution selection.", + "support": "unsupported" + }, + "x-clicky-order": 290, + "x-clicky-section": "prompt", + "x-enum-display": "segmented", + "x-enum-labels": { + "MEDIA_RESOLUTION_HIGH": "MEDIA RESOLUTION HIGH", + "MEDIA_RESOLUTION_LOW": "MEDIA RESOLUTION LOW", + "MEDIA_RESOLUTION_MEDIUM": "MEDIA RESOLUTION MEDIUM", + "MEDIA_RESOLUTION_UNSPECIFIED": "MEDIA RESOLUTION UNSPECIFIED" + }, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "model": { + "description": "Google model identifier passed to GenerateContent.", + "minLength": 1, + "title": "Model", + "type": "string", + "x-captain-option": { + "nativeName": "model", + "specPath": "model.name", + "support": "mapped" + }, + "x-clicky-order": 10, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + }, + "x-icon": "sparkles" }, "modelArmorConfig": { - "title": "Model Armor configuration", "description": "Model Armor template and filtering behavior applied to the request.", - "type": "object", "additionalProperties": true, "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 340, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "modelArmorConfig", "support": "unsupported", "note": "Captain does not expose per-request Model Armor configuration."} + "$ref": "#/$defs/GoogleAPIModelArmorConfig", + "description": "Model Armor template and filtering behavior applied to the request.", + "readOnly": true, + "title": "Model Armor configuration", + "x-captain-option": { + "nativeName": "modelArmorConfig", + "note": "Captain does not expose per-request Model Armor configuration.", + "support": "unsupported" + }, + "x-clicky-order": 340, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "modelSelectionConfig": { + "$ref": "#/$defs/GoogleAPIModelSelectionConfig", + "description": "Constraints used by automatic model selection.", + "readOnly": true, + "title": "Model selection configuration", + "x-captain-option": { + "nativeName": "modelSelectionConfig", + "note": "Captain's registry selects a concrete model before execution.", + "support": "unsupported" + }, + "x-clicky-order": 240, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "presencePenalty": { + "description": "Penalty applied when a token has appeared in the generated text.", + "readOnly": true, + "title": "Presence penalty", + "type": "number", + "x-captain-option": { + "nativeName": "presencePenalty", + "note": "Captain has no native presence-penalty Spec field.", + "support": "unsupported" + }, + "x-clicky-order": 190, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "responseJsonSchema": { + "description": "Raw JSON Schema constraining generated JSON output.", + "format": "json", + "readOnly": true, + "title": "Response JSON Schema", + "x-captain-option": { + "nativeName": "responseJsonSchema", + "note": "Captain's Genkit adapter converts structured output through responseSchema.", + "support": "unsupported" + }, + "x-clicky-order": 220, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "responseLogprobs": { + "description": "Whether token log probabilities are included in the response.", + "readOnly": true, + "title": "Response log probabilities", + "type": "boolean", + "x-captain-option": { + "nativeName": "responseLogprobs", + "note": "Captain does not request token log probabilities.", + "support": "unsupported" + }, + "x-clicky-order": 170, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "responseMimeType": { + "description": "MIME type requested for structured or plain-text output.", + "title": "Response MIME type", + "type": "string", + "x-captain-option": { + "nativeName": "responseMimeType", + "specPath": [ + "prompt.schema", + "prompt.schemaJson" + ], + "support": "mapped" + }, + "x-clicky-order": 70, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "responseModalities": { + "description": "Requested output modalities such as text, image, or audio.", + "items": { + "description": "Response Modalities value configuration. See the linked native reference for semantics and availability.", + "title": "Response Modalities value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "readOnly": true, + "title": "Response modalities", + "type": "array", + "x-array-display": "list", + "x-captain-option": { + "nativeName": "responseModalities", + "note": "Captain's API runtime currently consumes text and tool response parts.", + "support": "unsupported" + }, + "x-clicky-order": 280, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "responseSchema": { + "$ref": "#/$defs/GoogleAPISchema", + "description": "Google schema constraining a structured response.", + "title": "Response schema", + "x-captain-option": { + "nativeName": "responseSchema", + "specPath": [ + "prompt.schema", + "prompt.schemaJson" + ], + "support": "mapped" + }, + "x-clicky-order": 80, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "routingConfig": { + "$ref": "#/$defs/GoogleAPIGenerationConfigRoutingConfig", + "description": "Model routing behavior for supported Google endpoints.", + "readOnly": true, + "title": "Routing configuration", + "x-captain-option": { + "nativeName": "routingConfig", + "note": "Captain resolves one concrete model before calling the provider.", + "support": "unsupported" + }, + "x-clicky-order": 230, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "safetySettings": { + "description": "Per-category content safety thresholds applied to the request.", + "items": { + "$ref": "#/$defs/GoogleAPISafetySetting", + "description": "Safety Settings value configuration. See the linked native reference for semantics and availability.", + "title": "Safety Settings value", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "readOnly": true, + "title": "Safety settings", + "type": "array", + "x-array-display": "stacked", + "x-captain-option": { + "nativeName": "safetySettings", + "note": "Captain does not expose per-request Google safety thresholds.", + "support": "unsupported" + }, + "x-clicky-order": 250, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "seed": { + "description": "Fixed sampling seed used for best-effort deterministic generation.", + "readOnly": true, + "title": "Seed", + "type": "integer", + "x-captain-option": { + "nativeName": "seed", + "note": "Captain does not expose a generation seed.", + "support": "unsupported" + }, + "x-clicky-order": 210, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } }, "serviceTier": { - "title": "Service tier", "description": "Google processing tier used for the request.", - "type": "string", "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 350, - "x-captain-option": {"nativeName": "serviceTier", "support": "unsupported", "note": "Captain does not select a Google service tier."} + "description": "Google processing tier used for the request.", + "enum": [ + "unspecified", + "flex", + "standard", + "priority" + ], + "readOnly": true, + "title": "Service tier", + "type": "string", + "x-captain-option": { + "nativeName": "serviceTier", + "note": "Captain does not select a Google service tier.", + "support": "unsupported" + }, + "x-clicky-order": 350, + "x-clicky-section": "model", + "x-enum-display": "segmented", + "x-enum-labels": { + "flex": "Flex", + "priority": "Priority", + "standard": "Standard", + "unspecified": "Unspecified" + }, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "speechConfig": { + "$ref": "#/$defs/GoogleAPISpeechConfig", + "description": "Voice and language settings used for generated speech.", + "readOnly": true, + "title": "Speech configuration", + "x-captain-option": { + "nativeName": "speechConfig", + "note": "Captain's API runtime does not request speech output.", + "support": "unsupported" + }, + "x-clicky-order": 300, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "stopSequences": { + "description": "Text sequences that stop generation when encountered.", + "items": { + "description": "Stop Sequences value configuration. See the linked native reference for semantics and availability.", + "title": "Stop Sequences value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "readOnly": true, + "title": "Stop sequences", + "type": "array", + "x-array-display": "list", + "x-captain-option": { + "nativeName": "stopSequences", + "note": "Captain has no stop-sequence Spec field.", + "support": "unsupported" + }, + "x-clicky-order": 160, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "stream": { + "const": true, + "description": "Whether GenerateContent returns a stream of response chunks.", + "readOnly": true, + "title": "Stream", + "type": "boolean", + "x-captain-option": { + "nativeName": "stream", + "note": "Captain selects the streaming generation method for ExecuteStream.", + "support": "managed" + }, + "x-clicky-order": 120, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "systemInstruction": { + "$ref": "#/$defs/GoogleAPIContent", + "description": "System instruction content supplied separately from the conversation.", + "title": "System instruction", + "x-captain-option": { + "nativeName": "systemInstruction", + "specPath": "prompt.system", + "support": "mapped" + }, + "x-clicky-order": 30, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "temperature": { + "description": "Sampling temperature used for response generation.", + "maximum": 2, + "minimum": 0, + "title": "Temperature", + "type": "number", + "x-captain-option": { + "nativeName": "temperature", + "specPath": "model.temperature", + "support": "mapped" + }, + "x-clicky-order": 40, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "thinkingConfig": { + "$ref": "#/$defs/GoogleAPIThinkingConfig", + "description": "Thinking budget and inclusion settings for reasoning-capable Gemini models.", + "title": "Thinking configuration", + "x-captain-option": { + "nativeName": "thinkingConfig", + "specPath": "model.effort", + "support": "mapped" + }, + "x-clicky-order": 60, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "toolConfig": { + "$ref": "#/$defs/GoogleAPIToolConfig", + "description": "Native policy controlling Google function-calling behavior.", + "readOnly": true, + "title": "Tool configuration", + "x-captain-option": { + "nativeName": "toolConfig", + "note": "Captain derives the function-calling policy from its tool loop.", + "support": "managed" + }, + "x-clicky-order": 110, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "tools": { + "description": "Native Google tool declarations derived from Captain caller tools.", + "items": { + "$ref": "#/$defs/GoogleAPITool", + "description": "Tools value configuration. See the linked native reference for semantics and availability.", + "title": "Tools value", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "readOnly": true, + "title": "Tools", + "type": "array", + "x-array-display": "stacked", + "x-captain-option": { + "nativeName": "tools", + "note": "Captain converts runtime Config.Tools into provider-native function declarations.", + "support": "managed" + }, + "x-clicky-order": 100, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "topK": { + "description": "Number of highest-probability tokens retained during sampling.", + "minimum": 0, + "readOnly": true, + "title": "Top K", + "type": "number", + "x-captain-option": { + "nativeName": "topK", + "note": "Captain has no native top-k Spec field.", + "support": "unsupported" + }, + "x-clicky-order": 150, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } + }, + "topP": { + "description": "Cumulative probability mass retained during nucleus sampling.", + "maximum": 1, + "minimum": 0, + "readOnly": true, + "title": "Top P", + "type": "number", + "x-captain-option": { + "nativeName": "topP", + "note": "Captain has no native top-p Spec field.", + "support": "unsupported" + }, + "x-clicky-order": 140, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] + } } + }, + "required": [ + "model", + "contents" + ], + "title": "Google API options", + "type": "object", + "x-captain-adapter": { + "mode": "api", + "provider": "google", + "sources": [ + { + "kind": "sdk", + "reference": "google.golang.org/genai.GenerateContentConfig", + "version": "v1.57.0" + }, + { + "kind": "official-docs", + "reference": "https://googleapis.github.io/js-genai/release_docs/interfaces/types.GenerateContentConfig.html", + "version": "retrieved 2026-09-11" + }, + { + "kind": "implementation", + "reference": "pkg/ai/provider/genkit/options.go and firebase/genkit plugins/googlegenai", + "version": "6a2b56cbd26702b18905865f21fc66d44cc864cc" + } + ] + }, + "x-captain-inventory": { + "sourceType": "genai.GenerateContentConfig", + "version": "google.golang.org/genai v1.57.0" + }, + "x-help": { + "links": [ + { + "href": "https://ai.google.dev/api/generate-content", + "label": "Documentation" + } + ] } } diff --git a/pkg/adapters/google/cli.schema.json b/pkg/adapters/google/cli.schema.json index 8a53c34a..72f479a3 100644 --- a/pkg/adapters/google/cli.schema.json +++ b/pkg/adapters/google/cli.schema.json @@ -1,170 +1,903 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "GoogleCLIOptions", - "description": "Native Gemini CLI arguments used by Captain's Google CLI runtime.", - "type": "object", "additionalProperties": false, - "x-captain-adapter": { - "provider": "google", - "mode": "cli", - "sources": [ - {"kind": "cli-help", "reference": "gemini --help", "version": "0.50.0"}, - {"kind": "implementation", "reference": "pkg/ai/provider/gemini_cli.go", "version": "6a2b56cbd26702b18905865f21fc66d44cc864cc"} - ] - }, + "description": "Native Gemini CLI arguments used by Captain's Google CLI runtime.", "properties": { - "prompt": { - "title": "Prompt", "description": "Composed prompt text written to Gemini standard input.", - "type": "string", "x-clicky-section": "prompt", "x-clicky-order": 10, - "x-captain-option": {"nativeName": "stdin", "support": "mapped", "specPath": ["prompt.system", "prompt.appendSystem", "prompt.user"]} - }, - "model": { - "title": "Model", "description": "Gemini model identifier used for the request.", - "type": "string", "x-clicky-section": "model", "x-clicky-order": 20, "x-icon": "sparkles", - "x-captain-option": {"nativeName": "--model", "support": "mapped", "specPath": "model.name"} - }, - "approvalMode": { - "title": "Approval mode", "description": "Gemini tool-approval posture translated from Captain policy.", - "type": "string", "enum": ["default", "auto_edit", "yolo", "plan"], "x-clicky-section": "permissions", "x-clicky-order": 30, "x-enum-display": "segmented", - "x-captain-option": {"nativeName": "--approval-mode", "support": "mapped", "specPath": "permissions.mode"} + "acceptRawOutputRisk": { + "description": "Explicit acknowledgement required before raw output is enabled.", + "readOnly": true, + "title": "Accept raw output risk", + "type": "boolean", + "x-captain-option": { + "nativeName": "--accept-raw-output-risk", + "note": "Captain does not enable raw terminal output.", + "support": "unsupported" + }, + "x-clicky-order": 280, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://geminicli.com/docs/reference/configuration/", + "label": "Documentation" + } + ] + } }, - "outputFormat": { - "title": "Output format", "description": "Format used for Gemini CLI output.", - "type": "string", "const": "stream-json", "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 40, - "x-captain-option": {"nativeName": "--output-format", "support": "managed", "note": "Captain requires stream-json for typed event parsing."} + "acp": { + "description": "Whether Gemini runs as an Agent Client Protocol server.", + "readOnly": true, + "title": "ACP mode", + "type": "boolean", + "x-captain-option": { + "nativeName": "--acp", + "note": "Captain integrates with Gemini through stream-json rather than ACP.", + "support": "unsupported" + }, + "x-clicky-order": 140, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://geminicli.com/docs/reference/configuration/", + "label": "Documentation" + } + ] + } }, - "debug": { - "title": "Debug", "description": "Whether Gemini CLI debug logging is enabled.", - "type": "boolean", "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 50, - "x-captain-option": {"nativeName": "--debug", "support": "unsupported", "note": "Captain does not expose Gemini CLI debug logging."} + "adminPolicy": { + "description": "Additional administrator policy files applied by Gemini CLI.", + "items": { + "description": "Admin Policy value configuration. See the linked native reference for semantics and availability.", + "format": "path", + "title": "Admin Policy value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://geminicli.com/docs/reference/configuration/", + "label": "Documentation" + } + ] + } + }, + "readOnly": true, + "title": "Admin policy", + "type": "array", + "x-array-display": "list", + "x-captain-option": { + "nativeName": "--admin-policy", + "note": "Captain does not expose Gemini administrator policy files.", + "support": "unsupported" + }, + "x-clicky-order": 130, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://geminicli.com/docs/reference/configuration/", + "label": "Documentation" + } + ] + } }, - "promptFlag": { - "title": "Prompt flag", "description": "Prompt text supplied directly by the --prompt flag.", - "type": "string", "readOnly": true, "x-clicky-section": "prompt", "x-clicky-order": 60, - "x-captain-option": {"nativeName": "--prompt", "support": "unsupported", "note": "Captain writes the composed prompt to standard input."} + "allowedMcpServerNames": { + "description": "MCP server names allowed to connect in ACP mode.", + "items": { + "description": "Allowed Mcp Server Names value configuration. See the linked native reference for semantics and availability.", + "title": "Allowed Mcp Server Names value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://geminicli.com/docs/reference/configuration/", + "label": "Documentation" + } + ] + } + }, + "readOnly": true, + "title": "Allowed MCP servers", + "type": "array", + "x-array-display": "list", + "x-captain-option": { + "nativeName": "--allowed-mcp-server-names", + "note": "Captain does not configure Gemini ACP MCP servers.", + "support": "unsupported" + }, + "x-clicky-order": 160, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://geminicli.com/docs/reference/configuration/", + "label": "Documentation" + } + ] + } }, - "promptInteractive": { - "title": "Interactive prompt", "description": "Initial prompt followed by an interactive Gemini session.", - "type": "string", "readOnly": true, "x-clicky-section": "prompt", "x-clicky-order": 70, - "x-captain-option": {"nativeName": "--prompt-interactive", "support": "unsupported", "note": "Captain runs Gemini headlessly for one request."} + "allowedTools": { + "description": "Deprecated list of tools allowed to execute without confirmation.", + "items": { + "description": "Allowed Tools value configuration. See the linked native reference for semantics and availability.", + "title": "Allowed Tools value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://geminicli.com/docs/reference/configuration/", + "label": "Documentation" + } + ] + } + }, + "readOnly": true, + "title": "Allowed tools", + "type": "array", + "x-array-display": "list", + "x-captain-option": { + "nativeName": "--allowed-tools", + "note": "Gemini marks this flag deprecated; Captain rejects tool policies the adapter cannot represent.", + "support": "unsupported" + }, + "x-clicky-order": 170, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://geminicli.com/docs/reference/configuration/", + "label": "Documentation" + } + ] + } }, - "skipTrust": { - "title": "Skip trust check", "description": "Whether Gemini skips workspace trust validation.", - "type": "boolean", "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 80, - "x-captain-option": {"nativeName": "--skip-trust", "support": "unsupported", "note": "Captain does not bypass Gemini workspace trust checks."} + "approvalMode": { + "description": "Gemini tool-approval posture translated from Captain policy.", + "enum": [ + "default", + "auto_edit", + "yolo", + "plan" + ], + "title": "Approval mode", + "type": "string", + "x-captain-option": { + "nativeName": "--approval-mode", + "specPath": "permissions.mode", + "support": "mapped" + }, + "x-clicky-order": 30, + "x-clicky-section": "permissions", + "x-enum-display": "segmented", + "x-enum-labels": { + "auto_edit": "Auto edit", + "default": "Default", + "plan": "Plan", + "yolo": "Yolo" + }, + "x-help": { + "links": [ + { + "href": "https://geminicli.com/docs/reference/configuration/", + "label": "Documentation" + } + ] + } }, - "worktree": { - "title": "Worktree", "description": "Whether Gemini creates and runs in a Git worktree.", - "oneOf": [{"type": "boolean"}, {"type": "string"}], "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 90, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "--worktree", "support": "unsupported", "note": "Captain executes in the working directory supplied by its context."} + "debug": { + "description": "Whether Gemini CLI debug logging is enabled.", + "readOnly": true, + "title": "Debug", + "type": "boolean", + "x-captain-option": { + "nativeName": "--debug", + "note": "Captain does not expose Gemini CLI debug logging.", + "support": "unsupported" + }, + "x-clicky-order": 50, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://geminicli.com/docs/reference/configuration/", + "label": "Documentation" + } + ] + } }, - "sandbox": { - "title": "Sandbox", "description": "Whether Gemini enables its native sandbox, optionally with a sandbox image.", - "oneOf": [{"type": "boolean"}, {"type": "string"}], "readOnly": true, "x-clicky-section": "sandbox", "x-clicky-order": 100, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "--sandbox", "support": "unsupported", "note": "Captain rejects native sandbox mode for the Gemini CLI adapter."} + "deleteSession": { + "description": "Stored Gemini session index deleted before exit.", + "minimum": 0, + "readOnly": true, + "title": "Delete session", + "type": "integer", + "x-captain-option": { + "nativeName": "--delete-session", + "note": "Captain never deletes provider sessions as part of execution.", + "support": "unsupported" + }, + "x-clicky-order": 240, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://geminicli.com/docs/reference/configuration/", + "label": "Documentation" + } + ] + } }, - "yolo": { - "title": "YOLO mode", "description": "Whether Gemini automatically approves every tool action.", - "type": "boolean", "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 110, - "x-captain-option": {"nativeName": "--yolo", "support": "unsupported", "note": "Captain maps explicit bypass and dontAsk policies through --approval-mode yolo."} + "experimentalAcp": { + "description": "Whether Gemini enables experimental Agent Client Protocol behavior.", + "readOnly": true, + "title": "Experimental ACP mode", + "type": "boolean", + "x-captain-option": { + "nativeName": "--experimental-acp", + "note": "Captain does not use Gemini's experimental ACP server.", + "support": "unsupported" + }, + "x-clicky-order": 150, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://geminicli.com/docs/reference/configuration/", + "label": "Documentation" + } + ] + } }, - "policy": { - "title": "Policy files", "description": "Policy files applied by Gemini CLI.", - "type": "array", "items": {"type": "string", "format": "path"}, "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 120, "x-array-display": "list", - "x-captain-option": {"nativeName": "--policy", "support": "unsupported", "note": "Captain does not expose Gemini policy files."} + "extensions": { + "description": "Gemini CLI extensions enabled for the session.", + "items": { + "description": "Extensions value configuration. See the linked native reference for semantics and availability.", + "title": "Extensions value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://geminicli.com/docs/reference/configuration/", + "label": "Documentation" + } + ] + } + }, + "readOnly": true, + "title": "Extensions", + "type": "array", + "x-array-display": "list", + "x-captain-option": { + "nativeName": "--extensions", + "note": "Captain does not select Gemini CLI extensions.", + "support": "unsupported" + }, + "x-clicky-order": 180, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://geminicli.com/docs/reference/configuration/", + "label": "Documentation" + } + ] + } }, - "adminPolicy": { - "title": "Admin policy", "description": "Additional administrator policy files applied by Gemini CLI.", - "type": "array", "items": {"type": "string", "format": "path"}, "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 130, "x-array-display": "list", - "x-captain-option": {"nativeName": "--admin-policy", "support": "unsupported", "note": "Captain does not expose Gemini administrator policy files."} + "help": { + "description": "Whether Gemini prints command help and exits.", + "readOnly": true, + "title": "Help", + "type": "boolean", + "x-captain-option": { + "nativeName": "--help", + "note": "Captain executes requests rather than CLI help.", + "support": "unsupported" + }, + "x-clicky-order": 290, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://geminicli.com/docs/reference/configuration/", + "label": "Documentation" + } + ] + } }, - "acp": { - "title": "ACP mode", "description": "Whether Gemini runs as an Agent Client Protocol server.", - "type": "boolean", "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 140, - "x-captain-option": {"nativeName": "--acp", "support": "unsupported", "note": "Captain integrates with Gemini through stream-json rather than ACP."} + "includeDirectories": { + "description": "Additional workspace directories included in the Gemini session.", + "items": { + "description": "Include Directories value configuration. See the linked native reference for semantics and availability.", + "format": "path", + "title": "Include Directories value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://geminicli.com/docs/reference/configuration/", + "label": "Documentation" + } + ] + } + }, + "readOnly": true, + "title": "Included directories", + "type": "array", + "x-array-display": "list", + "x-captain-option": { + "nativeName": "--include-directories", + "note": "Captain rejects additional directories for the Gemini CLI adapter.", + "support": "unsupported" + }, + "x-clicky-order": 250, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://geminicli.com/docs/reference/configuration/", + "label": "Documentation" + } + ] + } }, - "experimentalAcp": { - "title": "Experimental ACP mode", "description": "Whether Gemini enables experimental Agent Client Protocol behavior.", - "type": "boolean", "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 150, - "x-captain-option": {"nativeName": "--experimental-acp", "support": "unsupported", "note": "Captain does not use Gemini's experimental ACP server."} + "listExtensions": { + "description": "Whether Gemini lists installed extensions and exits.", + "readOnly": true, + "title": "List extensions", + "type": "boolean", + "x-captain-option": { + "nativeName": "--list-extensions", + "note": "Captain executes requests rather than extension discovery.", + "support": "unsupported" + }, + "x-clicky-order": 190, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://geminicli.com/docs/reference/configuration/", + "label": "Documentation" + } + ] + } }, - "allowedMcpServerNames": { - "title": "Allowed MCP servers", "description": "MCP server names allowed to connect in ACP mode.", - "type": "array", "items": {"type": "string"}, "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 160, "x-array-display": "list", - "x-captain-option": {"nativeName": "--allowed-mcp-server-names", "support": "unsupported", "note": "Captain does not configure Gemini ACP MCP servers."} + "listSessions": { + "description": "Whether Gemini lists stored sessions for the current project.", + "readOnly": true, + "title": "List sessions", + "type": "boolean", + "x-captain-option": { + "nativeName": "--list-sessions", + "note": "Captain performs session discovery outside request execution.", + "support": "unsupported" + }, + "x-clicky-order": 230, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://geminicli.com/docs/reference/configuration/", + "label": "Documentation" + } + ] + } }, - "allowedTools": { - "title": "Allowed tools", "description": "Deprecated list of tools allowed to execute without confirmation.", - "type": "array", "items": {"type": "string"}, "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 170, "x-array-display": "list", - "x-captain-option": {"nativeName": "--allowed-tools", "support": "unsupported", "note": "Gemini marks this flag deprecated; Captain rejects tool policies the adapter cannot represent."} + "model": { + "description": "Gemini model identifier used for the request.", + "title": "Model", + "type": "string", + "x-captain-option": { + "nativeName": "--model", + "specPath": "model.name", + "support": "mapped" + }, + "x-clicky-order": 20, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://geminicli.com/docs/reference/configuration/", + "label": "Documentation" + } + ] + }, + "x-icon": "sparkles" }, - "extensions": { - "title": "Extensions", "description": "Gemini CLI extensions enabled for the session.", - "type": "array", "items": {"type": "string"}, "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 180, "x-array-display": "list", - "x-captain-option": {"nativeName": "--extensions", "support": "unsupported", "note": "Captain does not select Gemini CLI extensions."} + "outputFormat": { + "const": "stream-json", + "description": "Format used for Gemini CLI output.", + "readOnly": true, + "title": "Output format", + "type": "string", + "x-captain-option": { + "nativeName": "--output-format", + "note": "Captain requires stream-json for typed event parsing.", + "support": "managed" + }, + "x-clicky-order": 40, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://geminicli.com/docs/reference/configuration/", + "label": "Documentation" + } + ] + } }, - "listExtensions": { - "title": "List extensions", "description": "Whether Gemini lists installed extensions and exits.", - "type": "boolean", "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 190, - "x-captain-option": {"nativeName": "--list-extensions", "support": "unsupported", "note": "Captain executes requests rather than extension discovery."} + "policy": { + "description": "Policy files applied by Gemini CLI.", + "items": { + "description": "Policy value configuration. See the linked native reference for semantics and availability.", + "format": "path", + "title": "Policy value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://geminicli.com/docs/reference/configuration/", + "label": "Documentation" + } + ] + } + }, + "readOnly": true, + "title": "Policy files", + "type": "array", + "x-array-display": "list", + "x-captain-option": { + "nativeName": "--policy", + "note": "Captain does not expose Gemini policy files.", + "support": "unsupported" + }, + "x-clicky-order": 120, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://geminicli.com/docs/reference/configuration/", + "label": "Documentation" + } + ] + } }, - "resume": { - "title": "Resume session", "description": "Session index or latest selector resumed by Gemini CLI.", - "oneOf": [{"type": "integer", "minimum": 0}, {"type": "string", "const": "latest"}], "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 200, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "--resume", "support": "unsupported", "note": "Gemini resumes by local session index rather than Captain's stable session ID."} + "prompt": { + "description": "Composed prompt text written to Gemini standard input.", + "title": "Prompt", + "type": "string", + "x-captain-option": { + "nativeName": "stdin", + "specPath": [ + "prompt.system", + "prompt.appendSystem", + "prompt.user" + ], + "support": "mapped" + }, + "x-clicky-order": 10, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://geminicli.com/docs/reference/configuration/", + "label": "Documentation" + } + ] + } }, - "sessionFile": { - "title": "Session file", "description": "Path to a Gemini session file loaded for execution.", - "type": "string", "format": "path", "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 210, - "x-captain-option": {"nativeName": "--session-file", "support": "unsupported", "note": "Captain does not load Gemini session files directly."} + "promptFlag": { + "description": "Prompt text supplied directly by the --prompt flag.", + "readOnly": true, + "title": "Prompt flag", + "type": "string", + "x-captain-option": { + "nativeName": "--prompt", + "note": "Captain writes the composed prompt to standard input.", + "support": "unsupported" + }, + "x-clicky-order": 60, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://geminicli.com/docs/reference/configuration/", + "label": "Documentation" + } + ] + } }, - "sessionId": { - "title": "Session ID", "description": "Explicit Gemini session identifier selected for execution.", - "type": "string", "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 220, - "x-captain-option": {"nativeName": "--session-id", "support": "unsupported", "note": "Captain's Gemini registry does not advertise resume support."} + "promptInteractive": { + "description": "Initial prompt followed by an interactive Gemini session.", + "readOnly": true, + "title": "Interactive prompt", + "type": "string", + "x-captain-option": { + "nativeName": "--prompt-interactive", + "note": "Captain runs Gemini headlessly for one request.", + "support": "unsupported" + }, + "x-clicky-order": 70, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://geminicli.com/docs/reference/configuration/", + "label": "Documentation" + } + ] + } }, - "listSessions": { - "title": "List sessions", "description": "Whether Gemini lists stored sessions for the current project.", - "type": "boolean", "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 230, - "x-captain-option": {"nativeName": "--list-sessions", "support": "unsupported", "note": "Captain performs session discovery outside request execution."} + "rawOutput": { + "description": "Whether terminal control sequences are preserved in streamed output.", + "readOnly": true, + "title": "Raw output", + "type": "boolean", + "x-captain-option": { + "nativeName": "--raw-output", + "note": "Captain parses structured JSON events rather than raw terminal output.", + "support": "unsupported" + }, + "x-clicky-order": 270, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://geminicli.com/docs/reference/configuration/", + "label": "Documentation" + } + ] + } }, - "deleteSession": { - "title": "Delete session", "description": "Stored Gemini session index deleted before exit.", - "type": "integer", "minimum": 0, "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 240, - "x-captain-option": {"nativeName": "--delete-session", "support": "unsupported", "note": "Captain never deletes provider sessions as part of execution."} + "resume": { + "description": "Session index or latest selector resumed by Gemini CLI.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "oneOf": [ + { + "description": "Resume configuration. See the linked native reference for semantics and availability.", + "minimum": 0, + "title": "Resume", + "type": "integer", + "x-help": { + "links": [ + { + "href": "https://geminicli.com/docs/reference/configuration/", + "label": "Documentation" + } + ] + } + }, + { + "const": "latest", + "description": "Resume configuration. See the linked native reference for semantics and availability.", + "title": "Resume", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://geminicli.com/docs/reference/configuration/", + "label": "Documentation" + } + ] + } + } + ], + "readOnly": true, + "title": "Resume session", + "x-captain-option": { + "nativeName": "--resume", + "note": "Gemini resumes by local session index rather than Captain's stable session ID.", + "support": "unsupported" + }, + "x-clicky-order": 200, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://geminicli.com/docs/reference/configuration/", + "label": "Documentation" + } + ] + } }, - "includeDirectories": { - "title": "Included directories", "description": "Additional workspace directories included in the Gemini session.", - "type": "array", "items": {"type": "string", "format": "path"}, "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 250, "x-array-display": "list", - "x-captain-option": {"nativeName": "--include-directories", "support": "unsupported", "note": "Captain rejects additional directories for the Gemini CLI adapter."} + "sandbox": { + "description": "Whether Gemini enables its native sandbox, optionally with a sandbox image.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "oneOf": [ + { + "description": "Sandbox configuration. See the linked native reference for semantics and availability.", + "title": "Sandbox", + "type": "boolean", + "x-help": { + "links": [ + { + "href": "https://geminicli.com/docs/reference/configuration/", + "label": "Documentation" + } + ] + } + }, + { + "description": "Sandbox configuration. See the linked native reference for semantics and availability.", + "title": "Sandbox", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://geminicli.com/docs/reference/configuration/", + "label": "Documentation" + } + ] + } + } + ], + "readOnly": true, + "title": "Sandbox", + "x-captain-option": { + "nativeName": "--sandbox", + "note": "Captain rejects native sandbox mode for the Gemini CLI adapter.", + "support": "unsupported" + }, + "x-clicky-order": 100, + "x-clicky-section": "sandbox", + "x-help": { + "links": [ + { + "href": "https://geminicli.com/docs/reference/configuration/", + "label": "Documentation" + } + ] + } }, "screenReader": { - "title": "Screen reader mode", "description": "Whether interactive output is optimized for screen readers.", - "type": "boolean", "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 260, - "x-captain-option": {"nativeName": "--screen-reader", "support": "unsupported", "note": "Captain consumes machine-readable output and does not expose terminal accessibility flags."} + "description": "Whether interactive output is optimized for screen readers.", + "readOnly": true, + "title": "Screen reader mode", + "type": "boolean", + "x-captain-option": { + "nativeName": "--screen-reader", + "note": "Captain consumes machine-readable output and does not expose terminal accessibility flags.", + "support": "unsupported" + }, + "x-clicky-order": 260, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://geminicli.com/docs/reference/configuration/", + "label": "Documentation" + } + ] + } }, - "rawOutput": { - "title": "Raw output", "description": "Whether terminal control sequences are preserved in streamed output.", - "type": "boolean", "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 270, - "x-captain-option": {"nativeName": "--raw-output", "support": "unsupported", "note": "Captain parses structured JSON events rather than raw terminal output."} + "sessionFile": { + "description": "Path to a Gemini session file loaded for execution.", + "format": "path", + "readOnly": true, + "title": "Session file", + "type": "string", + "x-captain-option": { + "nativeName": "--session-file", + "note": "Captain does not load Gemini session files directly.", + "support": "unsupported" + }, + "x-clicky-order": 210, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://geminicli.com/docs/reference/configuration/", + "label": "Documentation" + } + ] + } }, - "acceptRawOutputRisk": { - "title": "Accept raw output risk", "description": "Explicit acknowledgement required before raw output is enabled.", - "type": "boolean", "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 280, - "x-captain-option": {"nativeName": "--accept-raw-output-risk", "support": "unsupported", "note": "Captain does not enable raw terminal output."} + "sessionId": { + "description": "Explicit Gemini session identifier selected for execution.", + "readOnly": true, + "title": "Session ID", + "type": "string", + "x-captain-option": { + "nativeName": "--session-id", + "note": "Captain's Gemini registry does not advertise resume support.", + "support": "unsupported" + }, + "x-clicky-order": 220, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://geminicli.com/docs/reference/configuration/", + "label": "Documentation" + } + ] + } }, - "help": { - "title": "Help", "description": "Whether Gemini prints command help and exits.", - "type": "boolean", "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 290, - "x-captain-option": {"nativeName": "--help", "support": "unsupported", "note": "Captain executes requests rather than CLI help."} + "skipTrust": { + "description": "Whether Gemini skips workspace trust validation.", + "readOnly": true, + "title": "Skip trust check", + "type": "boolean", + "x-captain-option": { + "nativeName": "--skip-trust", + "note": "Captain does not bypass Gemini workspace trust checks.", + "support": "unsupported" + }, + "x-clicky-order": 80, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://geminicli.com/docs/reference/configuration/", + "label": "Documentation" + } + ] + } }, "version": { - "title": "Version", "description": "Whether Gemini prints its version and exits.", - "type": "boolean", "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 300, - "x-captain-option": {"nativeName": "--version", "support": "unsupported", "note": "Captain resolves the installed CLI version outside request execution."} + "description": "Whether Gemini prints its version and exits.", + "readOnly": true, + "title": "Version", + "type": "boolean", + "x-captain-option": { + "nativeName": "--version", + "note": "Captain resolves the installed CLI version outside request execution.", + "support": "unsupported" + }, + "x-clicky-order": 300, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://geminicli.com/docs/reference/configuration/", + "label": "Documentation" + } + ] + } + }, + "worktree": { + "description": "Whether Gemini creates and runs in a Git worktree.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "oneOf": [ + { + "description": "Worktree configuration. See the linked native reference for semantics and availability.", + "title": "Worktree", + "type": "boolean", + "x-help": { + "links": [ + { + "href": "https://geminicli.com/docs/reference/configuration/", + "label": "Documentation" + } + ] + } + }, + { + "description": "Worktree configuration. See the linked native reference for semantics and availability.", + "title": "Worktree", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://geminicli.com/docs/reference/configuration/", + "label": "Documentation" + } + ] + } + } + ], + "readOnly": true, + "title": "Worktree", + "x-captain-option": { + "nativeName": "--worktree", + "note": "Captain executes in the working directory supplied by its context.", + "support": "unsupported" + }, + "x-clicky-order": 90, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://geminicli.com/docs/reference/configuration/", + "label": "Documentation" + } + ] + } + }, + "yolo": { + "description": "Whether Gemini automatically approves every tool action.", + "readOnly": true, + "title": "YOLO mode", + "type": "boolean", + "x-captain-option": { + "nativeName": "--yolo", + "note": "Captain maps explicit bypass and dontAsk policies through --approval-mode yolo.", + "support": "unsupported" + }, + "x-clicky-order": 110, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://geminicli.com/docs/reference/configuration/", + "label": "Documentation" + } + ] + } } + }, + "title": "Google CLI options", + "type": "object", + "x-captain-adapter": { + "mode": "cli", + "provider": "google", + "sources": [ + { + "kind": "cli-help", + "reference": "gemini --help", + "version": "0.64.0" + }, + { + "kind": "implementation", + "reference": "pkg/ai/provider/gemini_cli.go", + "version": "6a2b56cbd26702b18905865f21fc66d44cc864cc" + } + ] + }, + "x-captain-inventory": { + "flags": [ + "--accept-raw-output-risk", + "--acp", + "--admin-policy", + "--allowed-mcp-server-names", + "--allowed-tools", + "--approval-mode", + "--debug", + "--delete-session", + "--experimental-acp", + "--extensions", + "--help", + "--include-directories", + "--list-extensions", + "--list-sessions", + "--model", + "--output-format", + "--policy", + "--prompt", + "--prompt-interactive", + "--raw-output", + "--resume", + "--sandbox", + "--screen-reader", + "--session-file", + "--session-id", + "--skip-trust", + "--version", + "--worktree", + "--yolo" + ], + "version": "gemini-cli 0.64.0" + }, + "x-help": { + "links": [ + { + "href": "https://geminicli.com/docs/reference/configuration/", + "label": "Documentation" + } + ] } } diff --git a/pkg/adapters/jev/api.schema.json b/pkg/adapters/jev/api.schema.json index 9566c0b7..37673e5a 100644 --- a/pkg/adapters/jev/api.schema.json +++ b/pkg/adapters/jev/api.schema.json @@ -1,72 +1,905 @@ { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "JevAPIOptions", - "description": "Native TypeSafe SystemOne evaluation request sent by Captain's Jev API runtime.", - "type": "object", - "additionalProperties": false, - "x-captain-adapter": { - "provider": "jev", - "mode": "api", - "sources": [ - {"kind": "official-docs", "reference": "https://docs.typesafe.ai/api", "version": "retrieved 2026-10-18"}, - {"kind": "implementation", "reference": "pkg/ai/provider/jev/provider.go and pkg/ai/middleware/jev_schema.go", "version": "working tree 2026-10-18 based on d95de3ed8c57a6dadd3978206615e1ec20c96e4e"} - ] - }, - "required": ["model", "state", "questions"], - "properties": { - "model": { - "title": "Model", "description": "TypeSafe model that evaluates the questions.", - "type": "string", "minLength": 1, "x-clicky-section": "model", "x-clicky-order": 10, - "x-captain-option": {"nativeName": "model", "support": "mapped", "specPath": "model.name"} - }, - "state": { - "title": "State", "description": "Text or structured data to evaluate against every question.", - "oneOf": [{"type": "string"}, {"type": "object"}, {"type": "array"}], - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-clicky-section": "prompt", "x-clicky-order": 20, - "x-captain-option": {"nativeName": "state", "support": "mapped", "specPath": "prompt.user"} - }, - "questions": { - "title": "Questions", "description": "Named Noul, Choice, or Score questions evaluated against the state.", - "type": "object", "minProperties": 1, "additionalProperties": {"oneOf": [ - {"$ref": "#/$defs/JevAPINoulQuestion"}, - {"$ref": "#/$defs/JevAPIChoiceQuestion"}, - {"$ref": "#/$defs/JevAPIScoreQuestion"} - ]}, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-clicky-section": "prompt", "x-clicky-order": 30, - "x-captain-option": {"nativeName": "questions", "support": "mapped", "specPath": ["prompt.typeSafeQuestions", "prompt.schema", "prompt.schemaJSON"]} - } - }, "$defs": { - "JevAPINoulQuestion": { - "type": "object", "additionalProperties": false, "required": ["type", "instructions"], + "JevAPIChoiceQuestion": { + "additionalProperties": false, + "description": "Jev APIChoice Question configuration. See the linked native reference for semantics and availability.", "properties": { - "type": {"const": "noul"}, - "instructions": {"oneOf": [{"type": "string"}, {"type": "object"}, {"type": "array"}]}, - "criteria": {"type": "object", "additionalProperties": false, "properties": { - "true": {"oneOf": [{"type": "string"}, {"type": "object"}, {"type": "array"}]}, - "false": {"oneOf": [{"type": "string"}, {"type": "object"}, {"type": "array"}]} - }} + "criteria": { + "additionalProperties": { + "description": "Criteria value configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "oneOf": [ + { + "description": "Criteria value configuration. See the linked native reference for semantics and availability.", + "title": "Criteria value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": { + "description": "Criteria value value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Criteria value value", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + }, + "description": "Criteria value configuration. See the linked native reference for semantics and availability.", + "title": "Criteria value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + }, + { + "description": "Criteria value configuration. See the linked native reference for semantics and availability.", + "title": "Criteria value", + "type": "array", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + }, + { + "description": "Criteria value configuration. See the linked native reference for semantics and availability.", + "title": "Criteria value", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + } + ], + "title": "Criteria value", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + }, + "description": "Criteria configuration. See the linked native reference for semantics and availability.", + "maxProperties": 255, + "minProperties": 1, + "title": "Criteria", + "type": "object", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + }, + "instructions": { + "description": "Instructions configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "oneOf": [ + { + "description": "Instructions configuration. See the linked native reference for semantics and availability.", + "title": "Instructions", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": { + "description": "Instructions value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Instructions value", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + }, + "description": "Instructions configuration. See the linked native reference for semantics and availability.", + "title": "Instructions", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + }, + { + "description": "Instructions configuration. See the linked native reference for semantics and availability.", + "title": "Instructions", + "type": "array", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + } + ], + "title": "Instructions", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "choice", + "description": "Type configuration. See the linked native reference for semantics and availability.", + "title": "Type", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type", + "instructions", + "criteria" + ], + "title": "Jev APIChoice Question", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] } }, - "JevAPIChoiceQuestion": { - "type": "object", "additionalProperties": false, "required": ["type", "instructions", "criteria"], + "JevAPINoulQuestion": { + "additionalProperties": false, + "description": "Jev APINoul Question configuration. See the linked native reference for semantics and availability.", "properties": { - "type": {"const": "choice"}, - "instructions": {"oneOf": [{"type": "string"}, {"type": "object"}, {"type": "array"}]}, - "criteria": {"type": "object", "minProperties": 1, "maxProperties": 255, - "additionalProperties": {"oneOf": [{"type": "string"}, {"type": "object"}, {"type": "array"}, {"type": "null"}]}} + "criteria": { + "additionalProperties": false, + "description": "Criteria configuration. See the linked native reference for semantics and availability.", + "properties": { + "false": { + "description": "False configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "oneOf": [ + { + "description": "False configuration. See the linked native reference for semantics and availability.", + "title": "False", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": { + "description": "False value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "False value", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + }, + "description": "False configuration. See the linked native reference for semantics and availability.", + "title": "False", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + }, + { + "description": "False configuration. See the linked native reference for semantics and availability.", + "title": "False", + "type": "array", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + } + ], + "title": "False", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + }, + "true": { + "description": "True configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "oneOf": [ + { + "description": "True configuration. See the linked native reference for semantics and availability.", + "title": "True", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": { + "description": "True value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "True value", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + }, + "description": "True configuration. See the linked native reference for semantics and availability.", + "title": "True", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + }, + { + "description": "True configuration. See the linked native reference for semantics and availability.", + "title": "True", + "type": "array", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + } + ], + "title": "True", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + } + }, + "title": "Criteria", + "type": "object", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + }, + "instructions": { + "description": "Instructions configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "oneOf": [ + { + "description": "Instructions configuration. See the linked native reference for semantics and availability.", + "title": "Instructions", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": { + "description": "Instructions value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Instructions value", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + }, + "description": "Instructions configuration. See the linked native reference for semantics and availability.", + "title": "Instructions", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + }, + { + "description": "Instructions configuration. See the linked native reference for semantics and availability.", + "title": "Instructions", + "type": "array", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + } + ], + "title": "Instructions", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "noul", + "description": "Type configuration. See the linked native reference for semantics and availability.", + "title": "Type", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type", + "instructions" + ], + "title": "Jev APINoul Question", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] } }, "JevAPIScoreQuestion": { - "type": "object", "additionalProperties": false, "required": ["type", "instructions", "criteria"], + "additionalProperties": false, + "description": "Jev APIScore Question configuration. See the linked native reference for semantics and availability.", "properties": { - "type": {"const": "score"}, - "instructions": {"oneOf": [{"type": "string"}, {"type": "object"}, {"type": "array"}]}, - "criteria": {"type": "array", "minItems": 2, "maxItems": 10, - "items": {"oneOf": [{"type": "string"}, {"type": "object"}, {"type": "array"}]}} + "criteria": { + "description": "Criteria configuration. See the linked native reference for semantics and availability.", + "items": { + "description": "Criteria value configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "oneOf": [ + { + "description": "Criteria value configuration. See the linked native reference for semantics and availability.", + "title": "Criteria value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": { + "description": "Criteria value value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Criteria value value", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + }, + "description": "Criteria value configuration. See the linked native reference for semantics and availability.", + "title": "Criteria value", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + }, + { + "description": "Criteria value configuration. See the linked native reference for semantics and availability.", + "title": "Criteria value", + "type": "array", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + } + ], + "title": "Criteria value", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + }, + "maxItems": 10, + "minItems": 2, + "title": "Criteria", + "type": "array", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + }, + "instructions": { + "description": "Instructions configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "oneOf": [ + { + "description": "Instructions configuration. See the linked native reference for semantics and availability.", + "title": "Instructions", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": { + "description": "Instructions value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Instructions value", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + }, + "description": "Instructions configuration. See the linked native reference for semantics and availability.", + "title": "Instructions", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + }, + { + "description": "Instructions configuration. See the linked native reference for semantics and availability.", + "title": "Instructions", + "type": "array", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + } + ], + "title": "Instructions", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "score", + "description": "Type configuration. See the linked native reference for semantics and availability.", + "title": "Type", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type", + "instructions", + "criteria" + ], + "title": "Jev APIScore Question", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] } } + }, + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "description": "Native TypeSafe SystemOne evaluation request sent by Captain's Jev API runtime.", + "properties": { + "model": { + "description": "TypeSafe model that evaluates the questions.", + "minLength": 1, + "title": "Model", + "type": "string", + "x-captain-option": { + "nativeName": "model", + "specPath": "model.name", + "support": "mapped" + }, + "x-clicky-order": 10, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + }, + "questions": { + "additionalProperties": { + "description": "Questions value configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "oneOf": [ + { + "$ref": "#/$defs/JevAPINoulQuestion", + "description": "Questions value configuration. See the linked native reference for semantics and availability.", + "title": "Questions value", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/JevAPIChoiceQuestion", + "description": "Questions value configuration. See the linked native reference for semantics and availability.", + "title": "Questions value", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/JevAPIScoreQuestion", + "description": "Questions value configuration. See the linked native reference for semantics and availability.", + "title": "Questions value", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + } + ], + "title": "Questions value", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + }, + "description": "Named Noul, Choice, or Score questions evaluated against the state.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "minProperties": 1, + "title": "Questions", + "type": "object", + "x-captain-option": { + "nativeName": "questions", + "specPath": [ + "prompt.typeSafeQuestions", + "prompt.schema", + "prompt.schemaJSON" + ], + "support": "mapped" + }, + "x-clicky-order": 30, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + }, + "state": { + "description": "Text or structured data to evaluate against every question.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "oneOf": [ + { + "description": "State configuration. See the linked native reference for semantics and availability.", + "title": "State", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": { + "description": "State value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "State value", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + }, + "description": "State configuration. See the linked native reference for semantics and availability.", + "title": "State", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + }, + { + "description": "State configuration. See the linked native reference for semantics and availability.", + "title": "State", + "type": "array", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + } + ], + "title": "State", + "x-captain-option": { + "nativeName": "state", + "specPath": "prompt.user", + "support": "mapped" + }, + "x-clicky-order": 20, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "model", + "state", + "questions" + ], + "title": "Jev API options", + "type": "object", + "x-captain-adapter": { + "mode": "api", + "provider": "jev", + "sources": [ + { + "kind": "official-docs", + "reference": "https://docs.typesafe.ai/api", + "version": "retrieved 2026-10-18" + }, + { + "kind": "implementation", + "reference": "pkg/ai/provider/jev/provider.go and pkg/ai/middleware/jev_schema.go", + "version": "working tree 2026-10-18 based on d95de3ed8c57a6dadd3978206615e1ec20c96e4e" + } + ] + }, + "x-help": { + "links": [ + { + "href": "https://github.com/flanksource/captain", + "label": "Documentation" + } + ] } } diff --git a/pkg/adapters/nested_resources_ginkgo_test.go b/pkg/adapters/nested_resources_ginkgo_test.go new file mode 100644 index 00000000..983b2dd3 --- /dev/null +++ b/pkg/adapters/nested_resources_ginkgo_test.go @@ -0,0 +1,22 @@ +package adapters + +import ( + "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +var _ = ginkgo.Describe("native nested resources", func() { + ginkgo.It("describes native API messages and tools with referenced SDK definitions", func() { + for _, document := range loadAdapterSchemas() { + if document.path != "anthropic/api.schema.json" && document.path != "openai/api.schema.json" && document.path != "google/api.schema.json" { + continue + } + definitions := objectFieldOrEmpty(document.body, "$defs") + Expect(len(definitions)).To(BeNumerically(">", 10), document.path) + properties := objectField(document.body, "properties", document.path) + tools := objectField(properties, "tools", document.path) + Expect(tools).To(HaveKey("items"), document.path) + Expect(objectField(tools, "items", document.path)).To(HaveKey("$ref"), document.path) + } + }) +}) diff --git a/pkg/adapters/openai/agent.schema.json b/pkg/adapters/openai/agent.schema.json index c75729d2..5b6d6252 100644 --- a/pkg/adapters/openai/agent.schema.json +++ b/pkg/adapters/openai/agent.schema.json @@ -1,433 +1,9981 @@ { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "OpenAIAgentOptions", - "description": "Native Codex app-server initialize, thread, and turn arguments used by Captain's OpenAI agent runtime.", - "type": "object", - "additionalProperties": false, - "x-captain-adapter": { - "provider": "openai", - "mode": "agent", - "sources": [ - {"kind": "protocol", "reference": "codex app-server generate-json-schema --experimental", "version": "codex-cli 0.156.1"}, - {"kind": "implementation", "reference": "pkg/ai/provider/codex_appserver.go and codex_appserver_protocol.go", "version": "7220b7c99be01dfd9809a1fc237dafda9aa712b3"} - ] - }, - "properties": { - "initialize": { - "title": "Initialize", "description": "Parameters sent in the Codex app-server initialize request.", - "type": "object", "additionalProperties": false, + "$defs": { + "OpenAIAgentAbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "title": "Open AIAgent Absolute Path Buf", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentAdditionalContextEntry": { + "description": "Open AIAgent Additional Context Entry configuration. See the linked native reference for semantics and availability.", "properties": { - "clientInfo": { - "title": "Client information", "description": "Name, title, and version identifying the app-server client.", - "type": "object", "additionalProperties": true, "readOnly": true, "x-clicky-section": "environment", "x-clicky-order": 10, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "initialize.clientInfo", "support": "managed", "note": "Captain identifies itself and its build version to Codex."} + "kind": { + "$ref": "#/$defs/OpenAIAgentAdditionalContextKind", + "description": "Kind configuration. See the linked native reference for semantics and availability.", + "title": "Kind", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, - "capabilities": { - "title": "Client capabilities", "description": "Experimental protocol capabilities supported by the client.", - "type": "object", "additionalProperties": true, "readOnly": true, "x-clicky-section": "environment", "x-clicky-order": 20, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "initialize.capabilities", "support": "managed", "note": "Captain enables the experimental API required by its app-server integration."} + "value": { + "description": "Value configuration. See the linked native reference for semantics and availability.", + "title": "Value", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } } + }, + "required": [ + "kind", + "value" + ], + "title": "Open AIAgent Additional Context Entry", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] } }, - "threadStart": { - "title": "Thread start", "description": "Parameters used to start a new Codex app-server thread.", - "type": "object", "additionalProperties": false, + "OpenAIAgentAdditionalContextKind": { + "description": "Open AIAgent Additional Context Kind configuration. See the linked native reference for semantics and availability.", + "enum": [ + "untrusted", + "application" + ], + "title": "Open AIAgent Additional Context Kind", + "type": "string", + "x-enum-display": "segmented", + "x-enum-labels": { + "application": "Application", + "untrusted": "Untrusted" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentAgentMessageInputContent": { + "description": "Open AIAgent Agent Message Input Content configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "oneOf": [ + { + "description": "Open AIAgent Agent Message Input Content configuration. See the linked native reference for semantics and availability.", + "properties": { + "text": { + "description": "Text configuration. See the linked native reference for semantics and availability.", + "title": "Text", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "input_text" + ], + "title": "InputTextAgentMessageInputContentType", + "type": "string", + "x-clicky-order": 20, + "x-enum-display": "segmented", + "x-enum-labels": { + "input_text": "Input text" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "text", + "type" + ], + "title": "InputTextAgentMessageInputContent", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Open AIAgent Agent Message Input Content configuration. See the linked native reference for semantics and availability.", + "properties": { + "encrypted_content": { + "description": "Encrypted content configuration. See the linked native reference for semantics and availability.", + "title": "Encrypted content", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "encrypted_content" + ], + "title": "EncryptedContentAgentMessageInputContentType", + "type": "string", + "x-clicky-order": 20, + "x-enum-display": "segmented", + "x-enum-labels": { + "encrypted_content": "Encrypted content" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "encrypted_content", + "type" + ], + "title": "EncryptedContentAgentMessageInputContent", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "title": "Open AIAgent Agent Message Input Content", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentApprovalsReviewer": { + "description": "Configures who approval requests are routed to for review. Examples include sandbox escapes, blocked network access, MCP approval prompts, and ARC escalations. Defaults to `user`. `auto_review` uses a carefully prompted subagent to gather relevant context and apply a risk-based decision framework before approving or denying the request. The legacy value `guardian_subagent` is accepted for compatibility.", + "enum": [ + "user", + "auto_review", + "guardian_subagent" + ], + "title": "Open AIAgent Approvals Reviewer", + "type": "string", + "x-enum-display": "segmented", + "x-enum-labels": { + "auto_review": "Auto review", + "guardian_subagent": "Guardian subagent", + "user": "User" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentAskForApproval": { + "description": "Open AIAgent Ask For Approval configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "oneOf": [ + { + "description": "Open AIAgent Ask For Approval configuration. See the linked native reference for semantics and availability.", + "enum": [ + "untrusted", + "on-request", + "never" + ], + "title": "Open AIAgent Ask For Approval", + "type": "string", + "x-enum-display": "segmented", + "x-enum-labels": { + "never": "Never", + "on-request": "On request", + "untrusted": "Untrusted" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "additionalProperties": false, + "description": "Open AIAgent Ask For Approval configuration. See the linked native reference for semantics and availability.", + "properties": { + "granular": { + "description": "Granular configuration. See the linked native reference for semantics and availability.", + "properties": { + "mcp_elicitations": { + "description": "MCP elicitations configuration. See the linked native reference for semantics and availability.", + "title": "MCP elicitations", + "type": "boolean", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "request_permissions": { + "default": false, + "description": "Request permissions configuration. See the linked native reference for semantics and availability.", + "title": "Request permissions", + "type": "boolean", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "rules": { + "description": "Rules configuration. See the linked native reference for semantics and availability.", + "title": "Rules", + "type": "boolean", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "sandbox_approval": { + "description": "Sandbox approval configuration. See the linked native reference for semantics and availability.", + "title": "Sandbox approval", + "type": "boolean", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "skill_approval": { + "default": false, + "description": "Skill approval configuration. See the linked native reference for semantics and availability.", + "title": "Skill approval", + "type": "boolean", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "mcp_elicitations", + "rules", + "sandbox_approval" + ], + "title": "Granular", + "type": "object", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "granular" + ], + "title": "GranularAskForApproval", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "title": "Open AIAgent Ask For Approval", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentByteRange": { + "description": "Open AIAgent Byte Range configuration. See the linked native reference for semantics and availability.", "properties": { - "cwd": { - "title": "Working directory", "description": "Initial working directory for the Codex thread.", - "type": "string", "format": "path", "x-clicky-section": "workspace", "x-clicky-order": 30, - "x-captain-option": {"nativeName": "thread/start.cwd", "support": "mapped", "specPath": "setup.cwd"} + "end": { + "description": "End configuration. See the linked native reference for semantics and availability.", + "format": "uint", + "minimum": 0, + "title": "End", + "type": "integer", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, - "model": { - "title": "Model", "description": "Model identifier used to start the Codex thread.", - "type": "string", "x-clicky-section": "model", "x-clicky-order": 40, "x-icon": "sparkles", - "x-captain-option": {"nativeName": "thread/start.model", "support": "mapped", "specPath": "model"} + "start": { + "description": "Start configuration. See the linked native reference for semantics and availability.", + "format": "uint", + "minimum": 0, + "title": "Start", + "type": "integer", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "end", + "start" + ], + "title": "Open AIAgent Byte Range", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentCapabilityRootLocation": { + "description": "Location used to resolve a selected capability root.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "oneOf": [ + { + "description": "A path owned by an execution environment.", + "properties": { + "environmentId": { + "description": "Environment Id configuration. See the linked native reference for semantics and availability.", + "title": "Environment Id", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "path": { + "description": "Absolute path for the root in the selected environment.", + "title": "Path", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "environment" + ], + "title": "EnvironmentCapabilityRootLocationType", + "type": "string", + "x-clicky-order": 30, + "x-enum-display": "segmented", + "x-enum-labels": { + "environment": "Environment" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "environmentId", + "path", + "type" + ], + "title": "EnvironmentCapabilityRootLocation", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "title": "Open AIAgent Capability Root Location", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentClientInfo": { + "description": "Open AIAgent Client Info configuration. See the linked native reference for semantics and availability.", + "properties": { + "name": { + "description": "Name configuration. See the linked native reference for semantics and availability.", + "title": "Name", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, - "sandbox": { - "title": "Sandbox mode", "description": "Named Codex sandbox mode for the thread.", - "type": "string", "enum": ["read-only", "workspace-write", "danger-full-access"], "x-clicky-section": "sandbox", "x-clicky-order": 50, "x-enum-display": "segmented", - "x-captain-option": {"nativeName": "thread/start.sandbox", "support": "mapped", "specPath": ["sandbox.mode", "sandbox.policy.filesystem.access"]} + "title": { + "description": "Title configuration. See the linked native reference for semantics and availability.", + "title": "Title", + "type": [ + "string", + "null" + ], + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, - "approvalPolicy": { - "title": "Approval policy", "description": "Codex command-approval policy for the thread.", - "oneOf": [{"type": "string", "enum": ["untrusted", "on-request", "never"]}, {"type": "object", "additionalProperties": false, "required": ["granular"], "properties": {"granular": {"type": "object", "additionalProperties": false, "required": ["mcp_elicitations", "rules", "sandbox_approval"], "properties": {"mcp_elicitations": {"type": "boolean"}, "request_permissions": {"type": "boolean", "default": false}, "rules": {"type": "boolean"}, "sandbox_approval": {"type": "boolean"}, "skill_approval": {"type": "boolean", "default": false}}}}}], - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, "x-clicky-section": "permissions", "x-clicky-order": 60, - "x-captain-option": {"nativeName": "thread/start.approvalPolicy", "support": "mapped", "specPath": "permissions.mode"} + "version": { + "description": "Version configuration. See the linked native reference for semantics and availability.", + "title": "Version", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "name", + "version" + ], + "title": "Open AIAgent Client Info", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentCollaborationMode": { + "description": "Collaboration mode for a Codex session.", + "properties": { + "mode": { + "$ref": "#/$defs/OpenAIAgentModeKind", + "description": "Mode configuration. See the linked native reference for semantics and availability.", + "title": "Mode", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, - "ephemeral": { - "title": "Ephemeral thread", "description": "Whether Codex avoids persisting the thread to disk.", - "type": "boolean", "x-clicky-section": "workspace", "x-clicky-order": 70, - "x-captain-option": {"nativeName": "thread/start.ephemeral", "support": "mapped", "specPath": ["memory.skipMemory", "memory.bare", "permissions.presets"]} + "settings": { + "$ref": "#/$defs/OpenAIAgentSettings", + "description": "Settings configuration. See the linked native reference for semantics and availability.", + "title": "Settings", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "mode", + "settings" + ], + "title": "Open AIAgent Collaboration Mode", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentConfigurationReasoning": { + "description": "Reasoning settings interpreted by the backend for the routed model.", + "properties": { + "effort": { + "$ref": "#/$defs/OpenAIAgentReasoningEffort", + "description": "Effort configuration. See the linked native reference for semantics and availability.", + "title": "Effort", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "effort" + ], + "title": "Open AIAgent Configuration Reasoning", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentContentItem": { + "description": "Open AIAgent Content Item configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "oneOf": [ + { + "description": "Open AIAgent Content Item configuration. See the linked native reference for semantics and availability.", + "properties": { + "text": { + "description": "Text configuration. See the linked native reference for semantics and availability.", + "title": "Text", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "input_text" + ], + "title": "InputTextContentItemType", + "type": "string", + "x-clicky-order": 20, + "x-enum-display": "segmented", + "x-enum-labels": { + "input_text": "Input text" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "text", + "type" + ], + "title": "InputTextContentItem", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, - "config": { - "title": "Configuration overrides", "description": "Codex configuration overrides derived from Captain sandbox and caller-tool settings.", - "type": "object", "additionalProperties": true, "readOnly": true, "x-clicky-section": "environment", "x-clicky-order": 80, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "thread/start.config", "support": "managed", "note": "Captain assembles sandbox and MCP overrides from mapped Spec values and its registered caller-tool endpoint."} + { + "anyOf": [ + { + "description": "Open AIAgent Content Item configuration. See the linked native reference for semantics and availability.", + "properties": { + "image_url": { + "description": "Image url configuration. See the linked native reference for semantics and availability.", + "title": "Image url", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "image_url" + ], + "title": "ImageUrlContentItem", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Open AIAgent Content Item configuration. See the linked native reference for semantics and availability.", + "properties": { + "file_id": { + "description": "File id configuration. See the linked native reference for semantics and availability.", + "title": "File id", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "file_id" + ], + "title": "FileIdContentItem", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Open AIAgent Content Item configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "properties": { + "detail": { + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentImageDetail", + "description": "Detail configuration. See the linked native reference for semantics and availability.", + "title": "Detail", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Detail configuration. See the linked native reference for semantics and availability.", + "title": "Detail", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Detail configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Detail", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "input_image" + ], + "title": "InputImageContentItemType", + "type": "string", + "x-clicky-order": 20, + "x-enum-display": "segmented", + "x-enum-labels": { + "input_image": "Input image" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type" + ], + "title": "InputImageContentItem", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, - "experimentalRawEvents": { - "title": "Experimental raw events", "description": "Whether raw protocol events are included in item streams.", - "type": "boolean", "const": true, "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 90, - "x-captain-option": {"nativeName": "thread/start.experimentalRawEvents", "support": "managed", "note": "Captain enables raw events to preserve provider-native session information."} + { + "description": "Open AIAgent Content Item configuration. See the linked native reference for semantics and availability.", + "properties": { + "audio_url": { + "description": "Audio url configuration. See the linked native reference for semantics and availability.", + "title": "Audio url", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "input_audio" + ], + "title": "InputAudioContentItemType", + "type": "string", + "x-clicky-order": 20, + "x-enum-display": "segmented", + "x-enum-labels": { + "input_audio": "Input audio" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "audio_url", + "type" + ], + "title": "InputAudioContentItem", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, - "allowProviderModelFallback": { - "title": "Provider model fallback", "description": "Whether Codex may fall back to a different provider model.", - "type": "boolean", "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 100, - "x-captain-option": {"nativeName": "thread/start.allowProviderModelFallback", "support": "unsupported", "note": "Captain performs model fallback in its own provider registry."} + { + "description": "Open AIAgent Content Item configuration. See the linked native reference for semantics and availability.", + "properties": { + "annotations": { + "description": "Annotations configuration. See the linked native reference for semantics and availability.", + "items": true, + "title": "Annotations", + "type": [ + "array", + "null" + ], + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "logprobs": { + "description": "Logprobs configuration. See the linked native reference for semantics and availability.", + "items": true, + "title": "Logprobs", + "type": [ + "array", + "null" + ], + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "text": { + "description": "Text configuration. See the linked native reference for semantics and availability.", + "title": "Text", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "output_text" + ], + "title": "OutputTextContentItemType", + "type": "string", + "x-clicky-order": 40, + "x-enum-display": "segmented", + "x-enum-labels": { + "output_text": "Output text" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "text", + "type" + ], + "title": "OutputTextContentItem", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "title": "Open AIAgent Content Item", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentCyberAccessProgram": { + "description": "Requested cyber treatment for an OpenAI model turn. Authorization and model-tier restrictions remain server-owned.", + "enum": [ + "standard", + "daybreakBlue", + "daybreakRed" + ], + "title": "Open AIAgent Cyber Access Program", + "type": "string", + "x-enum-display": "segmented", + "x-enum-labels": { + "daybreakBlue": "Daybreak Blue", + "daybreakRed": "Daybreak Red", + "standard": "Standard" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentDynamicToolNamespaceTool": { + "description": "Open AIAgent Dynamic Tool Namespace Tool configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "oneOf": [ + { + "description": "Open AIAgent Dynamic Tool Namespace Tool configuration. See the linked native reference for semantics and availability.", + "properties": { + "deferLoading": { + "description": "Defer Loading configuration. See the linked native reference for semantics and availability.", + "title": "Defer Loading", + "type": "boolean", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "description": { + "description": "Description configuration. See the linked native reference for semantics and availability.", + "title": "Description", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "inputSchema": true, + "name": { + "description": "Name configuration. See the linked native reference for semantics and availability.", + "title": "Name", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "function" + ], + "title": "FunctionDynamicToolNamespaceToolType", + "type": "string", + "x-clicky-order": 50, + "x-enum-display": "segmented", + "x-enum-labels": { + "function": "Function" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "description", + "inputSchema", + "name", + "type" + ], + "title": "FunctionDynamicToolNamespaceTool", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "title": "Open AIAgent Dynamic Tool Namespace Tool", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentDynamicToolSpec": { + "description": "Open AIAgent Dynamic Tool Spec configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "oneOf": [ + { + "description": "Open AIAgent Dynamic Tool Spec configuration. See the linked native reference for semantics and availability.", + "properties": { + "deferLoading": { + "description": "Defer Loading configuration. See the linked native reference for semantics and availability.", + "title": "Defer Loading", + "type": "boolean", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "description": { + "description": "Description configuration. See the linked native reference for semantics and availability.", + "title": "Description", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "inputSchema": true, + "name": { + "description": "Name configuration. See the linked native reference for semantics and availability.", + "title": "Name", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "function" + ], + "title": "FunctionDynamicToolSpecType", + "type": "string", + "x-clicky-order": 50, + "x-enum-display": "segmented", + "x-enum-labels": { + "function": "Function" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "description", + "inputSchema", + "name", + "type" + ], + "title": "FunctionDynamicToolSpec", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, - "approvalsReviewer": { - "title": "Approvals reviewer", "description": "Reviewer implementation used to evaluate approval requests.", - "type": "string", "enum": ["user", "auto_review", "guardian_subagent"], "x-clicky-section": "permissions", "x-clicky-order": 110, - "x-captain-option": {"nativeName": "thread/start.approvalsReviewer", "support": "mapped", "specPath": "permissions.mode"} + { + "description": "Open AIAgent Dynamic Tool Spec configuration. See the linked native reference for semantics and availability.", + "properties": { + "description": { + "description": "Description configuration. See the linked native reference for semantics and availability.", + "title": "Description", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "name": { + "description": "Name configuration. See the linked native reference for semantics and availability.", + "title": "Name", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "tools": { + "description": "Tools configuration. See the linked native reference for semantics and availability.", + "items": { + "$ref": "#/$defs/OpenAIAgentDynamicToolNamespaceTool", + "description": "Tools value configuration. See the linked native reference for semantics and availability.", + "title": "Tools value", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "title": "Tools", + "type": "array", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "namespace" + ], + "title": "NamespaceDynamicToolSpecType", + "type": "string", + "x-clicky-order": 40, + "x-enum-display": "segmented", + "x-enum-labels": { + "namespace": "Namespace" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "description", + "name", + "tools", + "type" + ], + "title": "NamespaceDynamicToolSpec", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "title": "Open AIAgent Dynamic Tool Spec", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentFunctionCallOutputBody": { + "anyOf": [ + { + "description": "Open AIAgent Function Call Output Body configuration. See the linked native reference for semantics and availability.", + "title": "Open AIAgent Function Call Output Body", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, - "baseInstructions": { - "title": "Base instructions", "description": "Replacement base instruction text for the Codex thread.", - "type": "string", "readOnly": true, "x-clicky-section": "prompt", "x-clicky-order": 120, - "x-captain-option": {"nativeName": "thread/start.baseInstructions", "support": "unsupported", "note": "Captain sends prompt instructions at turn start and does not replace Codex base instructions."} + { + "description": "Open AIAgent Function Call Output Body configuration. See the linked native reference for semantics and availability.", + "items": { + "$ref": "#/$defs/OpenAIAgentFunctionCallOutputContentItem", + "description": "Open AIAgent Function Call Output Body value configuration. See the linked native reference for semantics and availability.", + "title": "Open AIAgent Function Call Output Body value", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "title": "Open AIAgent Function Call Output Body", + "type": "array", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Open AIAgent Function Call Output Body configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Open AIAgent Function Call Output Body", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentFunctionCallOutputContentItem": { + "description": "Responses API compatible content items that can be returned by a tool call. This is a subset of ContentItem with the types we support as function call outputs.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "oneOf": [ + { + "description": "Open AIAgent Function Call Output Content Item configuration. See the linked native reference for semantics and availability.", + "properties": { + "text": { + "description": "Text configuration. See the linked native reference for semantics and availability.", + "title": "Text", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "input_text" + ], + "title": "InputTextFunctionCallOutputContentItemType", + "type": "string", + "x-clicky-order": 20, + "x-enum-display": "segmented", + "x-enum-labels": { + "input_text": "Input text" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "text", + "type" + ], + "title": "InputTextFunctionCallOutputContentItem", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, - "developerInstructions": { - "title": "Developer instructions", "description": "Developer instruction text attached to the Codex thread.", - "type": "string", "readOnly": true, "x-clicky-section": "prompt", "x-clicky-order": 130, - "x-captain-option": {"nativeName": "thread/start.developerInstructions", "support": "unsupported", "note": "Captain does not set thread-level developer instructions."} + { + "anyOf": [ + { + "description": "Open AIAgent Function Call Output Content Item configuration. See the linked native reference for semantics and availability.", + "properties": { + "image_url": { + "description": "Image url configuration. See the linked native reference for semantics and availability.", + "title": "Image url", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "image_url" + ], + "title": "ImageUrlFunctionCallOutputContentItem", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Open AIAgent Function Call Output Content Item configuration. See the linked native reference for semantics and availability.", + "properties": { + "file_id": { + "description": "File id configuration. See the linked native reference for semantics and availability.", + "title": "File id", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "file_id" + ], + "title": "FileIdFunctionCallOutputContentItem", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Open AIAgent Function Call Output Content Item configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "properties": { + "detail": { + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentImageDetail", + "description": "Detail configuration. See the linked native reference for semantics and availability.", + "title": "Detail", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Detail configuration. See the linked native reference for semantics and availability.", + "title": "Detail", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Detail configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Detail", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "input_image" + ], + "title": "InputImageFunctionCallOutputContentItemType", + "type": "string", + "x-clicky-order": 20, + "x-enum-display": "segmented", + "x-enum-labels": { + "input_image": "Input image" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type" + ], + "title": "InputImageFunctionCallOutputContentItem", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, - "dynamicTools": { - "title": "Dynamic tools", "description": "Tool definitions registered dynamically with the Codex thread.", - "type": "array", "items": {"type": "object", "additionalProperties": true}, "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 140, "x-array-display": "stacked", - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "thread/start.dynamicTools", "support": "unsupported", "note": "Captain exposes caller tools through MCP rather than Codex dynamic tools."} + { + "description": "Open AIAgent Function Call Output Content Item configuration. See the linked native reference for semantics and availability.", + "properties": { + "audio_url": { + "description": "Audio url configuration. See the linked native reference for semantics and availability.", + "title": "Audio url", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "input_audio" + ], + "title": "InputAudioFunctionCallOutputContentItemType", + "type": "string", + "x-clicky-order": 20, + "x-enum-display": "segmented", + "x-enum-labels": { + "input_audio": "Input audio" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "audio_url", + "type" + ], + "title": "InputAudioFunctionCallOutputContentItem", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, - "daybreakEnabled": { - "title": "Daybreak enabled", "description": "Initial Daybreak choice for a persistent Codex thread; not supported for ephemeral threads.", - "type": "boolean", "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 145, - "x-captain-option": {"nativeName": "thread/start.daybreakEnabled", "support": "unsupported", "note": "Captain leaves the Codex Daybreak choice unset."} + { + "description": "Open AIAgent Function Call Output Content Item configuration. See the linked native reference for semantics and availability.", + "properties": { + "encrypted_content": { + "description": "Encrypted content configuration. See the linked native reference for semantics and availability.", + "title": "Encrypted content", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "encrypted_content" + ], + "title": "EncryptedContentFunctionCallOutputContentItemType", + "type": "string", + "x-clicky-order": 20, + "x-enum-display": "segmented", + "x-enum-labels": { + "encrypted_content": "Encrypted content" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "encrypted_content", + "type" + ], + "title": "EncryptedContentFunctionCallOutputContentItem", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "title": "Open AIAgent Function Call Output Content Item", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentImageDetail": { + "description": "Open AIAgent Image Detail configuration. See the linked native reference for semantics and availability.", + "enum": [ + "auto", + "low", + "high", + "original" + ], + "title": "Open AIAgent Image Detail", + "type": "string", + "x-enum-display": "segmented", + "x-enum-labels": { + "auto": "Auto", + "high": "High", + "low": "Low", + "original": "Original" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentInitializeCapabilities": { + "description": "Client-declared capabilities negotiated during initialize.", + "properties": { + "experimentalApi": { + "default": false, + "description": "Opt into receiving experimental API methods and fields.", + "title": "Experimental API", + "type": "boolean", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, - "environments": { - "title": "Environments", "description": "Named execution environments available to the Codex thread.", - "type": "array", "items": {"type": "object", "additionalProperties": true}, "readOnly": true, "x-clicky-section": "environment", "x-clicky-order": 150, "x-array-display": "stacked", - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "thread/start.environments", "support": "unsupported", "note": "Captain does not pass native Codex environment descriptors."} + "explicitGatewayOauth": { + "description": "Use explicit gateway OAuth login instead of automatic browser authorization. Applies to this app-server's gateway runtime; later connections cannot undo it.", + "title": "Explicit Gateway Oauth", + "type": "boolean", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, - "historyMode": { - "title": "History mode", "description": "Codex policy controlling which history is retained.", - "type": "string", "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 160, - "x-captain-option": {"nativeName": "thread/start.historyMode", "support": "unsupported", "note": "Captain does not override Codex history mode."} + "extensions": { + "additionalProperties": true, + "description": "MCP extension settings declared by the app-server client.", + "title": "Extensions", + "type": [ + "object", + "null" + ], + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, - "mockExperimentalField": { - "title": "Mock experimental field", "description": "Protocol test field reserved by the experimental app-server schema.", - "type": "string", "readOnly": true, "x-clicky-section": "environment", "x-clicky-order": 170, - "x-captain-option": {"nativeName": "thread/start.mockExperimentalField", "support": "unsupported", "note": "Captain does not use protocol test fields."} + "mcpServerOpenaiFormElicitation": { + "description": "Legacy opt-in for the `openai/form` MCP extension.\n\nNew clients should declare `openai/form` in [`Self::extensions`].", + "title": "MCP Server OpenAI Form Elicitation", + "type": "boolean", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, - "modelProvider": { - "title": "Model provider", "description": "Codex model-provider implementation selected for the thread.", - "type": "string", "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 180, - "x-captain-option": {"nativeName": "thread/start.modelProvider", "support": "unsupported", "note": "Captain uses the installed Codex provider configuration."} + "optOutNotificationMethods": { + "description": "Exact notification method names that should be suppressed for this connection (for example `thread/started`).", + "items": { + "description": "Opt Out Notification Methods value configuration. See the linked native reference for semantics and availability.", + "title": "Opt Out Notification Methods value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "title": "Opt Out Notification Methods", + "type": [ + "array", + "null" + ], + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, - "multiAgentMode": { - "title": "Multi-agent mode", "description": "Codex multi-agent coordination mode for the thread.", - "type": "string", "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 190, - "x-captain-option": {"nativeName": "thread/start.multiAgentMode", "support": "unsupported", "note": "Captain does not override Codex multi-agent mode."} + "requestAttestation": { + "default": false, + "description": "Opt into `attestation/generate` requests for upstream `x-oai-attestation`.", + "title": "Request Attestation", + "type": "boolean", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "title": "Open AIAgent Initialize Capabilities", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentInternalChatMessageMetadataPassthrough": { + "description": "Internal Responses API passthrough metadata copied into underlying chat messages.\n\nResponses API strongly types this payload. Do not modify it without first getting API approval and making the corresponding Responses API change.", + "properties": { + "turn_id": { + "description": "Turn id configuration. See the linked native reference for semantics and availability.", + "title": "Turn id", + "type": [ + "string", + "null" + ], + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "title": "Open AIAgent Internal Chat Message Metadata Passthrough", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentLegacyAppPathString": { + "description": "Open AIAgent Legacy App Path String configuration. See the linked native reference for semantics and availability.", + "title": "Open AIAgent Legacy App Path String", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentLocalShellAction": { + "description": "Open AIAgent Local Shell Action configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "oneOf": [ + { + "description": "Open AIAgent Local Shell Action configuration. See the linked native reference for semantics and availability.", + "properties": { + "command": { + "description": "Command configuration. See the linked native reference for semantics and availability.", + "items": { + "description": "Command value configuration. See the linked native reference for semantics and availability.", + "title": "Command value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "title": "Command", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "env": { + "additionalProperties": { + "description": "Env value configuration. See the linked native reference for semantics and availability.", + "title": "Env value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "description": "Env configuration. See the linked native reference for semantics and availability.", + "title": "Env", + "type": [ + "object", + "null" + ], + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "timeout_ms": { + "description": "Timeout ms configuration. See the linked native reference for semantics and availability.", + "format": "uint64", + "minimum": 0, + "title": "Timeout ms", + "type": [ + "integer", + "null" + ], + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "exec" + ], + "title": "ExecLocalShellActionType", + "type": "string", + "x-clicky-order": 40, + "x-enum-display": "segmented", + "x-enum-labels": { + "exec": "Exec" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "user": { + "description": "User configuration. See the linked native reference for semantics and availability.", + "title": "User", + "type": [ + "string", + "null" + ], + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "working_directory": { + "description": "Working directory configuration. See the linked native reference for semantics and availability.", + "title": "Working directory", + "type": [ + "string", + "null" + ], + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "command", + "type" + ], + "title": "ExecLocalShellAction", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "title": "Open AIAgent Local Shell Action", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentLocalShellStatus": { + "description": "Open AIAgent Local Shell Status configuration. See the linked native reference for semantics and availability.", + "enum": [ + "completed", + "in_progress", + "incomplete" + ], + "title": "Open AIAgent Local Shell Status", + "type": "string", + "x-enum-display": "segmented", + "x-enum-labels": { + "completed": "Completed", + "in_progress": "In progress", + "incomplete": "Incomplete" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentMessagePhase": { + "description": "Classifies assistant text as commentary, a partial answer, or a terminal answer.\n\nProviders do not emit this consistently, so callers must treat `None` as \"phase unknown\" and keep compatibility behavior for legacy models.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "oneOf": [ + { + "description": "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", + "enum": [ + "commentary" + ], + "title": "Open AIAgent Message Phase", + "type": "string", + "x-enum-display": "segmented", + "x-enum-labels": { + "commentary": "Commentary" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, - "permissions": { - "title": "Permission profile", "description": "Named Codex permission-profile identifier for the thread; it cannot be combined with sandbox.", - "type": "string", "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 200, - "x-captain-option": {"nativeName": "thread/start.permissions", "support": "unsupported", "note": "Captain maps sandbox and approvalPolicy explicitly and does not select native named permission profiles."} + { + "description": "Stable answer text that may be followed by more assistant output or tools.", + "enum": [ + "partial_answer" + ], + "title": "Open AIAgent Message Phase", + "type": "string", + "x-enum-display": "segmented", + "x-enum-labels": { + "partial_answer": "Partial answer" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, - "personality": { - "title": "Personality", "description": "Named Codex response personality for the thread.", - "type": "string", "readOnly": true, "x-clicky-section": "prompt", "x-clicky-order": 210, - "x-captain-option": {"nativeName": "thread/start.personality", "support": "unsupported", "note": "Captain does not expose Codex personality selection."} + { + "description": "The assistant's declared terminal answer text for the current turn.", + "enum": [ + "final_answer" + ], + "title": "Open AIAgent Message Phase", + "type": "string", + "x-enum-display": "segmented", + "x-enum-labels": { + "final_answer": "Final answer" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "title": "Open AIAgent Message Phase", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentModeKind": { + "description": "Initial collaboration mode to use when the TUI starts.", + "enum": [ + "plan", + "default" + ], + "title": "Open AIAgent Mode Kind", + "type": "string", + "x-enum-display": "segmented", + "x-enum-icons": { + "default": "shield", + "plan": "list-dashes" + }, + "x-enum-labels": { + "default": "Default", + "plan": "Plan" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentMultiAgentMode": { + "description": "Controls the effective multi-agent delegation instructions for a turn. `custom` means the configured mode hint defines the policy instead of a built-in policy.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "oneOf": [ + { + "description": "Open AIAgent Multi Agent Mode configuration. See the linked native reference for semantics and availability.", + "enum": [ + "explicitRequestOnly", + "proactive" + ], + "title": "Open AIAgent Multi Agent Mode", + "type": "string", + "x-enum-display": "segmented", + "x-enum-labels": { + "explicitRequestOnly": "Explicit Request Only", + "proactive": "Proactive" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, - "projectId": { - "title": "Project ID", "description": "Codex project identifier associated with the thread.", - "type": "string", "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 220, - "x-captain-option": {"nativeName": "thread/start.projectId", "support": "unsupported", "note": "Captain does not set a native Codex project identifier."} + { + "additionalProperties": false, + "description": "Open AIAgent Multi Agent Mode configuration. See the linked native reference for semantics and availability.", + "properties": { + "custom": { + "description": "Custom configuration. See the linked native reference for semantics and availability.", + "title": "Custom", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "custom" + ], + "title": "CustomMultiAgentMode", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "title": "Open AIAgent Multi Agent Mode", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentNetworkAccess": { + "description": "Open AIAgent Network Access configuration. See the linked native reference for semantics and availability.", + "enum": [ + "restricted", + "enabled" + ], + "title": "Open AIAgent Network Access", + "type": "string", + "x-enum-display": "segmented", + "x-enum-icons": { + "enabled": "check", + "restricted": "shield" + }, + "x-enum-labels": { + "enabled": "Enabled", + "restricted": "Restricted" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentPersonality": { + "description": "Deprecated: `friendly` and `pragmatic` no longer select a style.", + "enum": [ + "none", + "friendly", + "pragmatic" + ], + "title": "Open AIAgent Personality", + "type": "string", + "x-enum-display": "segmented", + "x-enum-labels": { + "friendly": "Friendly", + "none": "None", + "pragmatic": "Pragmatic" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentReasoningEffort": { + "description": "A non-empty reasoning effort value advertised by the model.", + "minLength": 1, + "title": "Open AIAgent Reasoning Effort", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentReasoningItemContent": { + "description": "Open AIAgent Reasoning Item Content configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "oneOf": [ + { + "description": "Open AIAgent Reasoning Item Content configuration. See the linked native reference for semantics and availability.", + "properties": { + "text": { + "description": "Text configuration. See the linked native reference for semantics and availability.", + "title": "Text", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "reasoning_text" + ], + "title": "ReasoningTextReasoningItemContentType", + "type": "string", + "x-clicky-order": 20, + "x-enum-display": "segmented", + "x-enum-labels": { + "reasoning_text": "Reasoning text" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "text", + "type" + ], + "title": "ReasoningTextReasoningItemContent", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, - "runtimeWorkspaceRoots": { - "title": "Runtime workspace roots", "description": "Replacement runtime workspace roots for the Codex thread; paths must be absolute.", - "type": "array", "items": {"type": "string", "format": "path"}, "x-clicky-section": "workspace", "x-clicky-order": 230, "x-array-display": "list", - "x-captain-option": {"nativeName": "thread/start.runtimeWorkspaceRoots", "support": "mapped", "specPath": "permissions.directories"} + { + "description": "Open AIAgent Reasoning Item Content configuration. See the linked native reference for semantics and availability.", + "properties": { + "text": { + "description": "Text configuration. See the linked native reference for semantics and availability.", + "title": "Text", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "text" + ], + "title": "TextReasoningItemContentType", + "type": "string", + "x-clicky-order": 20, + "x-enum-display": "segmented", + "x-enum-labels": { + "text": "Text" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "text", + "type" + ], + "title": "TextReasoningItemContent", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "title": "Open AIAgent Reasoning Item Content", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentReasoningItemReasoningSummary": { + "description": "Open AIAgent Reasoning Item Reasoning Summary configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "oneOf": [ + { + "description": "Open AIAgent Reasoning Item Reasoning Summary configuration. See the linked native reference for semantics and availability.", + "properties": { + "text": { + "description": "Text configuration. See the linked native reference for semantics and availability.", + "title": "Text", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "summary_text" + ], + "title": "SummaryTextReasoningItemReasoningSummaryType", + "type": "string", + "x-clicky-order": 20, + "x-enum-display": "segmented", + "x-enum-labels": { + "summary_text": "Summary text" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "text", + "type" + ], + "title": "SummaryTextReasoningItemReasoningSummary", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "title": "Open AIAgent Reasoning Item Reasoning Summary", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentReasoningSummary": { + "description": "A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#reasoning-summaries", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "oneOf": [ + { + "description": "Open AIAgent Reasoning Summary configuration. See the linked native reference for semantics and availability.", + "enum": [ + "auto", + "concise", + "detailed" + ], + "title": "Open AIAgent Reasoning Summary", + "type": "string", + "x-enum-display": "segmented", + "x-enum-labels": { + "auto": "Auto", + "concise": "Concise", + "detailed": "Detailed" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, - "selectedCapabilityRoots": { - "title": "Selected capability roots", "description": "Filesystem roots selected for capability discovery.", - "type": "array", "items": {"type": "string", "format": "path"}, "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 240, "x-array-display": "list", - "x-captain-option": {"nativeName": "thread/start.selectedCapabilityRoots", "support": "unsupported", "note": "Captain does not select native Codex capability roots."} + { + "description": "Option to disable reasoning summaries.", + "enum": [ + "none" + ], + "title": "Open AIAgent Reasoning Summary", + "type": "string", + "x-enum-display": "segmented", + "x-enum-labels": { + "none": "None" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "title": "Open AIAgent Reasoning Summary", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentResponseItem": { + "description": "Open AIAgent Response Item configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "oneOf": [ + { + "description": "Open AIAgent Response Item configuration. See the linked native reference for semantics and availability.", + "properties": { + "id": { + "description": "Id configuration. See the linked native reference for semantics and availability.", + "title": "Id", + "type": [ + "string", + "null" + ], + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "role": { + "description": "Role configuration. See the linked native reference for semantics and availability.", + "title": "Role", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "tools": { + "description": "Tools configuration. See the linked native reference for semantics and availability.", + "items": true, + "title": "Tools", + "type": "array", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "additional_tools" + ], + "title": "AdditionalToolsResponseItemType", + "type": "string", + "x-clicky-order": 40, + "x-enum-display": "segmented", + "x-enum-labels": { + "additional_tools": "Additional tools" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "role", + "tools", + "type" + ], + "title": "AdditionalToolsResponseItem", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, - "serviceName": { - "title": "Service name", "description": "Service identity attached to the Codex thread.", - "type": "string", "readOnly": true, "x-clicky-section": "environment", "x-clicky-order": 250, - "x-captain-option": {"nativeName": "thread/start.serviceName", "support": "unsupported", "note": "Captain does not send a Codex service name."} + { + "description": "Open AIAgent Response Item configuration. See the linked native reference for semantics and availability.", + "properties": { + "content": { + "description": "Content configuration. See the linked native reference for semantics and availability.", + "items": { + "$ref": "#/$defs/OpenAIAgentContentItem", + "description": "Content value configuration. See the linked native reference for semantics and availability.", + "title": "Content value", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "title": "Content", + "type": "array", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "encrypted_content": { + "description": "Encrypted content configuration. See the linked native reference for semantics and availability.", + "title": "Encrypted content", + "type": [ + "string", + "null" + ], + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "id": { + "description": "Id configuration. See the linked native reference for semantics and availability.", + "title": "Id", + "type": [ + "string", + "null" + ], + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "internal_chat_message_metadata_passthrough": { + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentInternalChatMessageMetadataPassthrough", + "description": "Internal chat message metadata passthrough configuration. See the linked native reference for semantics and availability.", + "title": "Internal chat message metadata passthrough", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Internal chat message metadata passthrough configuration. See the linked native reference for semantics and availability.", + "title": "Internal chat message metadata passthrough", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Internal chat message metadata passthrough configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Internal chat message metadata passthrough", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "phase": { + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentMessagePhase", + "description": "Phase configuration. See the linked native reference for semantics and availability.", + "title": "Phase", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Phase configuration. See the linked native reference for semantics and availability.", + "title": "Phase", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Phase configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Phase", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "role": { + "description": "Role configuration. See the linked native reference for semantics and availability.", + "title": "Role", + "type": "string", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "status": { + "description": "Status configuration. See the linked native reference for semantics and availability.", + "title": "Status", + "type": [ + "string", + "null" + ], + "x-clicky-order": 70, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "message" + ], + "title": "MessageResponseItemType", + "type": "string", + "x-clicky-order": 80, + "x-enum-display": "segmented", + "x-enum-labels": { + "message": "Message" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "content", + "role", + "type" + ], + "title": "MessageResponseItem", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, - "serviceTier": { - "title": "Service tier", "description": "Processing tier selected for the Codex thread.", - "type": "string", "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 260, - "x-captain-option": {"nativeName": "thread/start.serviceTier", "support": "unsupported", "note": "Captain does not select a Codex service tier."} + { + "description": "Open AIAgent Response Item configuration. See the linked native reference for semantics and availability.", + "properties": { + "author": { + "description": "Author configuration. See the linked native reference for semantics and availability.", + "title": "Author", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "content": { + "description": "Content configuration. See the linked native reference for semantics and availability.", + "items": { + "$ref": "#/$defs/OpenAIAgentAgentMessageInputContent", + "description": "Content value configuration. See the linked native reference for semantics and availability.", + "title": "Content value", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "title": "Content", + "type": "array", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "id": { + "description": "Id configuration. See the linked native reference for semantics and availability.", + "title": "Id", + "type": [ + "string", + "null" + ], + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "internal_chat_message_metadata_passthrough": { + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentInternalChatMessageMetadataPassthrough", + "description": "Internal chat message metadata passthrough configuration. See the linked native reference for semantics and availability.", + "title": "Internal chat message metadata passthrough", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Internal chat message metadata passthrough configuration. See the linked native reference for semantics and availability.", + "title": "Internal chat message metadata passthrough", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Internal chat message metadata passthrough configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Internal chat message metadata passthrough", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "recipient": { + "description": "Recipient configuration. See the linked native reference for semantics and availability.", + "title": "Recipient", + "type": "string", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "agent_message" + ], + "title": "AgentMessageResponseItemType", + "type": "string", + "x-clicky-order": 60, + "x-enum-display": "segmented", + "x-enum-labels": { + "agent_message": "Agent message" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "author", + "content", + "recipient", + "type" + ], + "title": "AgentMessageResponseItem", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, - "sessionStartSource": { - "title": "Session start source", "description": "Source label describing how the session was launched.", - "type": "string", "readOnly": true, "x-clicky-section": "environment", "x-clicky-order": 270, - "x-captain-option": {"nativeName": "thread/start.sessionStartSource", "support": "unsupported", "note": "Captain does not override the native session-start source."} + { + "description": "Open AIAgent Response Item configuration. See the linked native reference for semantics and availability.", + "properties": { + "content": { + "default": null, + "description": "Content configuration. See the linked native reference for semantics and availability.", + "items": { + "$ref": "#/$defs/OpenAIAgentReasoningItemContent", + "description": "Content value configuration. See the linked native reference for semantics and availability.", + "title": "Content value", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "title": "Content", + "type": [ + "array", + "null" + ], + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "encrypted_content": { + "description": "Encrypted content configuration. See the linked native reference for semantics and availability.", + "title": "Encrypted content", + "type": [ + "string", + "null" + ], + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "id": { + "description": "Id configuration. See the linked native reference for semantics and availability.", + "title": "Id", + "type": [ + "string", + "null" + ], + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "internal_chat_message_metadata_passthrough": { + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentInternalChatMessageMetadataPassthrough", + "description": "Internal chat message metadata passthrough configuration. See the linked native reference for semantics and availability.", + "title": "Internal chat message metadata passthrough", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Internal chat message metadata passthrough configuration. See the linked native reference for semantics and availability.", + "title": "Internal chat message metadata passthrough", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Internal chat message metadata passthrough configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Internal chat message metadata passthrough", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "summary": { + "description": "Summary configuration. See the linked native reference for semantics and availability.", + "items": { + "$ref": "#/$defs/OpenAIAgentReasoningItemReasoningSummary", + "description": "Summary value configuration. See the linked native reference for semantics and availability.", + "title": "Summary value", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "title": "Summary", + "type": "array", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "reasoning" + ], + "title": "ReasoningResponseItemType", + "type": "string", + "x-clicky-order": 60, + "x-enum-display": "segmented", + "x-enum-labels": { + "reasoning": "Reasoning" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "summary", + "type" + ], + "title": "ReasoningResponseItem", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, - "threadSource": { - "title": "Thread source", "description": "Native source label attached to the Codex thread.", - "type": "string", "readOnly": true, "x-clicky-section": "environment", "x-clicky-order": 280, - "x-captain-option": {"nativeName": "thread/start.threadSource", "support": "unsupported", "note": "Captain does not set a Codex thread-source label."} + { + "description": "Open AIAgent Response Item configuration. See the linked native reference for semantics and availability.", + "properties": { + "action": { + "$ref": "#/$defs/OpenAIAgentLocalShellAction", + "description": "Action configuration. See the linked native reference for semantics and availability.", + "title": "Action", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "call_id": { + "description": "Set when using the Responses API.", + "title": "Call id", + "type": [ + "string", + "null" + ], + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "encrypted_content": { + "description": "Encrypted content configuration. See the linked native reference for semantics and availability.", + "title": "Encrypted content", + "type": [ + "string", + "null" + ], + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "id": { + "description": "Legacy id field retained for compatibility with older payloads.", + "title": "Id", + "type": [ + "string", + "null" + ], + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "internal_chat_message_metadata_passthrough": { + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentInternalChatMessageMetadataPassthrough", + "description": "Internal chat message metadata passthrough configuration. See the linked native reference for semantics and availability.", + "title": "Internal chat message metadata passthrough", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Internal chat message metadata passthrough configuration. See the linked native reference for semantics and availability.", + "title": "Internal chat message metadata passthrough", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Internal chat message metadata passthrough configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Internal chat message metadata passthrough", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "status": { + "$ref": "#/$defs/OpenAIAgentLocalShellStatus", + "description": "Status configuration. See the linked native reference for semantics and availability.", + "title": "Status", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "local_shell_call" + ], + "title": "LocalShellCallResponseItemType", + "type": "string", + "x-clicky-order": 70, + "x-enum-display": "segmented", + "x-enum-labels": { + "local_shell_call": "Local shell call" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "action", + "status", + "type" + ], + "title": "LocalShellCallResponseItem", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Open AIAgent Response Item configuration. See the linked native reference for semantics and availability.", + "properties": { + "arguments": { + "description": "Arguments configuration. See the linked native reference for semantics and availability.", + "title": "Arguments", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "call_id": { + "description": "Call id configuration. See the linked native reference for semantics and availability.", + "title": "Call id", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "encrypted_content": { + "description": "Encrypted content configuration. See the linked native reference for semantics and availability.", + "title": "Encrypted content", + "type": [ + "string", + "null" + ], + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "encrypted_function_args": { + "description": "Encrypted function args configuration. See the linked native reference for semantics and availability.", + "items": { + "description": "Encrypted function args value configuration. See the linked native reference for semantics and availability.", + "title": "Encrypted function args value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "title": "Encrypted function args", + "type": [ + "array", + "null" + ], + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "id": { + "description": "Id configuration. See the linked native reference for semantics and availability.", + "title": "Id", + "type": [ + "string", + "null" + ], + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "internal_chat_message_metadata_passthrough": { + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentInternalChatMessageMetadataPassthrough", + "description": "Internal chat message metadata passthrough configuration. See the linked native reference for semantics and availability.", + "title": "Internal chat message metadata passthrough", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Internal chat message metadata passthrough configuration. See the linked native reference for semantics and availability.", + "title": "Internal chat message metadata passthrough", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Internal chat message metadata passthrough configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Internal chat message metadata passthrough", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "name": { + "description": "Name configuration. See the linked native reference for semantics and availability.", + "title": "Name", + "type": "string", + "x-clicky-order": 70, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "namespace": { + "description": "Namespace configuration. See the linked native reference for semantics and availability.", + "title": "Namespace", + "type": [ + "string", + "null" + ], + "x-clicky-order": 80, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "status": { + "description": "Status configuration. See the linked native reference for semantics and availability.", + "title": "Status", + "type": [ + "string", + "null" + ], + "x-clicky-order": 90, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "function_call" + ], + "title": "FunctionCallResponseItemType", + "type": "string", + "x-clicky-order": 100, + "x-enum-display": "segmented", + "x-enum-labels": { + "function_call": "Function call" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "arguments", + "call_id", + "name", + "type" + ], + "title": "FunctionCallResponseItem", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Open AIAgent Response Item configuration. See the linked native reference for semantics and availability.", + "properties": { + "arguments": true, + "call_id": { + "description": "Call id configuration. See the linked native reference for semantics and availability.", + "title": "Call id", + "type": [ + "string", + "null" + ], + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "encrypted_content": { + "description": "Encrypted content configuration. See the linked native reference for semantics and availability.", + "title": "Encrypted content", + "type": [ + "string", + "null" + ], + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "execution": { + "description": "Execution configuration. See the linked native reference for semantics and availability.", + "title": "Execution", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "id": { + "description": "Id configuration. See the linked native reference for semantics and availability.", + "title": "Id", + "type": [ + "string", + "null" + ], + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "internal_chat_message_metadata_passthrough": { + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentInternalChatMessageMetadataPassthrough", + "description": "Internal chat message metadata passthrough configuration. See the linked native reference for semantics and availability.", + "title": "Internal chat message metadata passthrough", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Internal chat message metadata passthrough configuration. See the linked native reference for semantics and availability.", + "title": "Internal chat message metadata passthrough", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Internal chat message metadata passthrough configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Internal chat message metadata passthrough", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "status": { + "description": "Status configuration. See the linked native reference for semantics and availability.", + "title": "Status", + "type": [ + "string", + "null" + ], + "x-clicky-order": 70, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "tool_search_call" + ], + "title": "ToolSearchCallResponseItemType", + "type": "string", + "x-clicky-order": 80, + "x-enum-display": "segmented", + "x-enum-labels": { + "tool_search_call": "Tool search call" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "arguments", + "execution", + "type" + ], + "title": "ToolSearchCallResponseItem", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Open AIAgent Response Item configuration. See the linked native reference for semantics and availability.", + "properties": { + "call_id": { + "description": "Call id configuration. See the linked native reference for semantics and availability.", + "title": "Call id", + "type": [ + "string", + "null" + ], + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "id": { + "description": "Id configuration. See the linked native reference for semantics and availability.", + "title": "Id", + "type": [ + "string", + "null" + ], + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "internal_chat_message_metadata_passthrough": { + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentInternalChatMessageMetadataPassthrough", + "description": "Internal chat message metadata passthrough configuration. See the linked native reference for semantics and availability.", + "title": "Internal chat message metadata passthrough", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Internal chat message metadata passthrough configuration. See the linked native reference for semantics and availability.", + "title": "Internal chat message metadata passthrough", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Internal chat message metadata passthrough configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Internal chat message metadata passthrough", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "name": { + "description": "Name configuration. See the linked native reference for semantics and availability.", + "title": "Name", + "type": [ + "string", + "null" + ], + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "namespace": { + "description": "Namespace configuration. See the linked native reference for semantics and availability.", + "title": "Namespace", + "type": [ + "string", + "null" + ], + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "output": { + "$ref": "#/$defs/OpenAIAgentFunctionCallOutputBody", + "description": "Output configuration. See the linked native reference for semantics and availability.", + "title": "Output", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "function_call_output" + ], + "title": "FunctionCallOutputResponseItemType", + "type": "string", + "x-clicky-order": 70, + "x-enum-display": "segmented", + "x-enum-labels": { + "function_call_output": "Function call output" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "output", + "type" + ], + "title": "FunctionCallOutputResponseItem", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Open AIAgent Response Item configuration. See the linked native reference for semantics and availability.", + "properties": { + "call_id": { + "description": "Call id configuration. See the linked native reference for semantics and availability.", + "title": "Call id", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "encrypted_content": { + "description": "Encrypted content configuration. See the linked native reference for semantics and availability.", + "title": "Encrypted content", + "type": [ + "string", + "null" + ], + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "id": { + "description": "Id configuration. See the linked native reference for semantics and availability.", + "title": "Id", + "type": [ + "string", + "null" + ], + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "input": { + "description": "Input configuration. See the linked native reference for semantics and availability.", + "title": "Input", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "internal_chat_message_metadata_passthrough": { + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentInternalChatMessageMetadataPassthrough", + "description": "Internal chat message metadata passthrough configuration. See the linked native reference for semantics and availability.", + "title": "Internal chat message metadata passthrough", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Internal chat message metadata passthrough configuration. See the linked native reference for semantics and availability.", + "title": "Internal chat message metadata passthrough", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Internal chat message metadata passthrough configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Internal chat message metadata passthrough", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "name": { + "description": "Name configuration. See the linked native reference for semantics and availability.", + "title": "Name", + "type": "string", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "namespace": { + "description": "Namespace configuration. See the linked native reference for semantics and availability.", + "title": "Namespace", + "type": [ + "string", + "null" + ], + "x-clicky-order": 70, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "status": { + "description": "Status configuration. See the linked native reference for semantics and availability.", + "title": "Status", + "type": [ + "string", + "null" + ], + "x-clicky-order": 80, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "custom_tool_call" + ], + "title": "CustomToolCallResponseItemType", + "type": "string", + "x-clicky-order": 90, + "x-enum-display": "segmented", + "x-enum-labels": { + "custom_tool_call": "Custom tool call" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "call_id", + "input", + "name", + "type" + ], + "title": "CustomToolCallResponseItem", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Open AIAgent Response Item configuration. See the linked native reference for semantics and availability.", + "properties": { + "call_id": { + "description": "Call id configuration. See the linked native reference for semantics and availability.", + "title": "Call id", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "id": { + "description": "Id configuration. See the linked native reference for semantics and availability.", + "title": "Id", + "type": [ + "string", + "null" + ], + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "internal_chat_message_metadata_passthrough": { + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentInternalChatMessageMetadataPassthrough", + "description": "Internal chat message metadata passthrough configuration. See the linked native reference for semantics and availability.", + "title": "Internal chat message metadata passthrough", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Internal chat message metadata passthrough configuration. See the linked native reference for semantics and availability.", + "title": "Internal chat message metadata passthrough", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Internal chat message metadata passthrough configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Internal chat message metadata passthrough", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "name": { + "description": "Name configuration. See the linked native reference for semantics and availability.", + "title": "Name", + "type": [ + "string", + "null" + ], + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "output": { + "$ref": "#/$defs/OpenAIAgentFunctionCallOutputBody", + "description": "Output configuration. See the linked native reference for semantics and availability.", + "title": "Output", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "custom_tool_call_output" + ], + "title": "CustomToolCallOutputResponseItemType", + "type": "string", + "x-clicky-order": 60, + "x-enum-display": "segmented", + "x-enum-labels": { + "custom_tool_call_output": "Custom tool call output" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "call_id", + "output", + "type" + ], + "title": "CustomToolCallOutputResponseItem", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Open AIAgent Response Item configuration. See the linked native reference for semantics and availability.", + "properties": { + "call_id": { + "description": "Call id configuration. See the linked native reference for semantics and availability.", + "title": "Call id", + "type": [ + "string", + "null" + ], + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "execution": { + "description": "Execution configuration. See the linked native reference for semantics and availability.", + "title": "Execution", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "id": { + "description": "Id configuration. See the linked native reference for semantics and availability.", + "title": "Id", + "type": [ + "string", + "null" + ], + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "internal_chat_message_metadata_passthrough": { + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentInternalChatMessageMetadataPassthrough", + "description": "Internal chat message metadata passthrough configuration. See the linked native reference for semantics and availability.", + "title": "Internal chat message metadata passthrough", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Internal chat message metadata passthrough configuration. See the linked native reference for semantics and availability.", + "title": "Internal chat message metadata passthrough", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Internal chat message metadata passthrough configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Internal chat message metadata passthrough", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "status": { + "description": "Status configuration. See the linked native reference for semantics and availability.", + "title": "Status", + "type": "string", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "tools": { + "description": "Tools configuration. See the linked native reference for semantics and availability.", + "items": true, + "title": "Tools", + "type": "array", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "tool_search_output" + ], + "title": "ToolSearchOutputResponseItemType", + "type": "string", + "x-clicky-order": 70, + "x-enum-display": "segmented", + "x-enum-labels": { + "tool_search_output": "Tool search output" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "execution", + "status", + "tools", + "type" + ], + "title": "ToolSearchOutputResponseItem", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Open AIAgent Response Item configuration. See the linked native reference for semantics and availability.", + "properties": { + "action": { + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentResponsesApiWebSearchAction", + "description": "Action configuration. See the linked native reference for semantics and availability.", + "title": "Action", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Action configuration. See the linked native reference for semantics and availability.", + "title": "Action", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Action configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Action", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "encrypted_content": { + "description": "Encrypted content configuration. See the linked native reference for semantics and availability.", + "title": "Encrypted content", + "type": [ + "string", + "null" + ], + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "id": { + "description": "Id configuration. See the linked native reference for semantics and availability.", + "title": "Id", + "type": [ + "string", + "null" + ], + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "internal_chat_message_metadata_passthrough": { + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentInternalChatMessageMetadataPassthrough", + "description": "Internal chat message metadata passthrough configuration. See the linked native reference for semantics and availability.", + "title": "Internal chat message metadata passthrough", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Internal chat message metadata passthrough configuration. See the linked native reference for semantics and availability.", + "title": "Internal chat message metadata passthrough", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Internal chat message metadata passthrough configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Internal chat message metadata passthrough", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "status": { + "description": "Status configuration. See the linked native reference for semantics and availability.", + "title": "Status", + "type": [ + "string", + "null" + ], + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "web_search_call" + ], + "title": "WebSearchCallResponseItemType", + "type": "string", + "x-clicky-order": 60, + "x-enum-display": "segmented", + "x-enum-labels": { + "web_search_call": "Web search call" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type" + ], + "title": "WebSearchCallResponseItem", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Open AIAgent Response Item configuration. See the linked native reference for semantics and availability.", + "properties": { + "encrypted_content": { + "description": "Encrypted content configuration. See the linked native reference for semantics and availability.", + "title": "Encrypted content", + "type": [ + "string", + "null" + ], + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "id": { + "description": "Id configuration. See the linked native reference for semantics and availability.", + "title": "Id", + "type": [ + "string", + "null" + ], + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "internal_chat_message_metadata_passthrough": { + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentInternalChatMessageMetadataPassthrough", + "description": "Internal chat message metadata passthrough configuration. See the linked native reference for semantics and availability.", + "title": "Internal chat message metadata passthrough", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Internal chat message metadata passthrough configuration. See the linked native reference for semantics and availability.", + "title": "Internal chat message metadata passthrough", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Internal chat message metadata passthrough configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Internal chat message metadata passthrough", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "result": { + "description": "Result configuration. See the linked native reference for semantics and availability.", + "title": "Result", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "revised_prompt": { + "description": "Revised prompt configuration. See the linked native reference for semantics and availability.", + "title": "Revised prompt", + "type": [ + "string", + "null" + ], + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "status": { + "description": "Status configuration. See the linked native reference for semantics and availability.", + "title": "Status", + "type": "string", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "image_generation_call" + ], + "title": "ImageGenerationCallResponseItemType", + "type": "string", + "x-clicky-order": 70, + "x-enum-display": "segmented", + "x-enum-labels": { + "image_generation_call": "Image generation call" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "result", + "status", + "type" + ], + "title": "ImageGenerationCallResponseItem", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Open AIAgent Response Item configuration. See the linked native reference for semantics and availability.", + "properties": { + "encrypted_content": { + "description": "Encrypted content configuration. See the linked native reference for semantics and availability.", + "title": "Encrypted content", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "id": { + "description": "Id configuration. See the linked native reference for semantics and availability.", + "title": "Id", + "type": [ + "string", + "null" + ], + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "internal_chat_message_metadata_passthrough": { + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentInternalChatMessageMetadataPassthrough", + "description": "Internal chat message metadata passthrough configuration. See the linked native reference for semantics and availability.", + "title": "Internal chat message metadata passthrough", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Internal chat message metadata passthrough configuration. See the linked native reference for semantics and availability.", + "title": "Internal chat message metadata passthrough", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Internal chat message metadata passthrough configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Internal chat message metadata passthrough", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "compaction" + ], + "title": "CompactionResponseItemType", + "type": "string", + "x-clicky-order": 40, + "x-enum-display": "segmented", + "x-enum-labels": { + "compaction": "Compaction" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "encrypted_content", + "type" + ], + "title": "CompactionResponseItem", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "A durable input control interpreted by the backend at its position in history.", + "properties": { + "reasoning": { + "$ref": "#/$defs/OpenAIAgentConfigurationReasoning", + "description": "Reasoning configuration. See the linked native reference for semantics and availability.", + "title": "Reasoning", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "configuration_update" + ], + "title": "ConfigurationUpdateResponseItemType", + "type": "string", + "x-clicky-order": 20, + "x-enum-display": "segmented", + "x-enum-labels": { + "configuration_update": "Configuration update" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "reasoning", + "type" + ], + "title": "ConfigurationUpdateResponseItem", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Open AIAgent Response Item configuration. See the linked native reference for semantics and availability.", + "properties": { + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "compaction_trigger" + ], + "title": "CompactionTriggerResponseItemType", + "type": "string", + "x-clicky-order": 10, + "x-enum-display": "segmented", + "x-enum-labels": { + "compaction_trigger": "Compaction trigger" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type" + ], + "title": "CompactionTriggerResponseItem", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Open AIAgent Response Item configuration. See the linked native reference for semantics and availability.", + "properties": { + "encrypted_content": { + "description": "Encrypted content configuration. See the linked native reference for semantics and availability.", + "title": "Encrypted content", + "type": [ + "string", + "null" + ], + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "id": { + "description": "Id configuration. See the linked native reference for semantics and availability.", + "title": "Id", + "type": [ + "string", + "null" + ], + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "internal_chat_message_metadata_passthrough": { + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentInternalChatMessageMetadataPassthrough", + "description": "Internal chat message metadata passthrough configuration. See the linked native reference for semantics and availability.", + "title": "Internal chat message metadata passthrough", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Internal chat message metadata passthrough configuration. See the linked native reference for semantics and availability.", + "title": "Internal chat message metadata passthrough", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Internal chat message metadata passthrough configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Internal chat message metadata passthrough", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "context_compaction" + ], + "title": "ContextCompactionResponseItemType", + "type": "string", + "x-clicky-order": 40, + "x-enum-display": "segmented", + "x-enum-labels": { + "context_compaction": "Context compaction" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type" + ], + "title": "ContextCompactionResponseItem", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Open AIAgent Response Item configuration. See the linked native reference for semantics and availability.", + "properties": { + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "other" + ], + "title": "OtherResponseItemType", + "type": "string", + "x-clicky-order": 10, + "x-enum-display": "segmented", + "x-enum-labels": { + "other": "Other" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type" + ], + "title": "OtherResponseItem", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } } + ], + "title": "Open AIAgent Response Item", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] } }, - "threadResume": { - "title": "Thread resume", "description": "Parameters used to resume an existing Codex app-server thread.", - "type": "object", "additionalProperties": false, + "OpenAIAgentResponsesApiWebSearchAction": { + "description": "Open AIAgent Responses API Web Search Action configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "oneOf": [ + { + "description": "Open AIAgent Responses API Web Search Action configuration. See the linked native reference for semantics and availability.", + "properties": { + "queries": { + "description": "Queries configuration. See the linked native reference for semantics and availability.", + "items": { + "description": "Queries value configuration. See the linked native reference for semantics and availability.", + "title": "Queries value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "title": "Queries", + "type": [ + "array", + "null" + ], + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "query": { + "description": "Query configuration. See the linked native reference for semantics and availability.", + "title": "Query", + "type": [ + "string", + "null" + ], + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "search" + ], + "title": "SearchResponsesApiWebSearchActionType", + "type": "string", + "x-clicky-order": 30, + "x-enum-display": "segmented", + "x-enum-labels": { + "search": "Search" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type" + ], + "title": "SearchResponsesApiWebSearchAction", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Open AIAgent Responses API Web Search Action configuration. See the linked native reference for semantics and availability.", + "properties": { + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "open_page" + ], + "title": "OpenPageResponsesApiWebSearchActionType", + "type": "string", + "x-clicky-order": 10, + "x-enum-display": "segmented", + "x-enum-labels": { + "open_page": "Open page" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "Url configuration. See the linked native reference for semantics and availability.", + "title": "Url", + "type": [ + "string", + "null" + ], + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type" + ], + "title": "OpenPageResponsesApiWebSearchAction", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Open AIAgent Responses API Web Search Action configuration. See the linked native reference for semantics and availability.", + "properties": { + "pattern": { + "description": "Pattern configuration. See the linked native reference for semantics and availability.", + "title": "Pattern", + "type": [ + "string", + "null" + ], + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "find_in_page" + ], + "title": "FindInPageResponsesApiWebSearchActionType", + "type": "string", + "x-clicky-order": 20, + "x-enum-display": "segmented", + "x-enum-labels": { + "find_in_page": "Find in page" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "Url configuration. See the linked native reference for semantics and availability.", + "title": "Url", + "type": [ + "string", + "null" + ], + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type" + ], + "title": "FindInPageResponsesApiWebSearchAction", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Open AIAgent Responses API Web Search Action configuration. See the linked native reference for semantics and availability.", + "properties": { + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "other" + ], + "title": "OtherResponsesApiWebSearchActionType", + "type": "string", + "x-clicky-order": 10, + "x-enum-display": "segmented", + "x-enum-labels": { + "other": "Other" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type" + ], + "title": "OtherResponsesApiWebSearchAction", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "title": "Open AIAgent Responses API Web Search Action", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentSandboxMode": { + "description": "Open AIAgent Sandbox Mode configuration. See the linked native reference for semantics and availability.", + "enum": [ + "read-only", + "workspace-write", + "danger-full-access" + ], + "title": "Open AIAgent Sandbox Mode", + "type": "string", + "x-enum-display": "segmented", + "x-enum-icons": { + "danger-full-access": "lock-open", + "read-only": "lock", + "workspace-write": "folder" + }, + "x-enum-labels": { + "danger-full-access": "Danger full access", + "read-only": "Read only", + "workspace-write": "Workspace write" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentSandboxPolicy": { + "description": "Open AIAgent Sandbox Policy configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "oneOf": [ + { + "description": "Open AIAgent Sandbox Policy configuration. See the linked native reference for semantics and availability.", + "properties": { + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "dangerFullAccess" + ], + "title": "DangerFullAccessSandboxPolicyType", + "type": "string", + "x-clicky-order": 10, + "x-enum-display": "segmented", + "x-enum-labels": { + "dangerFullAccess": "Danger Full Access" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type" + ], + "title": "DangerFullAccessSandboxPolicy", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Open AIAgent Sandbox Policy configuration. See the linked native reference for semantics and availability.", + "properties": { + "networkAccess": { + "default": false, + "description": "Network Access configuration. See the linked native reference for semantics and availability.", + "title": "Network Access", + "type": "boolean", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "readOnly" + ], + "title": "ReadOnlySandboxPolicyType", + "type": "string", + "x-clicky-order": 20, + "x-enum-display": "segmented", + "x-enum-labels": { + "readOnly": "Read Only" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type" + ], + "title": "ReadOnlySandboxPolicy", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Open AIAgent Sandbox Policy configuration. See the linked native reference for semantics and availability.", + "properties": { + "networkAccess": { + "allOf": [ + { + "$ref": "#/$defs/OpenAIAgentNetworkAccess", + "description": "Network Access configuration. See the linked native reference for semantics and availability.", + "title": "Network Access", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "default": "restricted", + "description": "Network Access configuration. See the linked native reference for semantics and availability.", + "title": "Network Access", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "externalSandbox" + ], + "title": "ExternalSandboxSandboxPolicyType", + "type": "string", + "x-clicky-order": 20, + "x-enum-display": "segmented", + "x-enum-labels": { + "externalSandbox": "External Sandbox" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type" + ], + "title": "ExternalSandboxSandboxPolicy", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Open AIAgent Sandbox Policy configuration. See the linked native reference for semantics and availability.", + "properties": { + "excludeSlashTmp": { + "default": false, + "description": "Exclude Slash Tmp configuration. See the linked native reference for semantics and availability.", + "title": "Exclude Slash Tmp", + "type": "boolean", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "excludeTmpdirEnvVar": { + "default": false, + "description": "Exclude Tmpdir Env Var configuration. See the linked native reference for semantics and availability.", + "title": "Exclude Tmpdir Env Var", + "type": "boolean", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "networkAccess": { + "default": false, + "description": "Network Access configuration. See the linked native reference for semantics and availability.", + "title": "Network Access", + "type": "boolean", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "workspaceWrite" + ], + "title": "WorkspaceWriteSandboxPolicyType", + "type": "string", + "x-clicky-order": 40, + "x-enum-display": "segmented", + "x-enum-labels": { + "workspaceWrite": "Workspace Write" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "writableRoots": { + "default": [], + "description": "Writable Roots configuration. See the linked native reference for semantics and availability.", + "items": { + "$ref": "#/$defs/OpenAIAgentAbsolutePathBuf", + "description": "Writable Roots value configuration. See the linked native reference for semantics and availability.", + "title": "Writable Roots value", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "title": "Writable Roots", + "type": "array", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type" + ], + "title": "WorkspaceWriteSandboxPolicy", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "title": "Open AIAgent Sandbox Policy", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentSelectedCapabilityRoot": { + "description": "A user-selected root that can expose one or more runtime capabilities.", "properties": { - "threadId": { - "title": "Thread ID", "description": "Codex thread identifier to resume.", - "type": "string", "x-clicky-section": "workspace", "x-clicky-order": 290, - "x-captain-option": {"nativeName": "thread/resume.threadId", "support": "mapped", "specPath": "sessionId"} + "id": { + "description": "Stable identifier supplied by the capability selection platform.", + "title": "Id", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "location": { + "allOf": [ + { + "$ref": "#/$defs/OpenAIAgentCapabilityRootLocation", + "description": "Location configuration. See the linked native reference for semantics and availability.", + "title": "Location", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Where the selected root can be resolved.", + "title": "Location", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "id", + "location" + ], + "title": "Open AIAgent Selected Capability Root", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentSettings": { + "description": "Settings for a collaboration mode.", + "properties": { + "developer_instructions": { + "description": "Developer instructions configuration. See the linked native reference for semantics and availability.", + "title": "Developer instructions", + "type": [ + "string", + "null" + ], + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "model": { + "description": "Model configuration. See the linked native reference for semantics and availability.", + "title": "Model", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "reasoning_effort": { + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentReasoningEffort", + "description": "Reasoning effort configuration. See the linked native reference for semantics and availability.", + "title": "Reasoning effort", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Reasoning effort configuration. See the linked native reference for semantics and availability.", + "title": "Reasoning effort", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Reasoning effort configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Reasoning effort", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "model" + ], + "title": "Open AIAgent Settings", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentSortDirection": { + "description": "Open AIAgent Sort Direction configuration. See the linked native reference for semantics and availability.", + "enum": [ + "asc", + "desc" + ], + "title": "Open AIAgent Sort Direction", + "type": "string", + "x-enum-display": "segmented", + "x-enum-labels": { + "asc": "Asc", + "desc": "Desc" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentTextElement": { + "description": "Open AIAgent Text Element configuration. See the linked native reference for semantics and availability.", + "properties": { + "byteRange": { + "allOf": [ + { + "$ref": "#/$defs/OpenAIAgentByteRange", + "description": "Byte Range configuration. See the linked native reference for semantics and availability.", + "title": "Byte Range", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Byte range in the parent `text` buffer that this element occupies.", + "title": "Byte Range", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "placeholder": { + "description": "Optional human-readable placeholder for the element, displayed in the UI.", + "title": "Placeholder", + "type": [ + "string", + "null" + ], + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "byteRange" + ], + "title": "Open AIAgent Text Element", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentThreadHistoryMode": { + "description": "Open AIAgent Thread History Mode configuration. See the linked native reference for semantics and availability.", + "enum": [ + "legacy", + "paginated" + ], + "title": "Open AIAgent Thread History Mode", + "type": "string", + "x-enum-display": "segmented", + "x-enum-labels": { + "legacy": "Legacy", + "paginated": "Paginated" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentThreadResumeInitialTurnsPageParams": { + "description": "Open AIAgent Thread Resume Initial Turns Page Params configuration. See the linked native reference for semantics and availability.", + "properties": { + "itemsView": { + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentTurnItemsView", + "description": "Items View configuration. See the linked native reference for semantics and availability.", + "title": "Items View", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Items View configuration. See the linked native reference for semantics and availability.", + "title": "Items View", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "How much item detail to include for each returned turn; defaults to summary.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Items View", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "limit": { + "description": "Optional turn page size.", + "format": "uint32", + "minimum": 0, + "title": "Limit", + "type": [ + "integer", + "null" + ], + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, + "sortDirection": { + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentSortDirection", + "description": "Sort Direction configuration. See the linked native reference for semantics and availability.", + "title": "Sort Direction", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Sort Direction configuration. See the linked native reference for semantics and availability.", + "title": "Sort Direction", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Optional turn pagination direction; defaults to descending.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Sort Direction", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "title": "Open AIAgent Thread Resume Initial Turns Page Params", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentThreadSource": { + "description": "Open AIAgent Thread Source configuration. See the linked native reference for semantics and availability.", + "title": "Open AIAgent Thread Source", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentThreadStartSource": { + "description": "Open AIAgent Thread Start Source configuration. See the linked native reference for semantics and availability.", + "enum": [ + "startup", + "clear" + ], + "title": "Open AIAgent Thread Start Source", + "type": "string", + "x-enum-display": "segmented", + "x-enum-labels": { + "clear": "Clear", + "startup": "Startup" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentTurnEnvironmentParams": { + "description": "Open AIAgent Turn Environment Params configuration. See the linked native reference for semantics and availability.", + "properties": { "cwd": { - "title": "Working directory", "description": "Working directory applied when the thread is resumed.", - "type": "string", "format": "path", "x-clicky-section": "workspace", "x-clicky-order": 300, - "x-captain-option": {"nativeName": "thread/resume.cwd", "support": "mapped", "specPath": "setup.cwd"} + "$ref": "#/$defs/OpenAIAgentLegacyAppPathString", + "description": "Cwd configuration. See the linked native reference for semantics and availability.", + "title": "Cwd", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, - "config": { - "title": "Configuration overrides", "description": "Codex configuration overrides reconstructed for the resumed thread.", - "type": "object", "additionalProperties": true, "readOnly": true, "x-clicky-section": "environment", "x-clicky-order": 310, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "thread/resume.config", "support": "managed", "note": "Captain rebuilds caller-tool MCP and workspace-write configuration when resuming."} + "environmentId": { + "description": "Environment Id configuration. See the linked native reference for semantics and availability.", + "title": "Environment Id", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, + "runtimeWorkspaceRoots": { + "description": "Environment-native runtime workspace roots. Omitted defaults to `cwd`.", + "items": { + "$ref": "#/$defs/OpenAIAgentLegacyAppPathString", + "description": "Runtime Workspace Roots value configuration. See the linked native reference for semantics and availability.", + "title": "Runtime Workspace Roots value", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "title": "Runtime Workspace Roots", + "type": [ + "array", + "null" + ], + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "cwd", + "environmentId" + ], + "title": "Open AIAgent Turn Environment Params", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentTurnItemsView": { + "description": "Open AIAgent Turn Items View configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "oneOf": [ + { + "description": "`items` was not loaded for this turn. The field is intentionally empty.", + "enum": [ + "notLoaded" + ], + "title": "Open AIAgent Turn Items View", + "type": "string", + "x-enum-display": "segmented", + "x-enum-labels": { + "notLoaded": "Not Loaded" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "`items` contains only a display summary for this turn.", + "enum": [ + "summary" + ], + "title": "Open AIAgent Turn Items View", + "type": "string", + "x-enum-display": "segmented", + "x-enum-labels": { + "summary": "Summary" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "`items` contains every ThreadItem available from persisted app-server history for this turn.", + "enum": [ + "full" + ], + "title": "Open AIAgent Turn Items View", + "type": "string", + "x-enum-display": "segmented", + "x-enum-icons": { + "full": "lock-open" + }, + "x-enum-labels": { + "full": "Full" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "title": "Open AIAgent Turn Items View", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentTurnToolOutput": { + "description": "Open AIAgent Turn Tool Output configuration. See the linked native reference for semantics and availability.", + "properties": { + "name": { + "description": "Name configuration. See the linked native reference for semantics and availability.", + "title": "Name", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "namespace": { + "description": "Namespace configuration. See the linked native reference for semantics and availability.", + "title": "Namespace", + "type": [ + "string", + "null" + ], + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "output": { + "$ref": "#/$defs/OpenAIAgentFunctionCallOutputBody", + "description": "Output configuration. See the linked native reference for semantics and availability.", + "title": "Output", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "retain": { + "description": "Requests retention of this output in the thread's model history.", + "title": "Retain", + "type": "boolean", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "name", + "output" + ], + "title": "Open AIAgent Turn Tool Output", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "OpenAIAgentUserInput": { + "description": "Open AIAgent User Input configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "oneOf": [ + { + "description": "Open AIAgent User Input configuration. See the linked native reference for semantics and availability.", + "properties": { + "text": { + "description": "Text configuration. See the linked native reference for semantics and availability.", + "title": "Text", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "text_elements": { + "default": [], + "description": "UI-defined spans within `text` used to render or persist special elements.", + "items": { + "$ref": "#/$defs/OpenAIAgentTextElement", + "description": "Text elements value configuration. See the linked native reference for semantics and availability.", + "title": "Text elements value", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "title": "Text elements", + "type": "array", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "text" + ], + "title": "TextUserInputType", + "type": "string", + "x-clicky-order": 30, + "x-enum-display": "segmented", + "x-enum-labels": { + "text": "Text" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "text", + "type" + ], + "title": "TextUserInput", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "anyOf": [ + { + "description": "Open AIAgent User Input configuration. See the linked native reference for semantics and availability.", + "properties": { + "url": { + "description": "Url configuration. See the linked native reference for semantics and availability.", + "title": "Url", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "url" + ], + "title": "UrlUserInput", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Open AIAgent User Input configuration. See the linked native reference for semantics and availability.", + "properties": { + "fileId": { + "description": "File Id configuration. See the linked native reference for semantics and availability.", + "title": "File Id", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "fileId" + ], + "title": "FileIdUserInput", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Open AIAgent User Input configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "properties": { + "detail": { + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentImageDetail", + "description": "Detail configuration. See the linked native reference for semantics and availability.", + "title": "Detail", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Detail configuration. See the linked native reference for semantics and availability.", + "title": "Detail", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "default": null, + "description": "Detail configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Detail", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "image" + ], + "title": "ImageUserInputType", + "type": "string", + "x-clicky-order": 20, + "x-enum-display": "segmented", + "x-enum-labels": { + "image": "Image" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type" + ], + "title": "ImageUserInput", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Open AIAgent User Input configuration. See the linked native reference for semantics and availability.", + "properties": { + "detail": { + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentImageDetail", + "description": "Detail configuration. See the linked native reference for semantics and availability.", + "title": "Detail", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Detail configuration. See the linked native reference for semantics and availability.", + "title": "Detail", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "default": null, + "description": "Detail configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Detail", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "path": { + "description": "Path configuration. See the linked native reference for semantics and availability.", + "title": "Path", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "localImage" + ], + "title": "LocalImageUserInputType", + "type": "string", + "x-clicky-order": 30, + "x-enum-display": "segmented", + "x-enum-labels": { + "localImage": "Local Image" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "path", + "type" + ], + "title": "LocalImageUserInput", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Open AIAgent User Input configuration. See the linked native reference for semantics and availability.", + "properties": { + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "audio" + ], + "title": "AudioUserInputType", + "type": "string", + "x-clicky-order": 10, + "x-enum-display": "segmented", + "x-enum-labels": { + "audio": "Audio" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "Url configuration. See the linked native reference for semantics and availability.", + "title": "Url", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type", + "url" + ], + "title": "AudioUserInput", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Open AIAgent User Input configuration. See the linked native reference for semantics and availability.", + "properties": { + "path": { + "description": "Path configuration. See the linked native reference for semantics and availability.", + "title": "Path", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "localAudio" + ], + "title": "LocalAudioUserInputType", + "type": "string", + "x-clicky-order": 20, + "x-enum-display": "segmented", + "x-enum-labels": { + "localAudio": "Local Audio" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "path", + "type" + ], + "title": "LocalAudioUserInput", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Open AIAgent User Input configuration. See the linked native reference for semantics and availability.", + "properties": { + "name": { + "description": "Name configuration. See the linked native reference for semantics and availability.", + "title": "Name", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "path": { + "description": "Path configuration. See the linked native reference for semantics and availability.", + "title": "Path", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "skill" + ], + "title": "SkillUserInputType", + "type": "string", + "x-clicky-order": 30, + "x-enum-display": "segmented", + "x-enum-labels": { + "skill": "Skill" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "name", + "path", + "type" + ], + "title": "SkillUserInput", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Open AIAgent User Input configuration. See the linked native reference for semantics and availability.", + "properties": { + "name": { + "description": "Name configuration. See the linked native reference for semantics and availability.", + "title": "Name", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "path": { + "description": "Path configuration. See the linked native reference for semantics and availability.", + "title": "Path", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type configuration. See the linked native reference for semantics and availability.", + "enum": [ + "mention" + ], + "title": "MentionUserInputType", + "type": "string", + "x-clicky-order": 30, + "x-enum-display": "segmented", + "x-enum-labels": { + "mention": "Mention" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "name", + "path", + "type" + ], + "title": "MentionUserInput", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "title": "Open AIAgent User Input", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "description": "Native Codex app-server initialize, thread, and turn arguments used by Captain's OpenAI agent runtime.", + "properties": { + "initialize": { + "additionalProperties": false, + "description": "Parameters sent in the Codex app-server initialize request.", + "properties": { + "capabilities": { + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentInitializeCapabilities", + "description": "Capabilities configuration. See the linked native reference for semantics and availability.", + "title": "Capabilities", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Capabilities configuration. See the linked native reference for semantics and availability.", + "title": "Capabilities", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Experimental protocol capabilities supported by the client.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "readOnly": true, + "title": "Client capabilities", + "x-captain-option": { + "nativeName": "initialize.capabilities", + "note": "Captain enables the experimental API required by its app-server integration.", + "support": "managed" + }, + "x-clicky-order": 20, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "clientInfo": { + "$ref": "#/$defs/OpenAIAgentClientInfo", + "description": "Name, title, and version identifying the app-server client.", + "readOnly": true, + "title": "Client information", + "x-captain-option": { + "nativeName": "initialize.clientInfo", + "note": "Captain identifies itself and its build version to Codex.", + "support": "managed" + }, + "x-clicky-order": 10, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "clientInfo" + ], + "title": "Initialize", + "type": "object", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "threadResume": { + "additionalProperties": false, + "description": "Parameters used to resume an existing Codex app-server thread.", + "properties": { "approvalPolicy": { - "title": "Approval policy", "description": "Approval policy override applied while resuming the thread.", - "oneOf": [{"type": "string", "enum": ["untrusted", "on-request", "never"]}, {"type": "object", "additionalProperties": false, "required": ["granular"], "properties": {"granular": {"type": "object", "additionalProperties": false, "required": ["mcp_elicitations", "rules", "sandbox_approval"], "properties": {"mcp_elicitations": {"type": "boolean"}, "request_permissions": {"type": "boolean", "default": false}, "rules": {"type": "boolean"}, "sandbox_approval": {"type": "boolean"}, "skill_approval": {"type": "boolean", "default": false}}}}}], - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, "x-clicky-section": "permissions", "x-clicky-order": 320, - "x-captain-option": {"nativeName": "thread/resume.approvalPolicy", "support": "mapped", "specPath": "permissions.mode"} + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentAskForApproval", + "description": "Approval Policy configuration. See the linked native reference for semantics and availability.", + "title": "Approval Policy", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Approval Policy configuration. See the linked native reference for semantics and availability.", + "title": "Approval Policy", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Approval policy override applied while resuming the thread.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Approval policy", + "x-captain-option": { + "nativeName": "thread/resume.approvalPolicy", + "specPath": "permissions.mode", + "support": "mapped" + }, + "x-clicky-order": 320, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, "approvalsReviewer": { - "title": "Approvals reviewer", "description": "Reviewer override applied to the resumed thread.", - "type": "string", "enum": ["user", "auto_review", "guardian_subagent"], "x-clicky-section": "permissions", "x-clicky-order": 330, - "x-captain-option": {"nativeName": "thread/resume.approvalsReviewer", "support": "mapped", "specPath": "permissions.mode"} + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentApprovalsReviewer", + "description": "Approvals Reviewer configuration. See the linked native reference for semantics and availability.", + "title": "Approvals Reviewer", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Approvals Reviewer configuration. See the linked native reference for semantics and availability.", + "title": "Approvals Reviewer", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Reviewer override applied to the resumed thread.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Approvals reviewer", + "x-captain-option": { + "nativeName": "thread/resume.approvalsReviewer", + "specPath": "permissions.mode", + "support": "mapped" + }, + "x-clicky-order": 330, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, "baseInstructions": { - "title": "Base instructions", "description": "Replacement base instructions applied to the resumed thread.", - "type": "string", "readOnly": true, "x-clicky-section": "prompt", "x-clicky-order": 340, - "x-captain-option": {"nativeName": "thread/resume.baseInstructions", "support": "unsupported", "note": "Captain does not replace Codex base instructions on resume."} + "description": "Replacement base instructions applied to the resumed thread.", + "readOnly": true, + "title": "Base instructions", + "type": [ + "string", + "null" + ], + "x-captain-option": { + "nativeName": "thread/resume.baseInstructions", + "note": "Captain does not replace Codex base instructions on resume.", + "support": "unsupported" + }, + "x-clicky-order": 340, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "config": { + "additionalProperties": true, + "description": "Codex configuration overrides reconstructed for the resumed thread.", + "readOnly": true, + "title": "Configuration overrides", + "type": [ + "object", + "null" + ], + "x-captain-option": { + "nativeName": "thread/resume.config", + "note": "Captain rebuilds caller-tool MCP and workspace-write configuration when resuming.", + "support": "managed" + }, + "x-clicky-order": 310, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "cwd": { + "description": "Working directory applied when the thread is resumed.", + "title": "Working directory", + "type": [ + "string", + "null" + ], + "x-captain-option": { + "nativeName": "thread/resume.cwd", + "specPath": "setup.cwd", + "support": "mapped" + }, + "x-clicky-order": 300, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, "developerInstructions": { - "title": "Developer instructions", "description": "Developer instructions attached while resuming a thread.", - "type": "string", "readOnly": true, "x-clicky-section": "prompt", "x-clicky-order": 350, - "x-captain-option": {"nativeName": "thread/resume.developerInstructions", "support": "unsupported", "note": "Captain does not send thread-level developer instructions on resume."} + "description": "Developer instructions attached while resuming a thread.", + "readOnly": true, + "title": "Developer instructions", + "type": [ + "string", + "null" + ], + "x-captain-option": { + "nativeName": "thread/resume.developerInstructions", + "note": "Captain does not send thread-level developer instructions on resume.", + "support": "unsupported" + }, + "x-clicky-order": 350, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, "excludeTurns": { - "title": "Excluded turns", "description": "Turn identifiers omitted when loading the resumed thread.", - "type": "array", "items": {"type": "string"}, "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 360, "x-array-display": "list", - "x-captain-option": {"nativeName": "thread/resume.excludeTurns", "support": "unsupported", "note": "Captain resumes the complete stored Codex thread."} + "description": "Turn identifiers omitted when loading the resumed thread.", + "readOnly": true, + "title": "Excluded turns", + "type": "boolean", + "x-captain-option": { + "nativeName": "thread/resume.excludeTurns", + "note": "Captain resumes the complete stored Codex thread.", + "support": "unsupported" + }, + "x-clicky-order": 360, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, "history": { - "title": "History", "description": "Replacement conversation history supplied while resuming.", - "type": "array", "items": {"type": "object", "additionalProperties": true}, "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 370, "x-array-display": "stacked", - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "thread/resume.history", "support": "unsupported", "note": "Captain asks Codex to load its native stored history."} + "description": "Replacement conversation history supplied while resuming.", + "items": { + "$ref": "#/$defs/OpenAIAgentResponseItem", + "description": "History value configuration. See the linked native reference for semantics and availability.", + "title": "History value", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "readOnly": true, + "title": "History", + "type": [ + "array", + "null" + ], + "x-captain-option": { + "nativeName": "thread/resume.history", + "note": "Captain asks Codex to load its native stored history.", + "support": "unsupported" + }, + "x-clicky-order": 370, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, "initialTurnsPage": { - "title": "Initial turns page", "description": "Pagination request controlling the initial resumed-turn page.", - "type": "object", "additionalProperties": true, "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 380, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "thread/resume.initialTurnsPage", "support": "unsupported", "note": "Captain does not customize resumed-thread pagination."} + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentThreadResumeInitialTurnsPageParams", + "description": "Initial Turns Page configuration. See the linked native reference for semantics and availability.", + "title": "Initial Turns Page", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Initial Turns Page configuration. See the linked native reference for semantics and availability.", + "title": "Initial Turns Page", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Pagination request controlling the initial resumed-turn page.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "readOnly": true, + "title": "Initial turns page", + "x-captain-option": { + "nativeName": "thread/resume.initialTurnsPage", + "note": "Captain does not customize resumed-thread pagination.", + "support": "unsupported" + }, + "x-clicky-order": 380, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, "model": { - "title": "Model", "description": "Model override applied to the resumed thread.", - "type": "string", "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 390, - "x-captain-option": {"nativeName": "thread/resume.model", "support": "unsupported", "note": "Captain sends per-turn model selection instead of overriding the resumed thread."} + "description": "Model override applied to the resumed thread.", + "readOnly": true, + "title": "Model", + "type": [ + "string", + "null" + ], + "x-captain-option": { + "nativeName": "thread/resume.model", + "note": "Captain sends per-turn model selection instead of overriding the resumed thread.", + "support": "unsupported" + }, + "x-clicky-order": 390, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, "modelProvider": { - "title": "Model provider", "description": "Model-provider override applied to the resumed thread.", - "type": "string", "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 400, - "x-captain-option": {"nativeName": "thread/resume.modelProvider", "support": "unsupported", "note": "Captain uses the provider recorded by Codex."} + "description": "Model-provider override applied to the resumed thread.", + "readOnly": true, + "title": "Model provider", + "type": [ + "string", + "null" + ], + "x-captain-option": { + "nativeName": "thread/resume.modelProvider", + "note": "Captain uses the provider recorded by Codex.", + "support": "unsupported" + }, + "x-clicky-order": 400, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, "path": { - "title": "Rollout path", "description": "Filesystem path of the Codex rollout to resume.", - "type": "string", "format": "path", "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 410, - "x-captain-option": {"nativeName": "thread/resume.path", "support": "unsupported", "note": "Captain resumes by thread ID rather than rollout path."} + "default": null, + "description": "Filesystem path of the Codex rollout to resume.", + "readOnly": true, + "title": "Rollout path", + "type": [ + "string", + "null" + ], + "x-captain-option": { + "nativeName": "thread/resume.path", + "note": "Captain resumes by thread ID rather than rollout path.", + "support": "unsupported" + }, + "x-clicky-order": 410, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, "permissions": { - "title": "Permission profile", "description": "Named Codex permission-profile identifier applied to the resumed thread; it cannot be combined with sandbox.", - "type": "string", "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 420, - "x-captain-option": {"nativeName": "thread/resume.permissions", "support": "unsupported", "note": "Captain reapplies sandbox and approvalPolicy explicitly and does not select native named permission profiles."} + "description": "Named Codex permission-profile identifier applied to the resumed thread; it cannot be combined with sandbox.", + "readOnly": true, + "title": "Permission profile", + "type": [ + "string", + "null" + ], + "x-captain-option": { + "nativeName": "thread/resume.permissions", + "note": "Captain reapplies sandbox and approvalPolicy explicitly and does not select native named permission profiles.", + "support": "unsupported" + }, + "x-clicky-order": 420, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, "personality": { - "title": "Personality", "description": "Response personality override applied to the resumed thread.", - "type": "string", "readOnly": true, "x-clicky-section": "prompt", "x-clicky-order": 430, - "x-captain-option": {"nativeName": "thread/resume.personality", "support": "unsupported", "note": "Captain does not override Codex personality on resume."} + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentPersonality", + "description": "Personality configuration. See the linked native reference for semantics and availability.", + "title": "Personality", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Personality configuration. See the linked native reference for semantics and availability.", + "title": "Personality", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Response personality override applied to the resumed thread.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "readOnly": true, + "title": "Personality", + "x-captain-option": { + "nativeName": "thread/resume.personality", + "note": "Captain does not override Codex personality on resume.", + "support": "unsupported" + }, + "x-clicky-order": 430, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, "runtimeWorkspaceRoots": { - "title": "Runtime workspace roots", "description": "Replacement runtime workspace roots for the resumed thread; paths must be absolute.", - "type": "array", "items": {"type": "string", "format": "path"}, "x-clicky-section": "workspace", "x-clicky-order": 440, "x-array-display": "list", - "x-captain-option": {"nativeName": "thread/resume.runtimeWorkspaceRoots", "support": "mapped", "specPath": "permissions.directories"} + "description": "Replacement runtime workspace roots for the resumed thread; paths must be absolute.", + "items": { + "$ref": "#/$defs/OpenAIAgentAbsolutePathBuf", + "description": "Runtime Workspace Roots value configuration. See the linked native reference for semantics and availability.", + "title": "Runtime Workspace Roots value", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "title": "Runtime workspace roots", + "type": [ + "array", + "null" + ], + "x-captain-option": { + "nativeName": "thread/resume.runtimeWorkspaceRoots", + "specPath": "permissions.directories", + "support": "mapped" + }, + "x-clicky-order": 440, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, "sandbox": { - "title": "Sandbox mode", "description": "Sandbox override applied while resuming the thread.", - "type": "string", "enum": ["read-only", "workspace-write", "danger-full-access"], "x-clicky-section": "sandbox", "x-clicky-order": 450, - "x-captain-option": {"nativeName": "thread/resume.sandbox", "support": "mapped", "specPath": ["sandbox.mode", "sandbox.policy.filesystem.access"]} + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentSandboxMode", + "description": "Sandbox configuration. See the linked native reference for semantics and availability.", + "title": "Sandbox", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Sandbox configuration. See the linked native reference for semantics and availability.", + "title": "Sandbox", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Sandbox override applied while resuming the thread.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Sandbox mode", + "x-captain-option": { + "nativeName": "thread/resume.sandbox", + "specPath": [ + "sandbox.mode", + "sandbox.policy.filesystem.access" + ], + "support": "mapped" + }, + "x-clicky-order": 450, + "x-clicky-section": "sandbox", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, "serviceTier": { - "title": "Service tier", "description": "Processing tier override applied to the resumed thread.", - "type": "string", "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 460, - "x-captain-option": {"nativeName": "thread/resume.serviceTier", "support": "unsupported", "note": "Captain does not select a service tier on resume."} + "description": "Processing tier override applied to the resumed thread.", + "readOnly": true, + "title": "Service tier", + "type": [ + "string", + "null" + ], + "x-captain-option": { + "nativeName": "thread/resume.serviceTier", + "note": "Captain does not select a service tier on resume.", + "support": "unsupported" + }, + "x-clicky-order": 460, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "threadId": { + "description": "Codex thread identifier to resume.", + "title": "Thread ID", + "type": "string", + "x-captain-option": { + "nativeName": "thread/resume.threadId", + "specPath": "sessionId", + "support": "mapped" + }, + "x-clicky-order": 290, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } } + }, + "required": [ + "threadId" + ], + "title": "Thread resume", + "type": "object", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] } }, - "turnStart": { - "title": "Turn start", "description": "Parameters used to start a turn on an active Codex app-server thread.", - "type": "object", "additionalProperties": false, + "threadStart": { + "additionalProperties": false, + "description": "Parameters used to start a new Codex app-server thread.", "properties": { - "threadId": { - "title": "Thread ID", "description": "Active Codex thread receiving the turn.", - "type": "string", "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 470, - "x-captain-option": {"nativeName": "turn/start.threadId", "support": "managed", "note": "Captain uses the identifier returned by thread/start or thread/resume."} + "allowProviderModelFallback": { + "description": "Whether Codex may fall back to a different provider model.", + "readOnly": true, + "title": "Provider model fallback", + "type": "boolean", + "x-captain-option": { + "nativeName": "thread/start.allowProviderModelFallback", + "note": "Captain performs model fallback in its own provider registry.", + "support": "unsupported" + }, + "x-clicky-order": 100, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, - "input": { - "title": "Input", "description": "Text and local-image items supplied for the Codex turn.", - "type": "array", "items": {"type": "object", "additionalProperties": true}, "x-clicky-section": "prompt", "x-clicky-order": 480, "x-array-display": "stacked", - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "turn/start.input", "support": "mapped", "specPath": ["prompt.user", "prompt.system", "prompt.appendSystem", "prompt.attachments"]} + "approvalPolicy": { + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentAskForApproval", + "description": "Approval Policy configuration. See the linked native reference for semantics and availability.", + "title": "Approval Policy", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Approval Policy configuration. See the linked native reference for semantics and availability.", + "title": "Approval Policy", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Codex command-approval policy for the thread.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Approval policy", + "x-captain-option": { + "nativeName": "thread/start.approvalPolicy", + "specPath": "permissions.mode", + "support": "mapped" + }, + "x-clicky-order": 60, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "approvalsReviewer": { + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentApprovalsReviewer", + "description": "Approvals Reviewer configuration. See the linked native reference for semantics and availability.", + "title": "Approvals Reviewer", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Approvals Reviewer configuration. See the linked native reference for semantics and availability.", + "title": "Approvals Reviewer", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Reviewer implementation used to evaluate approval requests.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Approvals reviewer", + "x-captain-option": { + "nativeName": "thread/start.approvalsReviewer", + "specPath": "permissions.mode", + "support": "mapped" + }, + "x-clicky-order": 110, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "baseInstructions": { + "description": "Replacement base instruction text for the Codex thread.", + "readOnly": true, + "title": "Base instructions", + "type": [ + "string", + "null" + ], + "x-captain-option": { + "nativeName": "thread/start.baseInstructions", + "note": "Captain sends prompt instructions at turn start and does not replace Codex base instructions.", + "support": "unsupported" + }, + "x-clicky-order": 120, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "config": { + "additionalProperties": true, + "description": "Codex configuration overrides derived from Captain sandbox and caller-tool settings.", + "readOnly": true, + "title": "Configuration overrides", + "type": [ + "object", + "null" + ], + "x-captain-option": { + "nativeName": "thread/start.config", + "note": "Captain assembles sandbox and MCP overrides from mapped Spec values and its registered caller-tool endpoint.", + "support": "managed" + }, + "x-clicky-order": 80, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "cwd": { + "description": "Initial working directory for the Codex thread.", + "title": "Working directory", + "type": [ + "string", + "null" + ], + "x-captain-option": { + "nativeName": "thread/start.cwd", + "specPath": "setup.cwd", + "support": "mapped" + }, + "x-clicky-order": 30, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "daybreakEnabled": { + "description": "Initial Daybreak choice for a persistent Codex thread; not supported for ephemeral threads.", + "readOnly": true, + "title": "Daybreak enabled", + "type": [ + "boolean", + "null" + ], + "x-captain-option": { + "nativeName": "thread/start.daybreakEnabled", + "note": "Captain leaves the Codex Daybreak choice unset.", + "support": "unsupported" + }, + "x-clicky-order": 145, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "developerInstructions": { + "description": "Developer instruction text attached to the Codex thread.", + "readOnly": true, + "title": "Developer instructions", + "type": [ + "string", + "null" + ], + "x-captain-option": { + "nativeName": "thread/start.developerInstructions", + "note": "Captain does not set thread-level developer instructions.", + "support": "unsupported" + }, + "x-clicky-order": 130, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "dynamicTools": { + "default": null, + "description": "Tool definitions registered dynamically with the Codex thread.", + "items": { + "$ref": "#/$defs/OpenAIAgentDynamicToolSpec", + "description": "Dynamic Tools value configuration. See the linked native reference for semantics and availability.", + "title": "Dynamic Tools value", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "readOnly": true, + "title": "Dynamic tools", + "type": [ + "array", + "null" + ], + "x-captain-option": { + "nativeName": "thread/start.dynamicTools", + "note": "Captain exposes caller tools through MCP rather than Codex dynamic tools.", + "support": "unsupported" + }, + "x-clicky-order": 140, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "environments": { + "description": "Named execution environments available to the Codex thread.", + "items": { + "$ref": "#/$defs/OpenAIAgentTurnEnvironmentParams", + "description": "Environments value configuration. See the linked native reference for semantics and availability.", + "title": "Environments value", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "readOnly": true, + "title": "Environments", + "type": [ + "array", + "null" + ], + "x-captain-option": { + "nativeName": "thread/start.environments", + "note": "Captain does not pass native Codex environment descriptors.", + "support": "unsupported" + }, + "x-clicky-order": 150, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "ephemeral": { + "description": "Whether Codex avoids persisting the thread to disk.", + "title": "Ephemeral thread", + "type": [ + "boolean", + "null" + ], + "x-captain-option": { + "nativeName": "thread/start.ephemeral", + "specPath": [ + "memory.skipMemory", + "memory.bare", + "permissions.presets" + ], + "support": "mapped" + }, + "x-clicky-order": 70, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "experimentalRawEvents": { + "description": "Whether raw protocol events are included in item streams.", + "readOnly": true, + "title": "Experimental raw events", + "type": "boolean", + "x-captain-option": { + "nativeName": "thread/start.experimentalRawEvents", + "note": "Captain enables raw events to preserve provider-native session information.", + "support": "managed" + }, + "x-clicky-order": 90, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "historyMode": { + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentThreadHistoryMode", + "description": "History Mode configuration. See the linked native reference for semantics and availability.", + "title": "History Mode", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "History Mode configuration. See the linked native reference for semantics and availability.", + "title": "History Mode", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Codex policy controlling which history is retained.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "readOnly": true, + "title": "History mode", + "x-captain-option": { + "nativeName": "thread/start.historyMode", + "note": "Captain does not override Codex history mode.", + "support": "unsupported" + }, + "x-clicky-order": 160, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "mockExperimentalField": { + "description": "Protocol test field reserved by the experimental app-server schema.", + "readOnly": true, + "title": "Mock experimental field", + "type": [ + "string", + "null" + ], + "x-captain-option": { + "nativeName": "thread/start.mockExperimentalField", + "note": "Captain does not use protocol test fields.", + "support": "unsupported" + }, + "x-clicky-order": 170, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, "model": { - "title": "Model", "description": "Model identifier used for this Codex turn.", - "type": "string", "x-clicky-section": "model", "x-clicky-order": 490, - "x-captain-option": {"nativeName": "turn/start.model", "support": "mapped", "specPath": "model"} + "description": "Model identifier used to start the Codex thread.", + "title": "Model", + "type": [ + "string", + "null" + ], + "x-captain-option": { + "nativeName": "thread/start.model", + "specPath": "model", + "support": "mapped" + }, + "x-clicky-order": 40, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, - "effort": { - "title": "Reasoning effort", "description": "Reasoning effort used for this Codex turn.", - "type": "string", "minLength": 1, "x-clicky-section": "model", "x-clicky-order": 500, - "x-captain-option": {"nativeName": "turn/start.effort", "support": "mapped", "specPath": "effort"} + "modelProvider": { + "description": "Codex model-provider implementation selected for the thread.", + "readOnly": true, + "title": "Model provider", + "type": [ + "string", + "null" + ], + "x-captain-option": { + "nativeName": "thread/start.modelProvider", + "note": "Captain uses the installed Codex provider configuration.", + "support": "unsupported" + }, + "x-clicky-order": 180, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, - "outputSchema": { - "title": "Output schema", "description": "JSON Schema constraining the final turn response.", - "type": "object", "additionalProperties": true, "x-clicky-section": "prompt", "x-clicky-order": 510, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "turn/start.outputSchema", "support": "mapped", "specPath": ["prompt.schema", "prompt.schemaJSON"]} + "multiAgentMode": { + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentMultiAgentMode", + "description": "Multi Agent Mode configuration. See the linked native reference for semantics and availability.", + "title": "Multi Agent Mode", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Multi Agent Mode configuration. See the linked native reference for semantics and availability.", + "title": "Multi Agent Mode", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Codex multi-agent coordination mode for the thread.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "readOnly": true, + "title": "Multi-agent mode", + "x-captain-option": { + "nativeName": "thread/start.multiAgentMode", + "note": "Captain does not override Codex multi-agent mode.", + "support": "unsupported" + }, + "x-clicky-order": 190, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "permissions": { + "description": "Named Codex permission-profile identifier for the thread; it cannot be combined with sandbox.", + "readOnly": true, + "title": "Permission profile", + "type": [ + "string", + "null" + ], + "x-captain-option": { + "nativeName": "thread/start.permissions", + "note": "Captain maps sandbox and approvalPolicy explicitly and does not select native named permission profiles.", + "support": "unsupported" + }, + "x-clicky-order": 200, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "personality": { + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentPersonality", + "description": "Personality configuration. See the linked native reference for semantics and availability.", + "title": "Personality", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Personality configuration. See the linked native reference for semantics and availability.", + "title": "Personality", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Named Codex response personality for the thread.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "readOnly": true, + "title": "Personality", + "x-captain-option": { + "nativeName": "thread/start.personality", + "note": "Captain does not expose Codex personality selection.", + "support": "unsupported" + }, + "x-clicky-order": 210, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "projectId": { + "description": "Codex project identifier associated with the thread.", + "readOnly": true, + "title": "Project ID", + "type": [ + "string", + "null" + ], + "x-captain-option": { + "nativeName": "thread/start.projectId", + "note": "Captain does not set a native Codex project identifier.", + "support": "unsupported" + }, + "x-clicky-order": 220, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "runtimeWorkspaceRoots": { + "description": "Replacement runtime workspace roots for the Codex thread; paths must be absolute.", + "items": { + "$ref": "#/$defs/OpenAIAgentAbsolutePathBuf", + "description": "Runtime Workspace Roots value configuration. See the linked native reference for semantics and availability.", + "title": "Runtime Workspace Roots value", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "title": "Runtime workspace roots", + "type": [ + "array", + "null" + ], + "x-captain-option": { + "nativeName": "thread/start.runtimeWorkspaceRoots", + "specPath": "permissions.directories", + "support": "mapped" + }, + "x-clicky-order": 230, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "sandbox": { + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentSandboxMode", + "description": "Sandbox configuration. See the linked native reference for semantics and availability.", + "title": "Sandbox", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Sandbox configuration. See the linked native reference for semantics and availability.", + "title": "Sandbox", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Named Codex sandbox mode for the thread.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Sandbox mode", + "x-captain-option": { + "nativeName": "thread/start.sandbox", + "specPath": [ + "sandbox.mode", + "sandbox.policy.filesystem.access" + ], + "support": "mapped" + }, + "x-clicky-order": 50, + "x-clicky-section": "sandbox", + "x-enum-display": "segmented", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "selectedCapabilityRoots": { + "description": "Filesystem roots selected for capability discovery.", + "items": { + "$ref": "#/$defs/OpenAIAgentSelectedCapabilityRoot", + "description": "Selected Capability Roots value configuration. See the linked native reference for semantics and availability.", + "title": "Selected Capability Roots value", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "readOnly": true, + "title": "Selected capability roots", + "type": [ + "array", + "null" + ], + "x-captain-option": { + "nativeName": "thread/start.selectedCapabilityRoots", + "note": "Captain does not select native Codex capability roots.", + "support": "unsupported" + }, + "x-clicky-order": 240, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "serviceName": { + "description": "Service identity attached to the Codex thread.", + "readOnly": true, + "title": "Service name", + "type": [ + "string", + "null" + ], + "x-captain-option": { + "nativeName": "thread/start.serviceName", + "note": "Captain does not send a Codex service name.", + "support": "unsupported" + }, + "x-clicky-order": 250, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "serviceTier": { + "description": "Processing tier selected for the Codex thread.", + "readOnly": true, + "title": "Service tier", + "type": [ + "string", + "null" + ], + "x-captain-option": { + "nativeName": "thread/start.serviceTier", + "note": "Captain does not select a Codex service tier.", + "support": "unsupported" + }, + "x-clicky-order": 260, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, + "sessionStartSource": { + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentThreadStartSource", + "description": "Session Start Source configuration. See the linked native reference for semantics and availability.", + "title": "Session Start Source", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Session Start Source configuration. See the linked native reference for semantics and availability.", + "title": "Session Start Source", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Source label describing how the session was launched.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "readOnly": true, + "title": "Session start source", + "x-captain-option": { + "nativeName": "thread/start.sessionStartSource", + "note": "Captain does not override the native session-start source.", + "support": "unsupported" + }, + "x-clicky-order": 270, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "threadSource": { + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentThreadSource", + "description": "Thread Source configuration. See the linked native reference for semantics and availability.", + "title": "Thread Source", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Thread Source configuration. See the linked native reference for semantics and availability.", + "title": "Thread Source", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Native source label attached to the Codex thread.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "readOnly": true, + "title": "Thread source", + "x-captain-option": { + "nativeName": "thread/start.threadSource", + "note": "Captain does not set a Codex thread-source label.", + "support": "unsupported" + }, + "x-clicky-order": 280, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + }, + "title": "Thread start", + "type": "object", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "turnStart": { + "additionalProperties": false, + "description": "Parameters used to start a turn on an active Codex app-server thread.", + "properties": { "additionalContext": { - "title": "Additional context", "description": "Extra context attached to the turn outside the user input list.", - "type": "string", "readOnly": true, "x-clicky-section": "prompt", "x-clicky-order": 520, - "x-captain-option": {"nativeName": "turn/start.additionalContext", "support": "unsupported", "note": "Captain includes requested context in the prompt input."} + "additionalProperties": { + "$ref": "#/$defs/OpenAIAgentAdditionalContextEntry", + "description": "Additional Context value configuration. See the linked native reference for semantics and availability.", + "title": "Additional Context value", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "description": "Extra context attached to the turn outside the user input list.", + "readOnly": true, + "title": "Additional context", + "type": [ + "object", + "null" + ], + "x-captain-option": { + "nativeName": "turn/start.additionalContext", + "note": "Captain includes requested context in the prompt input.", + "support": "unsupported" + }, + "x-clicky-order": 520, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, "approvalPolicy": { - "title": "Approval policy", "description": "Approval-policy override for the turn.", - "oneOf": [{"type": "string", "enum": ["untrusted", "on-request", "never"]}, {"type": "object", "additionalProperties": false, "required": ["granular"], "properties": {"granular": {"type": "object", "additionalProperties": false, "required": ["mcp_elicitations", "rules", "sandbox_approval"], "properties": {"mcp_elicitations": {"type": "boolean"}, "request_permissions": {"type": "boolean", "default": false}, "rules": {"type": "boolean"}, "sandbox_approval": {"type": "boolean"}, "skill_approval": {"type": "boolean", "default": false}}}}}], - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, "x-clicky-section": "permissions", "x-clicky-order": 530, - "x-captain-option": {"nativeName": "turn/start.approvalPolicy", "support": "mapped", "specPath": "permissions.mode"} + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentAskForApproval", + "description": "Approval Policy configuration. See the linked native reference for semantics and availability.", + "title": "Approval Policy", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Approval Policy configuration. See the linked native reference for semantics and availability.", + "title": "Approval Policy", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Approval-policy override for the turn.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Approval policy", + "x-captain-option": { + "nativeName": "turn/start.approvalPolicy", + "specPath": "permissions.mode", + "support": "mapped" + }, + "x-clicky-order": 530, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, "approvalsReviewer": { - "title": "Approvals reviewer", "description": "Reviewer override used for approvals in this turn.", - "type": "string", "enum": ["user", "auto_review", "guardian_subagent"], "x-clicky-section": "permissions", "x-clicky-order": 540, - "x-captain-option": {"nativeName": "turn/start.approvalsReviewer", "support": "mapped", "specPath": "permissions.mode"} + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentApprovalsReviewer", + "description": "Approvals Reviewer configuration. See the linked native reference for semantics and availability.", + "title": "Approvals Reviewer", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Approvals Reviewer configuration. See the linked native reference for semantics and availability.", + "title": "Approvals Reviewer", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Reviewer override used for approvals in this turn.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Approvals reviewer", + "x-captain-option": { + "nativeName": "turn/start.approvalsReviewer", + "specPath": "permissions.mode", + "support": "mapped" + }, + "x-clicky-order": 540, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, "clientUserMessageId": { - "title": "Client user message ID", "description": "Client-assigned identifier for the turn's user message.", - "type": "string", "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 550, - "x-captain-option": {"nativeName": "turn/start.clientUserMessageId", "support": "unsupported", "note": "Captain does not assign native Codex message identifiers."} + "description": "Client-assigned identifier for the turn's user message.", + "readOnly": true, + "title": "Client user message ID", + "type": [ + "string", + "null" + ], + "x-captain-option": { + "nativeName": "turn/start.clientUserMessageId", + "note": "Captain does not assign native Codex message identifiers.", + "support": "unsupported" + }, + "x-clicky-order": 550, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, "collaborationMode": { - "title": "Collaboration mode", "description": "Codex collaboration mode applied for the turn.", - "allOf": [{"type": "object", "additionalProperties": false, "required": ["mode", "settings"], "properties": { - "mode": {"type": "string", "enum": ["default", "plan"]}, - "settings": {"type": "object", "additionalProperties": false, "required": ["model"], "properties": { - "model": {"type": "string"}, - "reasoning_effort": {"type": ["string", "null"]}, - "developer_instructions": {"type": ["string", "null"]} - }} - }}], - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, "x-clicky-section": "permissions", "x-clicky-order": 560, - "x-captain-option": {"nativeName": "turn/start.collaborationMode", "support": "mapped", "specPath": ["permissions.mode", "model", "effort"]} + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentCollaborationMode", + "description": "Collaboration Mode configuration. See the linked native reference for semantics and availability.", + "title": "Collaboration Mode", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Collaboration Mode configuration. See the linked native reference for semantics and availability.", + "title": "Collaboration Mode", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Codex collaboration mode applied for the turn.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Collaboration mode", + "x-captain-option": { + "nativeName": "turn/start.collaborationMode", + "specPath": [ + "permissions.mode", + "model", + "effort" + ], + "support": "mapped" + }, + "x-clicky-order": 560, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, "cwd": { - "title": "Working directory", "description": "Working-directory override for the turn.", - "type": "string", "format": "path", "x-clicky-section": "workspace", "x-clicky-order": 570, - "x-captain-option": {"nativeName": "turn/start.cwd", "support": "mapped", "specPath": "setup.cwd"} + "description": "Working-directory override for the turn.", + "title": "Working directory", + "type": [ + "string", + "null" + ], + "x-captain-option": { + "nativeName": "turn/start.cwd", + "specPath": "setup.cwd", + "support": "mapped" + }, + "x-clicky-order": 570, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, "cyberAccessProgram": { - "title": "Cyber access program", "description": "Codex cyber-access program configuration for the turn.", - "type": "object", "additionalProperties": true, "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 580, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "turn/start.cyberAccessProgram", "support": "unsupported", "note": "Captain does not configure native Codex cyber-access programs."} + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentCyberAccessProgram", + "description": "Cyber Access Program configuration. See the linked native reference for semantics and availability.", + "title": "Cyber Access Program", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Cyber Access Program configuration. See the linked native reference for semantics and availability.", + "title": "Cyber Access Program", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Codex cyber-access program configuration for the turn.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "readOnly": true, + "title": "Cyber access program", + "x-captain-option": { + "nativeName": "turn/start.cyberAccessProgram", + "note": "Captain does not configure native Codex cyber-access programs.", + "support": "unsupported" + }, + "x-clicky-order": 580, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, "disabledPluginIds": { - "title": "Disabled plugin IDs", "description": "Replacement list of plugin identifiers disabled for the thread; an empty list clears it.", - "type": "array", "items": {"type": "string"}, "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 585, "x-array-display": "list", - "x-captain-option": {"nativeName": "turn/start.disabledPluginIds", "support": "unsupported", "note": "Captain does not manage Codex plugin enablement."} + "description": "Replacement list of plugin identifiers disabled for the thread; an empty list clears it.", + "items": { + "description": "Disabled Plugin Ids value configuration. See the linked native reference for semantics and availability.", + "title": "Disabled Plugin Ids value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "readOnly": true, + "title": "Disabled plugin IDs", + "type": [ + "array", + "null" + ], + "x-captain-option": { + "nativeName": "turn/start.disabledPluginIds", + "note": "Captain does not manage Codex plugin enablement.", + "support": "unsupported" + }, + "x-clicky-order": 585, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "effort": { + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentReasoningEffort", + "description": "Effort configuration. See the linked native reference for semantics and availability.", + "title": "Effort", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Effort configuration. See the linked native reference for semantics and availability.", + "title": "Effort", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Reasoning effort used for this Codex turn.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Reasoning effort", + "x-captain-option": { + "nativeName": "turn/start.effort", + "specPath": "effort", + "support": "mapped" + }, + "x-clicky-order": 500, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, "environments": { - "title": "Environments", "description": "Execution environments made available for this turn.", - "type": "array", "items": {"type": "object", "additionalProperties": true}, "readOnly": true, "x-clicky-section": "environment", "x-clicky-order": 590, "x-array-display": "stacked", - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "turn/start.environments", "support": "unsupported", "note": "Captain does not send Codex environment descriptors per turn."} + "description": "Execution environments made available for this turn.", + "items": { + "$ref": "#/$defs/OpenAIAgentTurnEnvironmentParams", + "description": "Environments value configuration. See the linked native reference for semantics and availability.", + "title": "Environments value", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "readOnly": true, + "title": "Environments", + "type": [ + "array", + "null" + ], + "x-captain-option": { + "nativeName": "turn/start.environments", + "note": "Captain does not send Codex environment descriptors per turn.", + "support": "unsupported" + }, + "x-clicky-order": 590, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "input": { + "description": "Text and local-image items supplied for the Codex turn.", + "items": { + "$ref": "#/$defs/OpenAIAgentUserInput", + "description": "Input value configuration. See the linked native reference for semantics and availability.", + "title": "Input value", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "title": "Input", + "type": "array", + "x-captain-option": { + "nativeName": "turn/start.input", + "specPath": [ + "prompt.user", + "prompt.system", + "prompt.appendSystem", + "prompt.attachments" + ], + "support": "mapped" + }, + "x-clicky-order": 480, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "model": { + "description": "Model identifier used for this Codex turn.", + "title": "Model", + "type": [ + "string", + "null" + ], + "x-captain-option": { + "nativeName": "turn/start.model", + "specPath": "model", + "support": "mapped" + }, + "x-clicky-order": 490, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, "multiAgentMode": { - "title": "Multi-agent mode", "description": "Codex multi-agent coordination mode for this turn.", - "type": "string", "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 600, - "x-captain-option": {"nativeName": "turn/start.multiAgentMode", "support": "unsupported", "note": "Captain does not override native multi-agent mode."} + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentMultiAgentMode", + "description": "Multi Agent Mode configuration. See the linked native reference for semantics and availability.", + "title": "Multi Agent Mode", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Multi Agent Mode configuration. See the linked native reference for semantics and availability.", + "title": "Multi Agent Mode", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Codex multi-agent coordination mode for this turn.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "readOnly": true, + "title": "Multi-agent mode", + "x-captain-option": { + "nativeName": "turn/start.multiAgentMode", + "note": "Captain does not override native multi-agent mode.", + "support": "unsupported" + }, + "x-clicky-order": 600, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "outputSchema": { + "description": "JSON Schema constraining the final turn response.", + "format": "json", + "title": "Output schema", + "x-captain-option": { + "nativeName": "turn/start.outputSchema", + "specPath": [ + "prompt.schema", + "prompt.schemaJSON" + ], + "support": "mapped" + }, + "x-clicky-order": 510, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "parentTurnId": { + "description": "ID of the turn that caused this new turn to start.\n\nSet this when starting work on behalf of another turn, such as delegated work in a different thread. Leave unset for work started directly by the user. Ignored when this request adds input to an active turn.", + "readOnly": true, + "title": "Parent Turn Id", + "type": [ + "string", + "null" + ], + "x-captain-option": { + "nativeName": "turn/start.parentTurnId", + "note": "Accepted by the native protocol; Captain does not construct this option.", + "support": "unsupported" + }, + "x-clicky-order": 150, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, "permissions": { - "title": "Permission profile", "description": "Named Codex permission-profile identifier for this turn and subsequent turns; it cannot be combined with sandboxPolicy.", - "type": "string", "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 610, - "x-captain-option": {"nativeName": "turn/start.permissions", "support": "unsupported", "note": "Captain maps sandbox and approvalPolicy explicitly and does not select native named permission profiles."} + "description": "Named Codex permission-profile identifier for this turn and subsequent turns; it cannot be combined with sandboxPolicy.", + "readOnly": true, + "title": "Permission profile", + "type": [ + "string", + "null" + ], + "x-captain-option": { + "nativeName": "turn/start.permissions", + "note": "Captain maps sandbox and approvalPolicy explicitly and does not select native named permission profiles.", + "support": "unsupported" + }, + "x-clicky-order": 610, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, "personality": { - "title": "Personality", "description": "Response personality override for this turn.", - "type": "string", "readOnly": true, "x-clicky-section": "prompt", "x-clicky-order": 620, - "x-captain-option": {"nativeName": "turn/start.personality", "support": "unsupported", "note": "Captain does not expose Codex personality selection."} + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentPersonality", + "description": "Personality configuration. See the linked native reference for semantics and availability.", + "title": "Personality", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Personality configuration. See the linked native reference for semantics and availability.", + "title": "Personality", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Response personality override for this turn.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "readOnly": true, + "title": "Personality", + "x-captain-option": { + "nativeName": "turn/start.personality", + "note": "Captain does not expose Codex personality selection.", + "support": "unsupported" + }, + "x-clicky-order": 620, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, "responsesapiClientMetadata": { - "title": "Responses API client metadata", "description": "Client metadata forwarded to the underlying Responses API call.", - "type": "object", "additionalProperties": true, "readOnly": true, "x-clicky-section": "environment", "x-clicky-order": 630, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "turn/start.responsesapiClientMetadata", "support": "unsupported", "note": "Captain does not attach Codex Responses API client metadata."} + "additionalProperties": { + "description": "Responsesapi Client Metadata value configuration. See the linked native reference for semantics and availability.", + "title": "Responsesapi Client Metadata value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "description": "Client metadata forwarded to the underlying Responses API call.", + "readOnly": true, + "title": "Responses API client metadata", + "type": [ + "object", + "null" + ], + "x-captain-option": { + "nativeName": "turn/start.responsesapiClientMetadata", + "note": "Captain does not attach Codex Responses API client metadata.", + "support": "unsupported" + }, + "x-clicky-order": 630, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "responsesapiClientMetadataPatch": { + "additionalProperties": { + "description": "Responsesapi Client Metadata Patch value configuration. See the linked native reference for semantics and availability.", + "title": "Responsesapi Client Metadata Patch value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "description": "Merge entries into the ResponsesAPI turn metadata without removing existing entries. Applied after `responsesapiClientMetadata` if both are provided; reserved keys remain protected.", + "readOnly": true, + "title": "Responsesapi Client Metadata Patch", + "type": [ + "object", + "null" + ], + "x-captain-option": { + "nativeName": "turn/start.responsesapiClientMetadataPatch", + "note": "Accepted by the native protocol; Captain does not construct this option.", + "support": "unsupported" + }, + "x-clicky-order": 190, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "rootTurnId": { + "description": "ID of the first turn in the chain of work that led to this new turn.\n\nWhen setting `parentTurnId`, set this to the parent turn's `rootTurnId` when known. This keeps descendant work attributed to the original turn. If omitted, the new turn becomes its own root. Ignored when this request adds input to an active turn.", + "readOnly": true, + "title": "Root Turn Id", + "type": [ + "string", + "null" + ], + "x-captain-option": { + "nativeName": "turn/start.rootTurnId", + "note": "Accepted by the native protocol; Captain does not construct this option.", + "support": "unsupported" + }, + "x-clicky-order": 200, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, "runtimeWorkspaceRoots": { - "title": "Runtime workspace roots", "description": "Replacement runtime workspace roots for this turn and subsequent turns; paths must be absolute.", - "type": "array", "items": {"type": "string", "format": "path"}, "x-clicky-section": "workspace", "x-clicky-order": 640, "x-array-display": "list", - "x-captain-option": {"nativeName": "turn/start.runtimeWorkspaceRoots", "support": "mapped", "specPath": "permissions.directories"} + "description": "Replacement runtime workspace roots for this turn and subsequent turns; paths must be absolute.", + "items": { + "$ref": "#/$defs/OpenAIAgentAbsolutePathBuf", + "description": "Runtime Workspace Roots value configuration. See the linked native reference for semantics and availability.", + "title": "Runtime Workspace Roots value", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "title": "Runtime workspace roots", + "type": [ + "array", + "null" + ], + "x-captain-option": { + "nativeName": "turn/start.runtimeWorkspaceRoots", + "specPath": "permissions.directories", + "support": "mapped" + }, + "x-clicky-order": 640, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, "sandboxPolicy": { - "title": "Sandbox policy", "description": "Detailed sandbox policy override for this turn.", - "oneOf": [ - {"type": "object", "required": ["type"], "properties": {"type": {"const": "dangerFullAccess"}}}, - {"type": "object", "required": ["type"], "properties": {"type": {"const": "readOnly"}, "networkAccess": {"type": "boolean", "default": false}}}, - {"type": "object", "required": ["type"], "properties": {"type": {"const": "externalSandbox"}, "networkAccess": {"type": "string", "enum": ["restricted", "enabled"], "default": "restricted"}}}, - {"type": "object", "required": ["type"], "properties": {"type": {"const": "workspaceWrite"}, "writableRoots": {"type": "array", "items": {"type": "string", "format": "path"}, "default": []}, "excludeSlashTmp": {"type": "boolean", "default": false}, "excludeTmpdirEnvVar": {"type": "boolean", "default": false}, "networkAccess": {"type": "boolean", "default": false}}} + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentSandboxPolicy", + "description": "Sandbox Policy configuration. See the linked native reference for semantics and availability.", + "title": "Sandbox Policy", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Sandbox Policy configuration. See the linked native reference for semantics and availability.", + "title": "Sandbox Policy", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } ], - "x-clicky-section": "sandbox", "x-clicky-order": 650, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "turn/start.sandboxPolicy", "support": "mapped", "specPath": ["sandbox.mode", "sandbox.policy.filesystem.access", "sandbox.policy.filesystem.writableRoots", "sandbox.policy.filesystem.includeSystemTemp", "sandbox.policy.network.access"]} + "description": "Detailed sandbox policy override for this turn.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "Sandbox policy", + "x-captain-option": { + "nativeName": "turn/start.sandboxPolicy", + "specPath": [ + "sandbox.mode", + "sandbox.policy.filesystem.access", + "sandbox.policy.filesystem.writableRoots", + "sandbox.policy.filesystem.includeSystemTemp", + "sandbox.policy.network.access" + ], + "support": "mapped" + }, + "x-clicky-order": 650, + "x-clicky-section": "sandbox", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, "serviceTier": { - "title": "Service tier", "description": "Processing tier selected for this turn.", - "type": "string", "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 660, - "x-captain-option": {"nativeName": "turn/start.serviceTier", "support": "unsupported", "note": "Captain does not select a Codex service tier."} + "description": "Processing tier selected for this turn.", + "readOnly": true, + "title": "Service tier", + "type": [ + "string", + "null" + ], + "x-captain-option": { + "nativeName": "turn/start.serviceTier", + "note": "Captain does not select a Codex service tier.", + "support": "unsupported" + }, + "x-clicky-order": 660, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, "serviceTierForTurn": { - "title": "Turn service tier", "description": "Whether a service tier applies only to this turn.", - "type": "boolean", "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 670, - "x-captain-option": {"nativeName": "turn/start.serviceTierForTurn", "support": "unsupported", "note": "Captain does not set per-turn Codex service tiers."} + "description": "Whether a service tier applies only to this turn.", + "readOnly": true, + "title": "Turn service tier", + "type": [ + "string", + "null" + ], + "x-captain-option": { + "nativeName": "turn/start.serviceTierForTurn", + "note": "Captain does not set per-turn Codex service tiers.", + "support": "unsupported" + }, + "x-clicky-order": 670, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, "summary": { - "title": "Reasoning summary", "description": "Reasoning-summary mode requested for the turn.", - "type": "string", "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 680, - "x-captain-option": {"nativeName": "turn/start.summary", "support": "unsupported", "note": "Captain maps effort but not the native reasoning-summary mode."} + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentReasoningSummary", + "description": "Summary configuration. See the linked native reference for semantics and availability.", + "title": "Summary", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Summary configuration. See the linked native reference for semantics and availability.", + "title": "Summary", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Reasoning-summary mode requested for the turn.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "readOnly": true, + "title": "Reasoning summary", + "x-captain-option": { + "nativeName": "turn/start.summary", + "note": "Captain maps effort but not the native reasoning-summary mode.", + "support": "unsupported" + }, + "x-clicky-order": 680, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + "threadId": { + "description": "Active Codex thread receiving the turn.", + "readOnly": true, + "title": "Thread ID", + "type": "string", + "x-captain-option": { + "nativeName": "turn/start.threadId", + "note": "Captain uses the identifier returned by thread/start or thread/resume.", + "support": "managed" + }, + "x-clicky-order": 470, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, "toolOutput": { - "title": "Tool output", "description": "Out-of-band tool output supplied with the turn-start request.", - "type": "object", "additionalProperties": true, "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 690, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "turn/start.toolOutput", "support": "unsupported", "note": "Captain sends tool results through its standard turn input items."} + "anyOf": [ + { + "$ref": "#/$defs/OpenAIAgentTurnToolOutput", + "description": "Tool Output configuration. See the linked native reference for semantics and availability.", + "title": "Tool Output", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + }, + { + "description": "Tool Output configuration. See the linked native reference for semantics and availability.", + "title": "Tool Output", + "type": "null", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } + } + ], + "description": "Out-of-band tool output supplied with the turn-start request.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "readOnly": true, + "title": "Tool output", + "x-captain-option": { + "nativeName": "turn/start.toolOutput", + "note": "Captain sends tool results through its standard turn input items.", + "support": "unsupported" + }, + "x-clicky-order": 690, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } }, "turnTrigger": { - "title": "Turn trigger", "description": "Source describing what triggered the Codex turn.", - "type": "string", "readOnly": true, "x-clicky-section": "environment", "x-clicky-order": 700, - "x-captain-option": {"nativeName": "turn/start.turnTrigger", "support": "unsupported", "note": "Captain does not set a native Codex turn-trigger label."} + "description": "Source describing what triggered the Codex turn.", + "readOnly": true, + "title": "Turn trigger", + "type": [ + "string", + "null" + ], + "x-captain-option": { + "nativeName": "turn/start.turnTrigger", + "note": "Captain does not set a native Codex turn-trigger label.", + "support": "unsupported" + }, + "x-clicky-order": 700, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] + } } + }, + "required": [ + "input", + "threadId" + ], + "title": "Turn start", + "type": "object", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] } } + }, + "title": "OpenAI Agent options", + "type": "object", + "x-captain-adapter": { + "mode": "agent", + "provider": "openai", + "sources": [ + { + "kind": "protocol", + "reference": "codex app-server generate-json-schema --experimental", + "version": "codex-cli 0.164.0" + }, + { + "kind": "implementation", + "reference": "pkg/ai/provider/codex_appserver.go and codex_appserver_protocol.go", + "version": "7220b7c99be01dfd9809a1fc237dafda9aa712b3" + } + ] + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/developers/app-server", + "label": "Documentation" + } + ] } } diff --git a/pkg/adapters/openai/api.schema.json b/pkg/adapters/openai/api.schema.json index 0c574b49..e8fc8023 100644 --- a/pkg/adapters/openai/api.schema.json +++ b/pkg/adapters/openai/api.schema.json @@ -1,150 +1,8197 @@ { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "OpenAIAPIOptions", - "description": "Native OpenAI Responses API request options used by Captain's API runtime.", - "type": "object", - "additionalProperties": false, - "x-captain-adapter": { - "provider": "openai", - "mode": "api", - "sources": [ - {"kind": "sdk", "reference": "github.com/openai/openai-go/responses.ResponseNewParams", "version": "v1.12.0"}, - {"kind": "official-docs", "reference": "https://developers.openai.com/api/reference/resources/responses/methods/create", "version": "retrieved 2026-09-11"}, - {"kind": "implementation", "reference": "pkg/ai/provider/openai/input.go", "version": "6a2b56cbd26702b18905865f21fc66d44cc864cc"} - ] - }, - "required": ["model", "input"], - "properties": { - "model": { - "title": "Model", "description": "OpenAI model identifier used to generate the response.", - "type": "string", "minLength": 1, "x-clicky-section": "model", "x-clicky-order": 10, "x-icon": "sparkles", - "x-captain-option": {"nativeName": "model", "support": "mapped", "specPath": "model.name"} + "$defs": { + "OpenaiAPIComparisonFilterParam": { + "additionalProperties": false, + "description": "A filter used to compare a specified attribute key to a given value using a\ndefined comparison operation.\n\nThe properties Key, Type, Value are required.\n", + "properties": { + "key": { + "description": "The key to compare against the value.\n", + "title": "Key", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`.\n\n- `eq`: equals\n- `ne`: not equal\n- `gt`: greater than\n- `gte`: greater than or equal\n- `lt`: less than\n- `lte`: less than or equal\n\nAny of \"eq\", \"ne\", \"gt\", \"gte\", \"lt\", \"lte\".\n", + "enum": [ + "eq", + "ne", + "gt", + "gte", + "lt", + "lte" + ], + "title": "Type", + "type": "string", + "x-clicky-order": 20, + "x-enum-display": "combobox", + "x-enum-labels": { + "eq": "Eq", + "gt": "Gt", + "gte": "Gte", + "lt": "Lt", + "lte": "Lte", + "ne": "Ne" + }, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "value": { + "$ref": "#/$defs/OpenaiAPIComparisonFilterValueUnionParam", + "description": "The value to compare against the attribute key; supports string, number, or\nboolean types.\n", + "title": "Value", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "key", + "type", + "value" + ], + "title": "OpenAI APIComparison Filter Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } }, - "input": { - "title": "Input", "description": "Text, image, file, conversation, and function-result items sent to the model.", - "oneOf": [{"type": "string"}, {"type": "array", "items": {"type": "object", "additionalProperties": true}}], "x-clicky-section": "prompt", "x-clicky-order": 20, "x-array-display": "stacked", - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "input", "support": "mapped", "specPath": ["messages", "prompt.user", "prompt.attachments", "toolApproval"]} + "OpenaiAPIComparisonFilterValueUnionParam": { + "anyOf": [ + { + "description": "OpenAI APIComparison Filter Value Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIComparison Filter Value Union Param", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "description": "OpenAI APIComparison Filter Value Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIComparison Filter Value Union Param", + "type": "number", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "description": "OpenAI APIComparison Filter Value Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIComparison Filter Value Union Param", + "type": "boolean", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + ], + "description": "OpenAI APIComparison Filter Value Union Param configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "OpenAI APIComparison Filter Value Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } }, - "instructions": { - "title": "Instructions", "description": "System or developer instructions inserted into the model context.", - "type": "string", "x-clicky-section": "prompt", "x-clicky-order": 30, - "x-captain-option": {"nativeName": "instructions", "support": "mapped", "specPath": "prompt.system"} + "OpenaiAPICompoundFilterParam": { + "additionalProperties": false, + "description": "Combine multiple filters using `and` or `or`.\n\nThe properties Filters, Type are required.\n", + "properties": { + "filters": { + "description": "Array of filters to combine. Items can be `ComparisonFilter` or\n`CompoundFilter`.\n", + "items": { + "$ref": "#/$defs/OpenaiAPIComparisonFilterParam", + "description": "Filters value configuration. See the linked native reference for semantics and availability.", + "title": "Filters value", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "title": "Filters", + "type": "array", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "Type of operation: `and` or `or`.\n\nAny of \"and\", \"or\".\n", + "enum": [ + "and", + "or" + ], + "title": "Type", + "type": "string", + "x-clicky-order": 20, + "x-enum-display": "segmented", + "x-enum-labels": { + "and": "And", + "or": "Or" + }, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "filters", + "type" + ], + "title": "OpenAI APICompound Filter Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } }, - "max_output_tokens": { - "title": "Maximum output tokens", "description": "Upper bound covering visible output and reasoning tokens.", - "type": "integer", "minimum": 1, "x-clicky-section": "model", "x-clicky-order": 40, "x-icon": "hash", - "x-captain-option": {"nativeName": "max_output_tokens", "support": "mapped", "specPath": "budget.maxTokens"} + "OpenaiAPIComputerToolParam": { + "additionalProperties": false, + "description": "A tool that controls a virtual computer. Learn more about the\n[computer tool](https://platform.openai.com/docs/guides/tools-computer-use).\n\nThe properties DisplayHeight, DisplayWidth, Environment, Type are required.\n", + "properties": { + "display_height": { + "description": "The height of the computer display.\n", + "title": "Display height", + "type": "integer", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "display_width": { + "description": "The width of the computer display.\n", + "title": "Display width", + "type": "integer", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "environment": { + "description": "The type of computer environment to control.\n\nAny of \"windows\", \"mac\", \"linux\", \"ubuntu\", \"browser\".\n", + "enum": [ + "windows", + "mac", + "linux", + "ubuntu", + "browser" + ], + "title": "Environment", + "type": "string", + "x-clicky-order": 30, + "x-enum-display": "combobox", + "x-enum-labels": { + "browser": "Browser", + "linux": "Linux", + "mac": "Mac", + "ubuntu": "Ubuntu", + "windows": "Windows" + }, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "computer_use_preview", + "description": "The type of the computer use tool. Always `computer_use_preview`.\n\nThis field can be elided, and will marshal its zero value as\n\"computer_use_preview\".\n", + "title": "Type", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "display_height", + "display_width", + "environment", + "type" + ], + "title": "OpenAI APIComputer Tool Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } }, - "temperature": { - "title": "Temperature", "description": "Sampling temperature between zero and two.", - "type": "number", "minimum": 0, "maximum": 2, "x-clicky-section": "model", "x-clicky-order": 50, - "x-captain-option": {"nativeName": "temperature", "support": "mapped", "specPath": "model.temperature"} + "OpenaiAPIEasyInputMessageContentUnionParam": { + "anyOf": [ + { + "description": "OpenAI APIEasy Input Message Content Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIEasy Input Message Content Union Param", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "description": "OpenAI APIEasy Input Message Content Union Param configuration. See the linked native reference for semantics and availability.", + "items": { + "$ref": "#/$defs/OpenaiAPIResponseInputContentUnionParam", + "description": "OpenAI APIEasy Input Message Content Union Param value configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIEasy Input Message Content Union Param value", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "title": "OpenAI APIEasy Input Message Content Union Param", + "type": "array", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + ], + "description": "OpenAI APIEasy Input Message Content Union Param configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "OpenAI APIEasy Input Message Content Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } }, - "reasoning": { - "title": "Reasoning", "description": "Reasoning effort and summary configuration for reasoning models.", - "type": "object", "additionalProperties": true, "x-clicky-section": "model", "x-clicky-order": 60, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "reasoning", "support": "mapped", "specPath": "model.effort"} + "OpenaiAPIEasyInputMessageParam": { + "additionalProperties": false, + "description": "A message input to the model with a role indicating instruction following\nhierarchy. Instructions given with the `developer` or `system` role take\nprecedence over instructions given with the `user` role. Messages with the\n`assistant` role are presumed to have been generated by the model in previous\ninteractions.\n\nThe properties Content, Role are required.\n", + "properties": { + "content": { + "$ref": "#/$defs/OpenaiAPIEasyInputMessageContentUnionParam", + "description": "Text, image, or audio input to the model, used to generate a response. Can also\ncontain previous assistant responses.\n", + "title": "Content", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "role": { + "description": "The role of the message input. One of `user`, `assistant`, `system`, or\n`developer`.\n\nAny of \"user\", \"assistant\", \"system\", \"developer\".\n", + "enum": [ + "user", + "assistant", + "system", + "developer" + ], + "title": "Role", + "type": "string", + "x-clicky-order": 20, + "x-enum-display": "segmented", + "x-enum-labels": { + "assistant": "Assistant", + "developer": "Developer", + "system": "System", + "user": "User" + }, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "The type of the message input. Always `message`.\n\nAny of \"message\".\n", + "enum": [ + "message" + ], + "title": "Type", + "type": "string", + "x-clicky-order": 30, + "x-enum-display": "segmented", + "x-enum-labels": { + "message": "Message" + }, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "content", + "role" + ], + "title": "OpenAI APIEasy Input Message Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } }, - "text": { - "title": "Text output", "description": "Plain-text or JSON Schema output configuration.", - "type": "object", "additionalProperties": true, "x-clicky-section": "prompt", "x-clicky-order": 70, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "text", "support": "mapped", "specPath": ["prompt.schema", "prompt.schemaJson"]} + "OpenaiAPIFileSearchToolFiltersUnionParam": { + "anyOf": [ + { + "$ref": "#/$defs/OpenaiAPIComparisonFilterParam", + "description": "OpenAI APIFile Search Tool Filters Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIFile Search Tool Filters Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPICompoundFilterParam", + "description": "OpenAI APIFile Search Tool Filters Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIFile Search Tool Filters Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + ], + "description": "OpenAI APIFile Search Tool Filters Union Param configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "OpenAI APIFile Search Tool Filters Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } }, - "tools": { - "title": "Tools", "description": "Native Responses API tool definitions derived from Captain caller tools.", - "type": "array", "items": {"type": "object", "additionalProperties": true}, "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 80, "x-array-display": "stacked", - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "tools", "support": "managed", "note": "Captain derives function tools from runtime Config.Tools and the Spec tool policy."} + "OpenaiAPIFileSearchToolParam": { + "additionalProperties": false, + "description": "A tool that searches for relevant content from uploaded files. Learn more about\nthe\n[file search tool](https://platform.openai.com/docs/guides/tools-file-search).\n\nThe properties Type, VectorStoreIDs are required.\n", + "properties": { + "filters": { + "$ref": "#/$defs/OpenaiAPIFileSearchToolFiltersUnionParam", + "description": "A filter to apply.\n", + "title": "Filters", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "max_num_results": { + "description": "The maximum number of results to return. This number should be between 1 and 50\ninclusive.\n", + "title": "Max num results", + "type": "integer", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "ranking_options": { + "$ref": "#/$defs/OpenaiAPIFileSearchToolRankingOptionsParam", + "description": "Ranking options for search.\n", + "title": "Ranking options", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "file_search", + "description": "The type of the file search tool. Always `file_search`.\n\nThis field can be elided, and will marshal its zero value as \"file_search\".\n", + "title": "Type", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "vector_store_ids": { + "description": "The IDs of the vector stores to search.\n", + "items": { + "description": "Vector store ids value configuration. See the linked native reference for semantics and availability.", + "title": "Vector store ids value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "title": "Vector store ids", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "vector_store_ids", + "type" + ], + "title": "OpenAI APIFile Search Tool Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } }, - "include": { - "title": "Included output data", "description": "Additional response fields requested from the Responses API.", - "type": "array", "items": {"type": "string"}, "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 90, "x-array-display": "list", - "x-captain-option": {"nativeName": "include", "support": "managed", "note": "Captain always requests reasoning.encrypted_content for stateless tool loops."} + "OpenaiAPIFileSearchToolRankingOptionsParam": { + "additionalProperties": false, + "description": "Ranking options for search.\n", + "properties": { + "ranker": { + "description": "The ranker to use for the file search.\n\nAny of \"auto\", \"default-2024-11-15\".\n", + "title": "Ranker", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "score_threshold": { + "description": "The score threshold for the file search, a number between 0 and 1. Numbers\ncloser to 1 will attempt to return only the most relevant results, but may\nreturn fewer results.\n", + "title": "Score threshold", + "type": "number", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "title": "OpenAI APIFile Search Tool Ranking Options Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } }, - "store": { - "title": "Store response", "description": "Whether OpenAI stores the generated response for later retrieval.", - "type": "boolean", "const": false, "readOnly": true, "x-clicky-section": "environment", "x-clicky-order": 100, - "x-captain-option": {"nativeName": "store", "support": "managed", "note": "Captain always disables remote response storage and replays its own history."} + "OpenaiAPIFunctionToolParam": { + "additionalProperties": false, + "description": "Defines a function in your own code the model can choose to call. Learn more\nabout\n[function calling](https://platform.openai.com/docs/guides/function-calling).\n\nThe properties Name, Parameters, Strict, Type are required.\n", + "properties": { + "description": { + "description": "A description of the function. Used by the model to determine whether or not to\ncall the function.\n", + "title": "Description", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "name": { + "description": "The name of the function to call.\n", + "title": "Name", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "parameters": { + "additionalProperties": { + "description": "Parameters value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Parameters value", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "description": "A JSON schema object describing the parameters of the function.\n", + "title": "Parameters", + "type": "object", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "strict": { + "description": "Whether to enforce strict parameter validation. Default `true`.\n", + "title": "Strict", + "type": "boolean", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "function", + "description": "The type of the function tool. Always `function`.\n\nThis field can be elided, and will marshal its zero value as \"function\".\n", + "title": "Type", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "strict", + "parameters", + "name", + "type" + ], + "title": "OpenAI APIFunction Tool Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } }, - "stream": { - "title": "Stream", "description": "Whether the response is returned as server-sent streaming events.", - "type": "boolean", "const": true, "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 110, - "x-captain-option": {"nativeName": "stream", "support": "managed", "note": "Captain uses Responses.NewStreaming for its streaming provider."} + "OpenaiAPIReasoningParam": { + "additionalProperties": false, + "description": "**o-series models only**\n\nConfiguration options for\n[reasoning models](https://platform.openai.com/docs/guides/reasoning).\n", + "properties": { + "effort": { + "description": "**o-series models only**\n\nConstrains effort on reasoning for\n[reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently\nsupported values are `low`, `medium`, and `high`. Reducing reasoning effort can\nresult in faster responses and fewer tokens used on reasoning in a response.\n\nAny of \"low\", \"medium\", \"high\".\n", + "enum": [ + "low", + "medium", + "high" + ], + "title": "Effort", + "type": "string", + "x-clicky-order": 10, + "x-enum-display": "segmented", + "x-enum-labels": { + "high": "High", + "low": "Low", + "medium": "Medium" + }, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "generate_summary": { + "description": "**Deprecated:** use `summary` instead.\n\nA summary of the reasoning performed by the model. This can be useful for\ndebugging and understanding the model's reasoning process. One of `auto`,\n`concise`, or `detailed`.\n\nAny of \"auto\", \"concise\", \"detailed\".\n\nDeprecated: deprecated\n", + "enum": [ + "auto", + "concise", + "detailed" + ], + "title": "Generate summary", + "type": "string", + "x-clicky-order": 20, + "x-enum-display": "segmented", + "x-enum-labels": { + "auto": "Auto", + "concise": "Concise", + "detailed": "Detailed" + }, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "summary": { + "description": "A summary of the reasoning performed by the model. This can be useful for\ndebugging and understanding the model's reasoning process. One of `auto`,\n`concise`, or `detailed`.\n\nAny of \"auto\", \"concise\", \"detailed\".\n", + "enum": [ + "auto", + "concise", + "detailed" + ], + "title": "Summary", + "type": "string", + "x-clicky-order": 30, + "x-enum-display": "segmented", + "x-enum-labels": { + "auto": "Auto", + "concise": "Concise", + "detailed": "Detailed" + }, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "title": "OpenAI APIReasoning Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseCodeInterpreterToolCallOutputImageParam": { + "additionalProperties": false, + "description": "The image output from the code interpreter.\n\nThe properties Type, URL are required.\n", + "properties": { + "type": { + "const": "image", + "description": "The type of the output. Always 'image'.\n\nThis field can be elided, and will marshal its zero value as \"image\".\n", + "title": "Type", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "The URL of the image output from the code interpreter.\n", + "title": "Url", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "url", + "type" + ], + "title": "OpenAI APIResponse Code Interpreter Tool Call Output Image Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseCodeInterpreterToolCallOutputLogsParam": { + "additionalProperties": false, + "description": "The logs output from the code interpreter.\n\nThe properties Logs, Type are required.\n", + "properties": { + "logs": { + "description": "The logs output from the code interpreter.\n", + "title": "Logs", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "logs", + "description": "The type of the output. Always 'logs'.\n\nThis field can be elided, and will marshal its zero value as \"logs\".\n", + "title": "Type", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "logs", + "type" + ], + "title": "OpenAI APIResponse Code Interpreter Tool Call Output Logs Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseCodeInterpreterToolCallOutputUnionParam": { + "anyOf": [ + { + "$ref": "#/$defs/OpenaiAPIResponseCodeInterpreterToolCallOutputLogsParam", + "description": "OpenAI APIResponse Code Interpreter Tool Call Output Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Code Interpreter Tool Call Output Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIResponseCodeInterpreterToolCallOutputImageParam", + "description": "OpenAI APIResponse Code Interpreter Tool Call Output Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Code Interpreter Tool Call Output Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + ], + "description": "OpenAI APIResponse Code Interpreter Tool Call Output Union Param configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "OpenAI APIResponse Code Interpreter Tool Call Output Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseCodeInterpreterToolCallParam": { + "additionalProperties": false, + "description": "A tool call to run code.\n\nThe properties ID, Code, ContainerID, Outputs, Status, Type are required.\n", + "properties": { + "code": { + "description": "The code to run, or null if not available.\n", + "title": "Code", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "container_id": { + "description": "The ID of the container used to run the code.\n", + "title": "Container id", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "id": { + "description": "The unique ID of the code interpreter tool call.\n", + "title": "Id", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "outputs": { + "description": "The outputs generated by the code interpreter, such as logs or images. Can be\nnull if no outputs are available.\n", + "items": { + "$ref": "#/$defs/OpenaiAPIResponseCodeInterpreterToolCallOutputUnionParam", + "description": "Outputs value configuration. See the linked native reference for semantics and availability.", + "title": "Outputs value", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "title": "Outputs", + "type": "array", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "status": { + "description": "The status of the code interpreter tool call. Valid values are `in_progress`,\n`completed`, `incomplete`, `interpreting`, and `failed`.\n\nAny of \"in_progress\", \"completed\", \"incomplete\", \"interpreting\", \"failed\".\n", + "enum": [ + "in_progress", + "completed", + "incomplete", + "interpreting", + "failed" + ], + "title": "Status", + "type": "string", + "x-clicky-order": 50, + "x-enum-display": "combobox", + "x-enum-labels": { + "completed": "Completed", + "failed": "Failed", + "in_progress": "In progress", + "incomplete": "Incomplete", + "interpreting": "Interpreting" + }, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "code_interpreter_call", + "description": "The type of the code interpreter tool call. Always `code_interpreter_call`.\n\nThis field can be elided, and will marshal its zero value as\n\"code_interpreter_call\".\n", + "title": "Type", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "code", + "outputs", + "id", + "container_id", + "status", + "type" + ], + "title": "OpenAI APIResponse Code Interpreter Tool Call Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseComputerToolCallActionClickParam": { + "additionalProperties": false, + "description": "A click action.\n\nThe properties Button, Type, X, Y are required.\n", + "properties": { + "button": { + "description": "Indicates which mouse button was pressed during the click. One of `left`,\n`right`, `wheel`, `back`, or `forward`.\n\nAny of \"left\", \"right\", \"wheel\", \"back\", \"forward\".\n", + "title": "Button", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "click", + "description": "Specifies the event type. For a click action, this property is always set to\n`click`.\n\nThis field can be elided, and will marshal its zero value as \"click\".\n", + "title": "Type", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "x": { + "description": "The x-coordinate where the click occurred.\n", + "title": "X", + "type": "integer", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "y": { + "description": "The y-coordinate where the click occurred.\n", + "title": "Y", + "type": "integer", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "button", + "x", + "y", + "type" + ], + "title": "OpenAI APIResponse Computer Tool Call Action Click Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseComputerToolCallActionDoubleClickParam": { + "additionalProperties": false, + "description": "A double click action.\n\nThe properties Type, X, Y are required.\n", + "properties": { + "type": { + "const": "double_click", + "description": "Specifies the event type. For a double click action, this property is always set\nto `double_click`.\n\nThis field can be elided, and will marshal its zero value as \"double_click\".\n", + "title": "Type", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "x": { + "description": "The x-coordinate where the double click occurred.\n", + "title": "X", + "type": "integer", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "y": { + "description": "The y-coordinate where the double click occurred.\n", + "title": "Y", + "type": "integer", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "x", + "y", + "type" + ], + "title": "OpenAI APIResponse Computer Tool Call Action Double Click Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseComputerToolCallActionDragParam": { + "additionalProperties": false, + "description": "A drag action.\n\nThe properties Path, Type are required.\n", + "properties": { + "path": { + "description": "An array of coordinates representing the path of the drag action. Coordinates\nwill appear as an array of objects, eg\n\n```\n[\n\n\t{ x: 100, y: 200 },\n\t{ x: 200, y: 300 }\n\n]\n```\n", + "items": { + "$ref": "#/$defs/OpenaiAPIResponseComputerToolCallActionDragPathParam", + "description": "Path value configuration. See the linked native reference for semantics and availability.", + "title": "Path value", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "title": "Path", + "type": "array", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "drag", + "description": "Specifies the event type. For a drag action, this property is always set to\n`drag`.\n\nThis field can be elided, and will marshal its zero value as \"drag\".\n", + "title": "Type", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "path", + "type" + ], + "title": "OpenAI APIResponse Computer Tool Call Action Drag Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseComputerToolCallActionDragPathParam": { + "additionalProperties": false, + "description": "A series of x/y coordinate pairs in the drag path.\n\nThe properties X, Y are required.\n", + "properties": { + "x": { + "description": "The x-coordinate.\n", + "title": "X", + "type": "integer", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "y": { + "description": "The y-coordinate.\n", + "title": "Y", + "type": "integer", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "x", + "y" + ], + "title": "OpenAI APIResponse Computer Tool Call Action Drag Path Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseComputerToolCallActionKeypressParam": { + "additionalProperties": false, + "description": "A collection of keypresses the model would like to perform.\n\nThe properties Keys, Type are required.\n", + "properties": { + "keys": { + "description": "The combination of keys the model is requesting to be pressed. This is an array\nof strings, each representing a key.\n", + "items": { + "description": "Keys value configuration. See the linked native reference for semantics and availability.", + "title": "Keys value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "title": "Keys", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "keypress", + "description": "Specifies the event type. For a keypress action, this property is always set to\n`keypress`.\n\nThis field can be elided, and will marshal its zero value as \"keypress\".\n", + "title": "Type", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "keys", + "type" + ], + "title": "OpenAI APIResponse Computer Tool Call Action Keypress Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseComputerToolCallActionMoveParam": { + "additionalProperties": false, + "description": "A mouse move action.\n\nThe properties Type, X, Y are required.\n", + "properties": { + "type": { + "const": "move", + "description": "Specifies the event type. For a move action, this property is always set to\n`move`.\n\nThis field can be elided, and will marshal its zero value as \"move\".\n", + "title": "Type", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "x": { + "description": "The x-coordinate to move to.\n", + "title": "X", + "type": "integer", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "y": { + "description": "The y-coordinate to move to.\n", + "title": "Y", + "type": "integer", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "x", + "y", + "type" + ], + "title": "OpenAI APIResponse Computer Tool Call Action Move Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseComputerToolCallActionScreenshotParam": { + "additionalProperties": false, + "description": "A screenshot action.\n\nThis struct has a constant value, construct it with\n[NewResponseComputerToolCallActionScreenshotParam].\n", + "properties": { + "type": { + "const": "screenshot", + "description": "Specifies the event type. For a screenshot action, this property is always set\nto `screenshot`.\n", + "title": "Type", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type" + ], + "title": "OpenAI APIResponse Computer Tool Call Action Screenshot Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseComputerToolCallActionScrollParam": { + "additionalProperties": false, + "description": "A scroll action.\n\nThe properties ScrollX, ScrollY, Type, X, Y are required.\n", + "properties": { + "scroll_x": { + "description": "The horizontal scroll distance.\n", + "title": "Scroll x", + "type": "integer", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "scroll_y": { + "description": "The vertical scroll distance.\n", + "title": "Scroll y", + "type": "integer", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "scroll", + "description": "Specifies the event type. For a scroll action, this property is always set to\n`scroll`.\n\nThis field can be elided, and will marshal its zero value as \"scroll\".\n", + "title": "Type", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "x": { + "description": "The x-coordinate where the scroll occurred.\n", + "title": "X", + "type": "integer", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "y": { + "description": "The y-coordinate where the scroll occurred.\n", + "title": "Y", + "type": "integer", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "scroll_x", + "scroll_y", + "x", + "y", + "type" + ], + "title": "OpenAI APIResponse Computer Tool Call Action Scroll Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseComputerToolCallActionTypeParam": { + "additionalProperties": false, + "description": "An action to type in text.\n\nThe properties Text, Type are required.\n", + "properties": { + "text": { + "description": "The text to type.\n", + "title": "Text", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "type", + "description": "Specifies the event type. For a type action, this property is always set to\n`type`.\n\nThis field can be elided, and will marshal its zero value as \"type\".\n", + "title": "Type", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "text", + "type" + ], + "title": "OpenAI APIResponse Computer Tool Call Action Type Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseComputerToolCallActionUnionParam": { + "anyOf": [ + { + "$ref": "#/$defs/OpenaiAPIResponseComputerToolCallActionClickParam", + "description": "OpenAI APIResponse Computer Tool Call Action Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Computer Tool Call Action Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIResponseComputerToolCallActionDoubleClickParam", + "description": "OpenAI APIResponse Computer Tool Call Action Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Computer Tool Call Action Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIResponseComputerToolCallActionDragParam", + "description": "OpenAI APIResponse Computer Tool Call Action Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Computer Tool Call Action Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIResponseComputerToolCallActionKeypressParam", + "description": "OpenAI APIResponse Computer Tool Call Action Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Computer Tool Call Action Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIResponseComputerToolCallActionMoveParam", + "description": "OpenAI APIResponse Computer Tool Call Action Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Computer Tool Call Action Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIResponseComputerToolCallActionScreenshotParam", + "description": "OpenAI APIResponse Computer Tool Call Action Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Computer Tool Call Action Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIResponseComputerToolCallActionScrollParam", + "description": "OpenAI APIResponse Computer Tool Call Action Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Computer Tool Call Action Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIResponseComputerToolCallActionTypeParam", + "description": "OpenAI APIResponse Computer Tool Call Action Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Computer Tool Call Action Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIResponseComputerToolCallActionWaitParam", + "description": "OpenAI APIResponse Computer Tool Call Action Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Computer Tool Call Action Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + ], + "description": "OpenAI APIResponse Computer Tool Call Action Union Param configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "OpenAI APIResponse Computer Tool Call Action Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseComputerToolCallActionWaitParam": { + "additionalProperties": false, + "description": "A wait action.\n\nThis struct has a constant value, construct it with\n[NewResponseComputerToolCallActionWaitParam].\n", + "properties": { + "type": { + "const": "wait", + "description": "Specifies the event type. For a wait action, this property is always set to\n`wait`.\n", + "title": "Type", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type" + ], + "title": "OpenAI APIResponse Computer Tool Call Action Wait Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseComputerToolCallOutputScreenshotParam": { + "additionalProperties": false, + "description": "A computer screenshot image used with the computer use tool.\n\nThe property Type is required.\n", + "properties": { + "file_id": { + "description": "The identifier of an uploaded file that contains the screenshot.\n", + "title": "File id", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "image_url": { + "description": "The URL of the screenshot image.\n", + "title": "Image url", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "computer_screenshot", + "description": "Specifies the event type. For a computer screenshot, this property is always set\nto `computer_screenshot`.\n\nThis field can be elided, and will marshal its zero value as\n\"computer_screenshot\".\n", + "title": "Type", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type" + ], + "title": "OpenAI APIResponse Computer Tool Call Output Screenshot Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseComputerToolCallParam": { + "additionalProperties": false, + "description": "A tool call to a computer use tool. See the\n[computer use guide](https://platform.openai.com/docs/guides/tools-computer-use)\nfor more information.\n\nThe properties ID, Action, CallID, PendingSafetyChecks, Status, Type are\nrequired.\n", + "properties": { + "action": { + "$ref": "#/$defs/OpenaiAPIResponseComputerToolCallActionUnionParam", + "description": "A click action.\n", + "title": "Action", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "call_id": { + "description": "An identifier used when responding to the tool call with output.\n", + "title": "Call id", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "id": { + "description": "The unique ID of the computer call.\n", + "title": "Id", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "pending_safety_checks": { + "description": "The pending safety checks for the computer call.\n", + "items": { + "$ref": "#/$defs/OpenaiAPIResponseComputerToolCallPendingSafetyCheckParam", + "description": "Pending safety checks value configuration. See the linked native reference for semantics and availability.", + "title": "Pending safety checks value", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "title": "Pending safety checks", + "type": "array", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "status": { + "description": "The status of the item. One of `in_progress`, `completed`, or `incomplete`.\nPopulated when items are returned via API.\n\nAny of \"in_progress\", \"completed\", \"incomplete\".\n", + "enum": [ + "in_progress", + "completed", + "incomplete" + ], + "title": "Status", + "type": "string", + "x-clicky-order": 50, + "x-enum-display": "segmented", + "x-enum-labels": { + "completed": "Completed", + "in_progress": "In progress", + "incomplete": "Incomplete" + }, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "The type of the computer call. Always `computer_call`.\n\nAny of \"computer_call\".\n", + "enum": [ + "computer_call" + ], + "title": "Type", + "type": "string", + "x-clicky-order": 60, + "x-enum-display": "segmented", + "x-enum-labels": { + "computer_call": "Computer call" + }, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "id", + "action", + "call_id", + "pending_safety_checks", + "status", + "type" + ], + "title": "OpenAI APIResponse Computer Tool Call Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseComputerToolCallPendingSafetyCheckParam": { + "additionalProperties": false, + "description": "A pending safety check for the computer call.\n\nThe properties ID, Code, Message are required.\n", + "properties": { + "code": { + "description": "The type of the pending safety check.\n", + "title": "Code", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "id": { + "description": "The ID of the pending safety check.\n", + "title": "Id", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "message": { + "description": "Details about the pending safety check.\n", + "title": "Message", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "id", + "code", + "message" + ], + "title": "OpenAI APIResponse Computer Tool Call Pending Safety Check Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseFileSearchToolCallParam": { + "additionalProperties": false, + "description": "The results of a file search tool call. See the\n[file search guide](https://platform.openai.com/docs/guides/tools-file-search)\nfor more information.\n\nThe properties ID, Queries, Status, Type are required.\n", + "properties": { + "id": { + "description": "The unique ID of the file search tool call.\n", + "title": "Id", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "queries": { + "description": "The queries used to search for files.\n", + "items": { + "description": "Queries value configuration. See the linked native reference for semantics and availability.", + "title": "Queries value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "title": "Queries", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "results": { + "description": "The results of the file search tool call.\n", + "items": { + "$ref": "#/$defs/OpenaiAPIResponseFileSearchToolCallResultParam", + "description": "Results value configuration. See the linked native reference for semantics and availability.", + "title": "Results value", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "title": "Results", + "type": "array", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "status": { + "description": "The status of the file search tool call. One of `in_progress`, `searching`,\n`incomplete` or `failed`,\n\nAny of \"in_progress\", \"searching\", \"completed\", \"incomplete\", \"failed\".\n", + "enum": [ + "in_progress", + "searching", + "completed", + "incomplete", + "failed" + ], + "title": "Status", + "type": "string", + "x-clicky-order": 40, + "x-enum-display": "combobox", + "x-enum-labels": { + "completed": "Completed", + "failed": "Failed", + "in_progress": "In progress", + "incomplete": "Incomplete", + "searching": "Searching" + }, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "file_search_call", + "description": "The type of the file search tool call. Always `file_search_call`.\n\nThis field can be elided, and will marshal its zero value as \"file_search_call\".\n", + "title": "Type", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "id", + "queries", + "status", + "type" + ], + "title": "OpenAI APIResponse File Search Tool Call Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseFileSearchToolCallResultAttributeUnionParam": { + "anyOf": [ + { + "description": "OpenAI APIResponse File Search Tool Call Result Attribute Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse File Search Tool Call Result Attribute Union Param", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "description": "OpenAI APIResponse File Search Tool Call Result Attribute Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse File Search Tool Call Result Attribute Union Param", + "type": "number", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "description": "OpenAI APIResponse File Search Tool Call Result Attribute Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse File Search Tool Call Result Attribute Union Param", + "type": "boolean", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + ], + "description": "OpenAI APIResponse File Search Tool Call Result Attribute Union Param configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "OpenAI APIResponse File Search Tool Call Result Attribute Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseFileSearchToolCallResultParam": { + "additionalProperties": false, + "description": "OpenAI APIResponse File Search Tool Call Result Param configuration. See the linked native reference for semantics and availability.", + "properties": { + "attributes": { + "additionalProperties": { + "$ref": "#/$defs/OpenaiAPIResponseFileSearchToolCallResultAttributeUnionParam", + "description": "Attributes value configuration. See the linked native reference for semantics and availability.", + "title": "Attributes value", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "description": "Set of 16 key-value pairs that can be attached to an object. This can be useful\nfor storing additional information about the object in a structured format, and\nquerying for objects via API or the dashboard. Keys are strings with a maximum\nlength of 64 characters. Values are strings with a maximum length of 512\ncharacters, booleans, or numbers.\n", + "title": "Attributes", + "type": "object", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "file_id": { + "description": "The unique ID of the file.\n", + "title": "File id", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "filename": { + "description": "The name of the file.\n", + "title": "Filename", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "score": { + "description": "The relevance score of the file - a value between 0 and 1.\n", + "title": "Score", + "type": "number", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "text": { + "description": "The text that was retrieved from the file.\n", + "title": "Text", + "type": "string", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "title": "OpenAI APIResponse File Search Tool Call Result Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseFormatJSONObjectParam": { + "additionalProperties": false, + "description": "JSON object response format. An older method of generating JSON responses. Using\n`json_schema` is recommended for models that support it. Note that the model\nwill not generate JSON without a system or user message instructing it to do so.\n\nThis struct has a constant value, construct it with\n[NewResponseFormatJSONObjectParam].\n", + "properties": { + "type": { + "const": "json_object", + "description": "The type of response format being defined. Always `json_object`.\n", + "title": "Type", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type" + ], + "title": "OpenAI APIResponse Format JSONObject Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseFormatTextConfigUnionParam": { + "anyOf": [ + { + "$ref": "#/$defs/OpenaiAPIResponseFormatTextParam", + "description": "OpenAI APIResponse Format Text Config Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Format Text Config Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIResponseFormatTextJSONSchemaConfigParam", + "description": "OpenAI APIResponse Format Text Config Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Format Text Config Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIResponseFormatJSONObjectParam", + "description": "OpenAI APIResponse Format Text Config Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Format Text Config Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + ], + "description": "OpenAI APIResponse Format Text Config Union Param configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "OpenAI APIResponse Format Text Config Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseFormatTextJSONSchemaConfigParam": { + "additionalProperties": false, + "description": "JSON Schema response format. Used to generate structured JSON responses. Learn\nmore about\n[Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).\n\nThe properties Name, Schema, Type are required.\n", + "properties": { + "description": { + "description": "A description of what the response format is for, used by the model to determine\nhow to respond in the format.\n", + "title": "Description", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "name": { + "description": "The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores\nand dashes, with a maximum length of 64.\n", + "title": "Name", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "schema": { + "additionalProperties": { + "description": "Schema value configuration. See the linked native reference for semantics and availability.", + "format": "json", + "title": "Schema value", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "description": "The schema for the response format, described as a JSON Schema object. Learn how\nto build JSON schemas [here](https://json-schema.org/).\n", + "title": "Schema", + "type": "object", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "strict": { + "description": "Whether to enable strict schema adherence when generating the output. If set to\ntrue, the model will always follow the exact schema defined in the `schema`\nfield. Only a subset of JSON Schema is supported when `strict` is `true`. To\nlearn more, read the\n[Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).\n", + "title": "Strict", + "type": "boolean", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "json_schema", + "description": "The type of response format being defined. Always `json_schema`.\n\nThis field can be elided, and will marshal its zero value as \"json_schema\".\n", + "title": "Type", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "name", + "schema", + "type" + ], + "title": "OpenAI APIResponse Format Text JSONSchema Config Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseFormatTextParam": { + "additionalProperties": false, + "description": "Default response format. Used to generate text responses.\n\nThis struct has a constant value, construct it with\n[NewResponseFormatTextParam].\n", + "properties": { + "type": { + "const": "text", + "description": "The type of response format being defined. Always `text`.\n", + "title": "Type", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type" + ], + "title": "OpenAI APIResponse Format Text Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseFunctionToolCallParam": { + "additionalProperties": false, + "description": "A tool call to run a function. See the\n[function calling guide](https://platform.openai.com/docs/guides/function-calling)\nfor more information.\n\nThe properties Arguments, CallID, Name, Type are required.\n", + "properties": { + "arguments": { + "description": "A JSON string of the arguments to pass to the function.\n", + "title": "Arguments", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "call_id": { + "description": "The unique ID of the function tool call generated by the model.\n", + "title": "Call id", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "id": { + "description": "The unique ID of the function tool call.\n", + "title": "Id", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "name": { + "description": "The name of the function to run.\n", + "title": "Name", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "status": { + "description": "The status of the item. One of `in_progress`, `completed`, or `incomplete`.\nPopulated when items are returned via API.\n\nAny of \"in_progress\", \"completed\", \"incomplete\".\n", + "enum": [ + "in_progress", + "completed", + "incomplete" + ], + "title": "Status", + "type": "string", + "x-clicky-order": 50, + "x-enum-display": "segmented", + "x-enum-labels": { + "completed": "Completed", + "in_progress": "In progress", + "incomplete": "Incomplete" + }, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "function_call", + "description": "The type of the function tool call. Always `function_call`.\n\nThis field can be elided, and will marshal its zero value as \"function_call\".\n", + "title": "Type", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "arguments", + "call_id", + "name", + "type" + ], + "title": "OpenAI APIResponse Function Tool Call Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseFunctionWebSearchActionFindParam": { + "additionalProperties": false, + "description": "Action type \"find\": Searches for a pattern within a loaded page.\n\nThe properties Pattern, Type, URL are required.\n", + "properties": { + "pattern": { + "description": "The pattern or text to search for within the page.\n", + "title": "Pattern", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "find", + "description": "The action type.\n\nThis field can be elided, and will marshal its zero value as \"find\".\n", + "title": "Type", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "The URL of the page searched for the pattern.\n", + "title": "Url", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "pattern", + "url", + "type" + ], + "title": "OpenAI APIResponse Function Web Search Action Find Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseFunctionWebSearchActionOpenPageParam": { + "additionalProperties": false, + "description": "Action type \"open_page\" - Opens a specific URL from search results.\n\nThe properties Type, URL are required.\n", + "properties": { + "type": { + "const": "open_page", + "description": "The action type.\n\nThis field can be elided, and will marshal its zero value as \"open_page\".\n", + "title": "Type", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "The URL opened by the model.\n", + "title": "Url", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "url", + "type" + ], + "title": "OpenAI APIResponse Function Web Search Action Open Page Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseFunctionWebSearchActionSearchParam": { + "additionalProperties": false, + "description": "Action type \"search\" - Performs a web search query.\n\nThe properties Query, Type are required.\n", + "properties": { + "query": { + "description": "The search query.\n", + "title": "Query", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "search", + "description": "The action type.\n\nThis field can be elided, and will marshal its zero value as \"search\".\n", + "title": "Type", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "query", + "type" + ], + "title": "OpenAI APIResponse Function Web Search Action Search Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseFunctionWebSearchActionUnionParam": { + "anyOf": [ + { + "$ref": "#/$defs/OpenaiAPIResponseFunctionWebSearchActionSearchParam", + "description": "OpenAI APIResponse Function Web Search Action Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Function Web Search Action Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIResponseFunctionWebSearchActionOpenPageParam", + "description": "OpenAI APIResponse Function Web Search Action Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Function Web Search Action Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIResponseFunctionWebSearchActionFindParam", + "description": "OpenAI APIResponse Function Web Search Action Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Function Web Search Action Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + ], + "description": "OpenAI APIResponse Function Web Search Action Union Param configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "OpenAI APIResponse Function Web Search Action Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseFunctionWebSearchParam": { + "additionalProperties": false, + "description": "The results of a web search tool call. See the\n[web search guide](https://platform.openai.com/docs/guides/tools-web-search) for\nmore information.\n\nThe properties ID, Action, Status, Type are required.\n", + "properties": { + "action": { + "$ref": "#/$defs/OpenaiAPIResponseFunctionWebSearchActionUnionParam", + "description": "An object describing the specific action taken in this web search call. Includes\ndetails on how the model used the web (search, open_page, find).\n", + "title": "Action", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "id": { + "description": "The unique ID of the web search tool call.\n", + "title": "Id", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "status": { + "description": "The status of the web search tool call.\n\nAny of \"in_progress\", \"searching\", \"completed\", \"failed\".\n", + "enum": [ + "in_progress", + "searching", + "completed", + "failed" + ], + "title": "Status", + "type": "string", + "x-clicky-order": 30, + "x-enum-display": "segmented", + "x-enum-labels": { + "completed": "Completed", + "failed": "Failed", + "in_progress": "In progress", + "searching": "Searching" + }, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "web_search_call", + "description": "The type of the web search tool call. Always `web_search_call`.\n\nThis field can be elided, and will marshal its zero value as \"web_search_call\".\n", + "title": "Type", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "id", + "action", + "status", + "type" + ], + "title": "OpenAI APIResponse Function Web Search Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseInputContentUnionParam": { + "anyOf": [ + { + "$ref": "#/$defs/OpenaiAPIResponseInputTextParam", + "description": "OpenAI APIResponse Input Content Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Input Content Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIResponseInputImageParam", + "description": "OpenAI APIResponse Input Content Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Input Content Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIResponseInputFileParam", + "description": "OpenAI APIResponse Input Content Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Input Content Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + ], + "description": "OpenAI APIResponse Input Content Union Param configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "OpenAI APIResponse Input Content Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseInputFileParam": { + "additionalProperties": false, + "description": "A file input to the model.\n\nThe property Type is required.\n", + "properties": { + "file_data": { + "description": "The content of the file to be sent to the model.\n", + "title": "File data", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "file_id": { + "description": "The ID of the file to be sent to the model.\n", + "title": "File id", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "file_url": { + "description": "The URL of the file to be sent to the model.\n", + "title": "File url", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "filename": { + "description": "The name of the file to be sent to the model.\n", + "title": "Filename", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "input_file", + "description": "The type of the input item. Always `input_file`.\n\nThis field can be elided, and will marshal its zero value as \"input_file\".\n", + "title": "Type", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type" + ], + "title": "OpenAI APIResponse Input File Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseInputImageParam": { + "additionalProperties": false, + "description": "An image input to the model. Learn about\n[image inputs](https://platform.openai.com/docs/guides/vision).\n\nThe properties Detail, Type are required.\n", + "properties": { + "detail": { + "description": "The detail level of the image to be sent to the model. One of `high`, `low`, or\n`auto`. Defaults to `auto`.\n\nAny of \"low\", \"high\", \"auto\".\n", + "enum": [ + "low", + "high", + "auto" + ], + "title": "Detail", + "type": "string", + "x-clicky-order": 10, + "x-enum-display": "segmented", + "x-enum-labels": { + "auto": "Auto", + "high": "High", + "low": "Low" + }, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "file_id": { + "description": "The ID of the file to be sent to the model.\n", + "title": "File id", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "image_url": { + "description": "The URL of the image to be sent to the model. A fully qualified URL or base64\nencoded image in a data URL.\n", + "title": "Image url", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "input_image", + "description": "The type of the input item. Always `input_image`.\n\nThis field can be elided, and will marshal its zero value as \"input_image\".\n", + "title": "Type", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "detail", + "type" + ], + "title": "OpenAI APIResponse Input Image Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseInputItemComputerCallOutputAcknowledgedSafetyCheckParam": { + "additionalProperties": false, + "description": "A pending safety check for the computer call.\n\nThe property ID is required.\n", + "properties": { + "code": { + "description": "The type of the pending safety check.\n", + "title": "Code", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "id": { + "description": "The ID of the pending safety check.\n", + "title": "Id", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "message": { + "description": "Details about the pending safety check.\n", + "title": "Message", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "id" + ], + "title": "OpenAI APIResponse Input Item Computer Call Output Acknowledged Safety Check Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseInputItemComputerCallOutputParam": { + "additionalProperties": false, + "description": "The output of a computer tool call.\n\nThe properties CallID, Output, Type are required.\n", + "properties": { + "acknowledged_safety_checks": { + "description": "The safety checks reported by the API that have been acknowledged by the\ndeveloper.\n", + "items": { + "$ref": "#/$defs/OpenaiAPIResponseInputItemComputerCallOutputAcknowledgedSafetyCheckParam", + "description": "Acknowledged safety checks value configuration. See the linked native reference for semantics and availability.", + "title": "Acknowledged safety checks value", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "title": "Acknowledged safety checks", + "type": "array", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "call_id": { + "description": "The ID of the computer tool call that produced the output.\n", + "title": "Call id", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "id": { + "description": "The ID of the computer tool call output.\n", + "title": "Id", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "output": { + "$ref": "#/$defs/OpenaiAPIResponseComputerToolCallOutputScreenshotParam", + "description": "A computer screenshot image used with the computer use tool.\n", + "title": "Output", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "status": { + "description": "The status of the message input. One of `in_progress`, `completed`, or\n`incomplete`. Populated when input items are returned via API.\n\nAny of \"in_progress\", \"completed\", \"incomplete\".\n", + "title": "Status", + "type": "string", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "computer_call_output", + "description": "The type of the computer tool call output. Always `computer_call_output`.\n\nThis field can be elided, and will marshal its zero value as\n\"computer_call_output\".\n", + "title": "Type", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "call_id", + "output", + "type" + ], + "title": "OpenAI APIResponse Input Item Computer Call Output Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseInputItemFunctionCallOutputParam": { + "additionalProperties": false, + "description": "The output of a function tool call.\n\nThe properties CallID, Output, Type are required.\n", + "properties": { + "call_id": { + "description": "The unique ID of the function tool call generated by the model.\n", + "title": "Call id", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "id": { + "description": "The unique ID of the function tool call output. Populated when this item is\nreturned via API.\n", + "title": "Id", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "output": { + "description": "A JSON string of the output of the function tool call.\n", + "title": "Output", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "status": { + "description": "The status of the item. One of `in_progress`, `completed`, or `incomplete`.\nPopulated when items are returned via API.\n\nAny of \"in_progress\", \"completed\", \"incomplete\".\n", + "title": "Status", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "function_call_output", + "description": "The type of the function tool call output. Always `function_call_output`.\n\nThis field can be elided, and will marshal its zero value as\n\"function_call_output\".\n", + "title": "Type", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "call_id", + "output", + "type" + ], + "title": "OpenAI APIResponse Input Item Function Call Output Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseInputItemImageGenerationCallParam": { + "additionalProperties": false, + "description": "An image generation request made by the model.\n\nThe properties ID, Result, Status, Type are required.\n", + "properties": { + "id": { + "description": "The unique ID of the image generation call.\n", + "title": "Id", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "result": { + "description": "The generated image encoded in base64.\n", + "title": "Result", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "status": { + "description": "The status of the image generation call.\n\nAny of \"in_progress\", \"completed\", \"generating\", \"failed\".\n", + "title": "Status", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "image_generation_call", + "description": "The type of the image generation call. Always `image_generation_call`.\n\nThis field can be elided, and will marshal its zero value as\n\"image_generation_call\".\n", + "title": "Type", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "result", + "id", + "status", + "type" + ], + "title": "OpenAI APIResponse Input Item Image Generation Call Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseInputItemItemReferenceParam": { + "additionalProperties": false, + "description": "An internal identifier for an item to reference.\n\nThe property ID is required.\n", + "properties": { + "id": { + "description": "The ID of the item to reference.\n", + "title": "Id", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "The type of item to reference. Always `item_reference`.\n\nAny of \"item_reference\".\n", + "title": "Type", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "id" + ], + "title": "OpenAI APIResponse Input Item Item Reference Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseInputItemLocalShellCallActionParam": { + "additionalProperties": false, + "description": "Execute a shell command on the server.\n\nThe properties Command, Env, Type are required.\n", + "properties": { + "command": { + "description": "The command to run.\n", + "items": { + "description": "Command value configuration. See the linked native reference for semantics and availability.", + "title": "Command value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "title": "Command", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "env": { + "additionalProperties": { + "description": "Env value configuration. See the linked native reference for semantics and availability.", + "title": "Env value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "description": "Environment variables to set for the command.\n", + "title": "Env", + "type": "object", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "timeout_ms": { + "description": "Optional timeout in milliseconds for the command.\n", + "title": "Timeout ms", + "type": "integer", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "exec", + "description": "The type of the local shell action. Always `exec`.\n\nThis field can be elided, and will marshal its zero value as \"exec\".\n", + "title": "Type", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "user": { + "description": "Optional user to run the command as.\n", + "title": "User", + "type": "string", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "working_directory": { + "description": "Optional working directory to run the command in.\n", + "title": "Working directory", + "type": "string", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "command", + "env", + "type" + ], + "title": "OpenAI APIResponse Input Item Local Shell Call Action Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseInputItemLocalShellCallOutputParam": { + "additionalProperties": false, + "description": "The output of a local shell tool call.\n\nThe properties ID, Output, Type are required.\n", + "properties": { + "id": { + "description": "The unique ID of the local shell tool call generated by the model.\n", + "title": "Id", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "output": { + "description": "A JSON string of the output of the local shell tool call.\n", + "title": "Output", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "status": { + "description": "The status of the item. One of `in_progress`, `completed`, or `incomplete`.\n\nAny of \"in_progress\", \"completed\", \"incomplete\".\n", + "title": "Status", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "local_shell_call_output", + "description": "The type of the local shell tool call output. Always `local_shell_call_output`.\n\nThis field can be elided, and will marshal its zero value as\n\"local_shell_call_output\".\n", + "title": "Type", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "id", + "output", + "type" + ], + "title": "OpenAI APIResponse Input Item Local Shell Call Output Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseInputItemLocalShellCallParam": { + "additionalProperties": false, + "description": "A tool call to run a command on the local shell.\n\nThe properties ID, Action, CallID, Status, Type are required.\n", + "properties": { + "action": { + "$ref": "#/$defs/OpenaiAPIResponseInputItemLocalShellCallActionParam", + "description": "Execute a shell command on the server.\n", + "title": "Action", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "call_id": { + "description": "The unique ID of the local shell tool call generated by the model.\n", + "title": "Call id", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "id": { + "description": "The unique ID of the local shell call.\n", + "title": "Id", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "status": { + "description": "The status of the local shell call.\n\nAny of \"in_progress\", \"completed\", \"incomplete\".\n", + "title": "Status", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "local_shell_call", + "description": "The type of the local shell call. Always `local_shell_call`.\n\nThis field can be elided, and will marshal its zero value as \"local_shell_call\".\n", + "title": "Type", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "id", + "action", + "call_id", + "status", + "type" + ], + "title": "OpenAI APIResponse Input Item Local Shell Call Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseInputItemMcpApprovalRequestParam": { + "additionalProperties": false, + "description": "A request for human approval of a tool invocation.\n\nThe properties ID, Arguments, Name, ServerLabel, Type are required.\n", + "properties": { + "arguments": { + "description": "A JSON string of arguments for the tool.\n", + "title": "Arguments", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "id": { + "description": "The unique ID of the approval request.\n", + "title": "Id", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "name": { + "description": "The name of the tool to run.\n", + "title": "Name", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "server_label": { + "description": "The label of the MCP server making the request.\n", + "title": "Server label", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "mcp_approval_request", + "description": "The type of the item. Always `mcp_approval_request`.\n\nThis field can be elided, and will marshal its zero value as\n\"mcp_approval_request\".\n", + "title": "Type", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "id", + "arguments", + "name", + "server_label", + "type" + ], + "title": "OpenAI APIResponse Input Item MCP Approval Request Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseInputItemMcpApprovalResponseParam": { + "additionalProperties": false, + "description": "A response to an MCP approval request.\n\nThe properties ApprovalRequestID, Approve, Type are required.\n", + "properties": { + "approval_request_id": { + "description": "The ID of the approval request being answered.\n", + "title": "Approval request id", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "approve": { + "description": "Whether the request was approved.\n", + "title": "Approve", + "type": "boolean", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "id": { + "description": "The unique ID of the approval response\n", + "title": "Id", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "reason": { + "description": "Optional reason for the decision.\n", + "title": "Reason", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "mcp_approval_response", + "description": "The type of the item. Always `mcp_approval_response`.\n\nThis field can be elided, and will marshal its zero value as\n\"mcp_approval_response\".\n", + "title": "Type", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "approval_request_id", + "approve", + "type" + ], + "title": "OpenAI APIResponse Input Item MCP Approval Response Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseInputItemMcpCallParam": { + "additionalProperties": false, + "description": "An invocation of a tool on an MCP server.\n\nThe properties ID, Arguments, Name, ServerLabel, Type are required.\n", + "properties": { + "arguments": { + "description": "A JSON string of the arguments passed to the tool.\n", + "title": "Arguments", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "error": { + "description": "The error from the tool call, if any.\n", + "title": "Error", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "id": { + "description": "The unique ID of the tool call.\n", + "title": "Id", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "name": { + "description": "The name of the tool that was run.\n", + "title": "Name", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "output": { + "description": "The output from the tool call.\n", + "title": "Output", + "type": "string", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "server_label": { + "description": "The label of the MCP server running the tool.\n", + "title": "Server label", + "type": "string", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "mcp_call", + "description": "The type of the item. Always `mcp_call`.\n\nThis field can be elided, and will marshal its zero value as \"mcp_call\".\n", + "title": "Type", + "x-clicky-order": 70, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "id", + "arguments", + "name", + "server_label", + "type" + ], + "title": "OpenAI APIResponse Input Item MCP Call Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseInputItemMcpListToolsParam": { + "additionalProperties": false, + "description": "A list of tools available on an MCP server.\n\nThe properties ID, ServerLabel, Tools, Type are required.\n", + "properties": { + "error": { + "description": "Error message if the server could not list tools.\n", + "title": "Error", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "id": { + "description": "The unique ID of the list.\n", + "title": "Id", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "server_label": { + "description": "The label of the MCP server.\n", + "title": "Server label", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "tools": { + "description": "The tools available on the server.\n", + "items": { + "$ref": "#/$defs/OpenaiAPIResponseInputItemMcpListToolsToolParam", + "description": "Tools value configuration. See the linked native reference for semantics and availability.", + "title": "Tools value", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "title": "Tools", + "type": "array", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "mcp_list_tools", + "description": "The type of the item. Always `mcp_list_tools`.\n\nThis field can be elided, and will marshal its zero value as \"mcp_list_tools\".\n", + "title": "Type", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "id", + "server_label", + "tools", + "type" + ], + "title": "OpenAI APIResponse Input Item MCP List Tools Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseInputItemMcpListToolsToolParam": { + "additionalProperties": false, + "description": "A tool available on an MCP server.\n\nThe properties InputSchema, Name are required.\n", + "properties": { + "annotations": { + "description": "Additional annotations about the tool.\n", + "format": "json", + "title": "Annotations", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "description": { + "description": "The description of the tool.\n", + "title": "Description", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "input_schema": { + "description": "The JSON schema describing the tool's input.\n", + "format": "json", + "title": "Input schema", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "name": { + "description": "The name of the tool.\n", + "title": "Name", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "input_schema", + "name" + ], + "title": "OpenAI APIResponse Input Item MCP List Tools Tool Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseInputItemMessageParam": { + "additionalProperties": false, + "description": "A message input to the model with a role indicating instruction following\nhierarchy. Instructions given with the `developer` or `system` role take\nprecedence over instructions given with the `user` role.\n\nThe properties Content, Role are required.\n", + "properties": { + "content": { + "description": "A list of one or many input items to the model, containing different content\ntypes.\n", + "items": { + "$ref": "#/$defs/OpenaiAPIResponseInputContentUnionParam", + "description": "Content value configuration. See the linked native reference for semantics and availability.", + "title": "Content value", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "title": "Content", + "type": "array", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "role": { + "description": "The role of the message input. One of `user`, `system`, or `developer`.\n\nAny of \"user\", \"system\", \"developer\".\n", + "title": "Role", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "status": { + "description": "The status of item. One of `in_progress`, `completed`, or `incomplete`.\nPopulated when items are returned via API.\n\nAny of \"in_progress\", \"completed\", \"incomplete\".\n", + "title": "Status", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "The type of the message input. Always set to `message`.\n\nAny of \"message\".\n", + "title": "Type", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "content", + "role" + ], + "title": "OpenAI APIResponse Input Item Message Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseInputItemUnionParam": { + "anyOf": [ + { + "$ref": "#/$defs/OpenaiAPIEasyInputMessageParam", + "description": "OpenAI APIResponse Input Item Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Input Item Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIResponseInputItemMessageParam", + "description": "OpenAI APIResponse Input Item Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Input Item Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIResponseOutputMessageParam", + "description": "OpenAI APIResponse Input Item Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Input Item Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIResponseFileSearchToolCallParam", + "description": "OpenAI APIResponse Input Item Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Input Item Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIResponseComputerToolCallParam", + "description": "OpenAI APIResponse Input Item Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Input Item Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIResponseInputItemComputerCallOutputParam", + "description": "OpenAI APIResponse Input Item Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Input Item Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIResponseFunctionWebSearchParam", + "description": "OpenAI APIResponse Input Item Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Input Item Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIResponseFunctionToolCallParam", + "description": "OpenAI APIResponse Input Item Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Input Item Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIResponseInputItemFunctionCallOutputParam", + "description": "OpenAI APIResponse Input Item Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Input Item Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIResponseReasoningItemParam", + "description": "OpenAI APIResponse Input Item Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Input Item Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIResponseInputItemImageGenerationCallParam", + "description": "OpenAI APIResponse Input Item Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Input Item Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIResponseCodeInterpreterToolCallParam", + "description": "OpenAI APIResponse Input Item Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Input Item Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIResponseInputItemLocalShellCallParam", + "description": "OpenAI APIResponse Input Item Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Input Item Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIResponseInputItemLocalShellCallOutputParam", + "description": "OpenAI APIResponse Input Item Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Input Item Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIResponseInputItemMcpListToolsParam", + "description": "OpenAI APIResponse Input Item Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Input Item Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIResponseInputItemMcpApprovalRequestParam", + "description": "OpenAI APIResponse Input Item Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Input Item Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIResponseInputItemMcpApprovalResponseParam", + "description": "OpenAI APIResponse Input Item Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Input Item Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIResponseInputItemMcpCallParam", + "description": "OpenAI APIResponse Input Item Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Input Item Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIResponseInputItemItemReferenceParam", + "description": "OpenAI APIResponse Input Item Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Input Item Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + ], + "description": "OpenAI APIResponse Input Item Union Param configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "OpenAI APIResponse Input Item Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseInputTextParam": { + "additionalProperties": false, + "description": "A text input to the model.\n\nThe properties Text, Type are required.\n", + "properties": { + "text": { + "description": "The text input to the model.\n", + "title": "Text", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "input_text", + "description": "The type of the input item. Always `input_text`.\n\nThis field can be elided, and will marshal its zero value as \"input_text\".\n", + "title": "Type", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "text", + "type" + ], + "title": "OpenAI APIResponse Input Text Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseNewParamsInputUnion": { + "anyOf": [ + { + "description": "OpenAI APIResponse New Params Input Union configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse New Params Input Union", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "description": "OpenAI APIResponse New Params Input Union configuration. See the linked native reference for semantics and availability.", + "items": { + "$ref": "#/$defs/OpenaiAPIResponseInputItemUnionParam", + "description": "OpenAI APIResponse New Params Input Union value configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse New Params Input Union value", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "title": "OpenAI APIResponse New Params Input Union", + "type": "array", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + ], + "description": "OpenAI APIResponse New Params Input Union configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "OpenAI APIResponse New Params Input Union", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseNewParamsToolChoiceUnion": { + "anyOf": [ + { + "description": "OpenAI APIResponse New Params Tool Choice Union configuration. See the linked native reference for semantics and availability.", + "enum": [ + "none", + "auto", + "required" + ], + "title": "OpenAI APIResponse New Params Tool Choice Union", + "type": "string", + "x-enum-display": "segmented", + "x-enum-labels": { + "auto": "Auto", + "none": "None", + "required": "Required" + }, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIToolChoiceTypesParam", + "description": "OpenAI APIResponse New Params Tool Choice Union configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse New Params Tool Choice Union", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIToolChoiceFunctionParam", + "description": "OpenAI APIResponse New Params Tool Choice Union configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse New Params Tool Choice Union", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIToolChoiceMcpParam", + "description": "OpenAI APIResponse New Params Tool Choice Union configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse New Params Tool Choice Union", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + ], + "description": "OpenAI APIResponse New Params Tool Choice Union configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "OpenAI APIResponse New Params Tool Choice Union", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseOutputMessageContentUnionParam": { + "anyOf": [ + { + "$ref": "#/$defs/OpenaiAPIResponseOutputTextParam", + "description": "OpenAI APIResponse Output Message Content Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Output Message Content Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIResponseOutputRefusalParam", + "description": "OpenAI APIResponse Output Message Content Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Output Message Content Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + ], + "description": "OpenAI APIResponse Output Message Content Union Param configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "OpenAI APIResponse Output Message Content Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseOutputMessageParam": { + "additionalProperties": false, + "description": "An output message from the model.\n\nThe properties ID, Content, Role, Status, Type are required.\n", + "properties": { + "content": { + "description": "The content of the output message.\n", + "items": { + "$ref": "#/$defs/OpenaiAPIResponseOutputMessageContentUnionParam", + "description": "Content value configuration. See the linked native reference for semantics and availability.", + "title": "Content value", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "title": "Content", + "type": "array", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "id": { + "description": "The unique ID of the output message.\n", + "title": "Id", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "role": { + "const": "assistant", + "description": "The role of the output message. Always `assistant`.\n\nThis field can be elided, and will marshal its zero value as \"assistant\".\n", + "title": "Role", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "status": { + "description": "The status of the message input. One of `in_progress`, `completed`, or\n`incomplete`. Populated when input items are returned via API.\n\nAny of \"in_progress\", \"completed\", \"incomplete\".\n", + "enum": [ + "in_progress", + "completed", + "incomplete" + ], + "title": "Status", + "type": "string", + "x-clicky-order": 40, + "x-enum-display": "segmented", + "x-enum-labels": { + "completed": "Completed", + "in_progress": "In progress", + "incomplete": "Incomplete" + }, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "message", + "description": "The type of the output message. Always `message`.\n\nThis field can be elided, and will marshal its zero value as \"message\".\n", + "title": "Type", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "id", + "content", + "status", + "role", + "type" + ], + "title": "OpenAI APIResponse Output Message Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseOutputRefusalParam": { + "additionalProperties": false, + "description": "A refusal from the model.\n\nThe properties Refusal, Type are required.\n", + "properties": { + "refusal": { + "description": "The refusal explanation from the model.\n", + "title": "Refusal", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "refusal", + "description": "The type of the refusal. Always `refusal`.\n\nThis field can be elided, and will marshal its zero value as \"refusal\".\n", + "title": "Type", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "refusal", + "type" + ], + "title": "OpenAI APIResponse Output Refusal Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseOutputTextAnnotationContainerFileCitationParam": { + "additionalProperties": false, + "description": "A citation for a container file used to generate a model response.\n\nThe properties ContainerID, EndIndex, FileID, Filename, StartIndex, Type are\nrequired.\n", + "properties": { + "container_id": { + "description": "The ID of the container file.\n", + "title": "Container id", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "end_index": { + "description": "The index of the last character of the container file citation in the message.\n", + "title": "End index", + "type": "integer", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "file_id": { + "description": "The ID of the file.\n", + "title": "File id", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "filename": { + "description": "The filename of the container file cited.\n", + "title": "Filename", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "start_index": { + "description": "The index of the first character of the container file citation in the message.\n", + "title": "Start index", + "type": "integer", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "container_file_citation", + "description": "The type of the container file citation. Always `container_file_citation`.\n\nThis field can be elided, and will marshal its zero value as\n\"container_file_citation\".\n", + "title": "Type", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "container_id", + "end_index", + "file_id", + "filename", + "start_index", + "type" + ], + "title": "OpenAI APIResponse Output Text Annotation Container File Citation Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseOutputTextAnnotationFileCitationParam": { + "additionalProperties": false, + "description": "A citation to a file.\n\nThe properties FileID, Filename, Index, Type are required.\n", + "properties": { + "file_id": { + "description": "The ID of the file.\n", + "title": "File id", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "filename": { + "description": "The filename of the file cited.\n", + "title": "Filename", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "index": { + "description": "The index of the file in the list of files.\n", + "title": "Index", + "type": "integer", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "file_citation", + "description": "The type of the file citation. Always `file_citation`.\n\nThis field can be elided, and will marshal its zero value as \"file_citation\".\n", + "title": "Type", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "file_id", + "filename", + "index", + "type" + ], + "title": "OpenAI APIResponse Output Text Annotation File Citation Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseOutputTextAnnotationFilePathParam": { + "additionalProperties": false, + "description": "A path to a file.\n\nThe properties FileID, Index, Type are required.\n", + "properties": { + "file_id": { + "description": "The ID of the file.\n", + "title": "File id", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "index": { + "description": "The index of the file in the list of files.\n", + "title": "Index", + "type": "integer", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "file_path", + "description": "The type of the file path. Always `file_path`.\n\nThis field can be elided, and will marshal its zero value as \"file_path\".\n", + "title": "Type", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "file_id", + "index", + "type" + ], + "title": "OpenAI APIResponse Output Text Annotation File Path Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseOutputTextAnnotationURLCitationParam": { + "additionalProperties": false, + "description": "A citation for a web resource used to generate a model response.\n\nThe properties EndIndex, StartIndex, Title, Type, URL are required.\n", + "properties": { + "end_index": { + "description": "The index of the last character of the URL citation in the message.\n", + "title": "End index", + "type": "integer", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "start_index": { + "description": "The index of the first character of the URL citation in the message.\n", + "title": "Start index", + "type": "integer", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "title": { + "description": "The title of the web resource.\n", + "title": "Title", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "url_citation", + "description": "The type of the URL citation. Always `url_citation`.\n\nThis field can be elided, and will marshal its zero value as \"url_citation\".\n", + "title": "Type", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "url": { + "description": "The URL of the web resource.\n", + "title": "Url", + "type": "string", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "end_index", + "start_index", + "title", + "url", + "type" + ], + "title": "OpenAI APIResponse Output Text Annotation URLCitation Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } }, + "OpenaiAPIResponseOutputTextAnnotationUnionParam": { + "anyOf": [ + { + "$ref": "#/$defs/OpenaiAPIResponseOutputTextAnnotationFileCitationParam", + "description": "OpenAI APIResponse Output Text Annotation Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Output Text Annotation Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIResponseOutputTextAnnotationURLCitationParam", + "description": "OpenAI APIResponse Output Text Annotation Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Output Text Annotation Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIResponseOutputTextAnnotationContainerFileCitationParam", + "description": "OpenAI APIResponse Output Text Annotation Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Output Text Annotation Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIResponseOutputTextAnnotationFilePathParam", + "description": "OpenAI APIResponse Output Text Annotation Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Output Text Annotation Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + ], + "description": "OpenAI APIResponse Output Text Annotation Union Param configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "OpenAI APIResponse Output Text Annotation Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseOutputTextLogprobParam": { + "additionalProperties": false, + "description": "The log probability of a token.\n\nThe properties Token, Bytes, Logprob, TopLogprobs are required.\n", + "properties": { + "bytes": { + "description": "Bytes configuration. See the linked native reference for semantics and availability.", + "items": { + "description": "Bytes value configuration. See the linked native reference for semantics and availability.", + "title": "Bytes value", + "type": "integer", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "title": "Bytes", + "type": "array", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "logprob": { + "description": "Logprob configuration. See the linked native reference for semantics and availability.", + "title": "Logprob", + "type": "number", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "token": { + "description": "Token configuration. See the linked native reference for semantics and availability.", + "title": "Token", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "top_logprobs": { + "description": "Top logprobs configuration. See the linked native reference for semantics and availability.", + "items": { + "$ref": "#/$defs/OpenaiAPIResponseOutputTextLogprobTopLogprobParam", + "description": "Top logprobs value configuration. See the linked native reference for semantics and availability.", + "title": "Top logprobs value", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "title": "Top logprobs", + "type": "array", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "token", + "bytes", + "logprob", + "top_logprobs" + ], + "title": "OpenAI APIResponse Output Text Logprob Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseOutputTextLogprobTopLogprobParam": { + "additionalProperties": false, + "description": "The top log probability of a token.\n\nThe properties Token, Bytes, Logprob are required.\n", + "properties": { + "bytes": { + "description": "Bytes configuration. See the linked native reference for semantics and availability.", + "items": { + "description": "Bytes value configuration. See the linked native reference for semantics and availability.", + "title": "Bytes value", + "type": "integer", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "title": "Bytes", + "type": "array", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "logprob": { + "description": "Logprob configuration. See the linked native reference for semantics and availability.", + "title": "Logprob", + "type": "number", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "token": { + "description": "Token configuration. See the linked native reference for semantics and availability.", + "title": "Token", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "token", + "bytes", + "logprob" + ], + "title": "OpenAI APIResponse Output Text Logprob Top Logprob Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseOutputTextParam": { + "additionalProperties": false, + "description": "A text output from the model.\n\nThe properties Annotations, Text, Type are required.\n", + "properties": { + "annotations": { + "description": "The annotations of the text output.\n", + "items": { + "$ref": "#/$defs/OpenaiAPIResponseOutputTextAnnotationUnionParam", + "description": "Annotations value configuration. See the linked native reference for semantics and availability.", + "title": "Annotations value", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "title": "Annotations", + "type": "array", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "logprobs": { + "description": "Logprobs configuration. See the linked native reference for semantics and availability.", + "items": { + "$ref": "#/$defs/OpenaiAPIResponseOutputTextLogprobParam", + "description": "Logprobs value configuration. See the linked native reference for semantics and availability.", + "title": "Logprobs value", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "title": "Logprobs", + "type": "array", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "text": { + "description": "The text output from the model.\n", + "title": "Text", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "output_text", + "description": "The type of the output text. Always `output_text`.\n\nThis field can be elided, and will marshal its zero value as \"output_text\".\n", + "title": "Type", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "annotations", + "text", + "type" + ], + "title": "OpenAI APIResponse Output Text Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponsePromptParam": { + "additionalProperties": false, + "description": "Reference to a prompt template and its variables.\n[Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).\n\nThe property ID is required.\n", + "properties": { + "id": { + "description": "The unique identifier of the prompt template to use.\n", + "title": "Id", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "variables": { + "additionalProperties": { + "$ref": "#/$defs/OpenaiAPIResponsePromptVariableUnionParam", + "description": "Variables value configuration. See the linked native reference for semantics and availability.", + "title": "Variables value", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "description": "Optional map of values to substitute in for variables in your prompt. The\nsubstitution values can either be strings, or other Response input types like\nimages or files.\n", + "title": "Variables", + "type": "object", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "version": { + "description": "Optional version of the prompt template.\n", + "title": "Version", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "id" + ], + "title": "OpenAI APIResponse Prompt Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponsePromptVariableUnionParam": { + "anyOf": [ + { + "description": "OpenAI APIResponse Prompt Variable Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Prompt Variable Union Param", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIResponseInputTextParam", + "description": "OpenAI APIResponse Prompt Variable Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Prompt Variable Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIResponseInputImageParam", + "description": "OpenAI APIResponse Prompt Variable Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Prompt Variable Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIResponseInputFileParam", + "description": "OpenAI APIResponse Prompt Variable Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APIResponse Prompt Variable Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + ], + "description": "OpenAI APIResponse Prompt Variable Union Param configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "OpenAI APIResponse Prompt Variable Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseReasoningItemParam": { + "additionalProperties": false, + "description": "A description of the chain of thought used by a reasoning model while generating\na response. Be sure to include these items in your `input` to the Responses API\nfor subsequent turns of a conversation if you are manually\n[managing context](https://platform.openai.com/docs/guides/conversation-state).\n\nThe properties ID, Summary, Type are required.\n", + "properties": { + "encrypted_content": { + "description": "The encrypted content of the reasoning item - populated when a response is\ngenerated with `reasoning.encrypted_content` in the `include` parameter.\n", + "title": "Encrypted content", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "id": { + "description": "The unique identifier of the reasoning content.\n", + "title": "Id", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "status": { + "description": "The status of the item. One of `in_progress`, `completed`, or `incomplete`.\nPopulated when items are returned via API.\n\nAny of \"in_progress\", \"completed\", \"incomplete\".\n", + "enum": [ + "in_progress", + "completed", + "incomplete" + ], + "title": "Status", + "type": "string", + "x-clicky-order": 30, + "x-enum-display": "segmented", + "x-enum-labels": { + "completed": "Completed", + "in_progress": "In progress", + "incomplete": "Incomplete" + }, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "summary": { + "description": "Reasoning text contents.\n", + "items": { + "$ref": "#/$defs/OpenaiAPIResponseReasoningItemSummaryParam", + "description": "Summary value configuration. See the linked native reference for semantics and availability.", + "title": "Summary value", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "title": "Summary", + "type": "array", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "reasoning", + "description": "The type of the object. Always `reasoning`.\n\nThis field can be elided, and will marshal its zero value as \"reasoning\".\n", + "title": "Type", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "id", + "summary", + "type" + ], + "title": "OpenAI APIResponse Reasoning Item Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseReasoningItemSummaryParam": { + "additionalProperties": false, + "description": "The properties Text, Type are required.\n", + "properties": { + "text": { + "description": "A short summary of the reasoning used by the model when generating the response.\n", + "title": "Text", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "summary_text", + "description": "The type of the object. Always `summary_text`.\n\nThis field can be elided, and will marshal its zero value as \"summary_text\".\n", + "title": "Type", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "text", + "type" + ], + "title": "OpenAI APIResponse Reasoning Item Summary Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIResponseTextConfigParam": { + "additionalProperties": false, + "description": "Configuration options for a text response from the model. Can be plain text or\nstructured JSON data. Learn more:\n\n- [Text inputs and outputs](https://platform.openai.com/docs/guides/text)\n- [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)\n", + "properties": { + "format": { + "$ref": "#/$defs/OpenaiAPIResponseFormatTextConfigUnionParam", + "description": "An object specifying the format that the model must output.\n\nConfiguring `{ \"type\": \"json_schema\" }` enables Structured Outputs, which\nensures the model will match your supplied JSON schema. Learn more in the\n[Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).\n\nThe default format is `{ \"type\": \"text\" }` with no additional options.\n\n**Not recommended for gpt-4o and newer models:**\n\nSetting to `{ \"type\": \"json_object\" }` enables the older JSON mode, which\nensures the message the model generates is valid JSON. Using `json_schema` is\npreferred for models that support it.\n", + "title": "Format", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "title": "OpenAI APIResponse Text Config Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIToolChoiceFunctionParam": { + "additionalProperties": false, + "description": "Use this option to force the model to call a specific function.\n\nThe properties Name, Type are required.\n", + "properties": { + "name": { + "description": "The name of the function to call.\n", + "title": "Name", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "function", + "description": "For function calling, the type is always `function`.\n\nThis field can be elided, and will marshal its zero value as \"function\".\n", + "title": "Type", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "name", + "type" + ], + "title": "OpenAI APITool Choice Function Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIToolChoiceMcpParam": { + "additionalProperties": false, + "description": "Use this option to force the model to call a specific tool on a remote MCP\nserver.\n\nThe properties ServerLabel, Type are required.\n", + "properties": { + "name": { + "description": "The name of the tool to call on the server.\n", + "title": "Name", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "server_label": { + "description": "The label of the MCP server to use.\n", + "title": "Server label", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "mcp", + "description": "For MCP tools, the type is always `mcp`.\n\nThis field can be elided, and will marshal its zero value as \"mcp\".\n", + "title": "Type", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "server_label", + "type" + ], + "title": "OpenAI APITool Choice MCP Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIToolChoiceTypesParam": { + "additionalProperties": false, + "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools).\n\nThe property Type is required.\n", + "properties": { + "type": { + "description": "The type of hosted tool the model should to use. Learn more about\n[built-in tools](https://platform.openai.com/docs/guides/tools).\n\nAllowed values are:\n\n- `file_search`\n- `web_search_preview`\n- `computer_use_preview`\n- `code_interpreter`\n- `image_generation`\n\nAny of \"file_search\", \"web_search_preview\", \"computer_use_preview\",\n\"web_search_preview_2025_03_11\", \"image_generation\", \"code_interpreter\".\n", + "enum": [ + "file_search", + "web_search_preview", + "computer_use_preview", + "web_search_preview_2025_03_11", + "image_generation", + "code_interpreter" + ], + "title": "Type", + "type": "string", + "x-clicky-order": 10, + "x-enum-display": "combobox", + "x-enum-labels": { + "code_interpreter": "Code interpreter", + "computer_use_preview": "Computer use preview", + "file_search": "File search", + "image_generation": "Image generation", + "web_search_preview": "Web search preview", + "web_search_preview_2025_03_11": "Web search preview 2025 03 11" + }, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type" + ], + "title": "OpenAI APITool Choice Types Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIToolCodeInterpreterContainerCodeInterpreterContainerAutoParam": { + "additionalProperties": false, + "description": "Configuration for a code interpreter container. Optionally specify the IDs of\nthe files to run the code on.\n\nThe property Type is required.\n", + "properties": { + "file_ids": { + "description": "An optional list of uploaded files to make available to your code.\n", + "items": { + "description": "File ids value configuration. See the linked native reference for semantics and availability.", + "title": "File ids value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "title": "File ids", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "auto", + "description": "Always `auto`.\n\nThis field can be elided, and will marshal its zero value as \"auto\".\n", + "title": "Type", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type" + ], + "title": "OpenAI APITool Code Interpreter Container Code Interpreter Container Auto Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIToolCodeInterpreterContainerUnionParam": { + "anyOf": [ + { + "description": "OpenAI APITool Code Interpreter Container Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APITool Code Interpreter Container Union Param", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIToolCodeInterpreterContainerCodeInterpreterContainerAutoParam", + "description": "OpenAI APITool Code Interpreter Container Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APITool Code Interpreter Container Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + ], + "description": "OpenAI APITool Code Interpreter Container Union Param configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "OpenAI APITool Code Interpreter Container Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIToolCodeInterpreterParam": { + "additionalProperties": false, + "description": "A tool that runs Python code to help generate a response to a prompt.\n\nThe properties Container, Type are required.\n", + "properties": { + "container": { + "$ref": "#/$defs/OpenaiAPIToolCodeInterpreterContainerUnionParam", + "description": "The code interpreter container. Can be a container ID or an object that\nspecifies uploaded file IDs to make available to your code.\n", + "title": "Container", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "code_interpreter", + "description": "The type of the code interpreter tool. Always `code_interpreter`.\n\nThis field can be elided, and will marshal its zero value as \"code_interpreter\".\n", + "title": "Type", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "container", + "type" + ], + "title": "OpenAI APITool Code Interpreter Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIToolImageGenerationInputImageMaskParam": { + "additionalProperties": false, + "description": "Optional mask for inpainting. Contains `image_url` (string, optional) and\n`file_id` (string, optional).\n", + "properties": { + "file_id": { + "description": "File ID for the mask image.\n", + "title": "File id", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "image_url": { + "description": "Base64-encoded mask image.\n", + "title": "Image url", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "title": "OpenAI APITool Image Generation Input Image Mask Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIToolImageGenerationParam": { + "additionalProperties": false, + "description": "A tool that generates images using a model like `gpt-image-1`.\n\nThe property Type is required.\n", + "properties": { + "background": { + "description": "Background type for the generated image. One of `transparent`, `opaque`, or\n`auto`. Default: `auto`.\n\nAny of \"transparent\", \"opaque\", \"auto\".\n", + "title": "Background", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "input_fidelity": { + "description": "Control how much effort the model will exert to match the style and features,\nespecially facial features, of input images. This parameter is only supported\nfor `gpt-image-1`. Supports `high` and `low`. Defaults to `low`.\n\nAny of \"high\", \"low\".\n", + "title": "Input fidelity", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "input_image_mask": { + "$ref": "#/$defs/OpenaiAPIToolImageGenerationInputImageMaskParam", + "description": "Optional mask for inpainting. Contains `image_url` (string, optional) and\n`file_id` (string, optional).\n", + "title": "Input image mask", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "model": { + "description": "The image generation model to use. Default: `gpt-image-1`.\n\nAny of \"gpt-image-1\".\n", + "title": "Model", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "moderation": { + "description": "Moderation level for the generated image. Default: `auto`.\n\nAny of \"auto\", \"low\".\n", + "title": "Moderation", + "type": "string", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "output_compression": { + "description": "Compression level for the output image. Default: 100.\n", + "title": "Output compression", + "type": "integer", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "output_format": { + "description": "The output format of the generated image. One of `png`, `webp`, or `jpeg`.\nDefault: `png`.\n\nAny of \"png\", \"webp\", \"jpeg\".\n", + "title": "Output format", + "type": "string", + "x-clicky-order": 70, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "partial_images": { + "description": "Number of partial images to generate in streaming mode, from 0 (default value)\nto 3.\n", + "title": "Partial images", + "type": "integer", + "x-clicky-order": 80, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "quality": { + "description": "The quality of the generated image. One of `low`, `medium`, `high`, or `auto`.\nDefault: `auto`.\n\nAny of \"low\", \"medium\", \"high\", \"auto\".\n", + "title": "Quality", + "type": "string", + "x-clicky-order": 90, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "size": { + "description": "The size of the generated image. One of `1024x1024`, `1024x1536`, `1536x1024`,\nor `auto`. Default: `auto`.\n\nAny of \"1024x1024\", \"1024x1536\", \"1536x1024\", \"auto\".\n", + "title": "Size", + "type": "string", + "x-clicky-order": 100, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "image_generation", + "description": "The type of the image generation tool. Always `image_generation`.\n\nThis field can be elided, and will marshal its zero value as \"image_generation\".\n", + "title": "Type", + "x-clicky-order": 110, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type" + ], + "title": "OpenAI APITool Image Generation Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIToolLocalShellParam": { + "additionalProperties": false, + "description": "A tool that allows the model to execute shell commands in a local environment.\n\nThis struct has a constant value, construct it with [NewToolLocalShellParam].\n", + "properties": { + "type": { + "const": "local_shell", + "description": "The type of the local shell tool. Always `local_shell`.\n", + "title": "Type", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type" + ], + "title": "OpenAI APITool Local Shell Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIToolMcpAllowedToolsMcpAllowedToolsFilterParam": { + "additionalProperties": false, + "description": "A filter object to specify which tools are allowed.\n", + "properties": { + "tool_names": { + "description": "List of allowed tool names.\n", + "items": { + "description": "Tool names value configuration. See the linked native reference for semantics and availability.", + "title": "Tool names value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "title": "Tool names", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "title": "OpenAI APITool MCP Allowed Tools MCP Allowed Tools Filter Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIToolMcpAllowedToolsUnionParam": { + "anyOf": [ + { + "description": "OpenAI APITool MCP Allowed Tools Union Param configuration. See the linked native reference for semantics and availability.", + "items": { + "description": "OpenAI APITool MCP Allowed Tools Union Param value configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APITool MCP Allowed Tools Union Param value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "title": "OpenAI APITool MCP Allowed Tools Union Param", + "type": "array", + "x-array-display": "list", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIToolMcpAllowedToolsMcpAllowedToolsFilterParam", + "description": "OpenAI APITool MCP Allowed Tools Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APITool MCP Allowed Tools Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + ], + "description": "OpenAI APITool MCP Allowed Tools Union Param configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "OpenAI APITool MCP Allowed Tools Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIToolMcpParam": { + "additionalProperties": false, + "description": "Give the model access to additional tools via remote Model Context Protocol\n(MCP) servers.\n[Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp).\n\nThe properties ServerLabel, ServerURL, Type are required.\n", + "properties": { + "allowed_tools": { + "$ref": "#/$defs/OpenaiAPIToolMcpAllowedToolsUnionParam", + "description": "List of allowed tool names or a filter object.\n", + "title": "Allowed tools", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "headers": { + "additionalProperties": { + "description": "Headers value configuration. See the linked native reference for semantics and availability.", + "title": "Headers value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "description": "Optional HTTP headers to send to the MCP server. Use for authentication or other\npurposes.\n", + "title": "Headers", + "type": "object", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "require_approval": { + "$ref": "#/$defs/OpenaiAPIToolMcpRequireApprovalUnionParam", + "description": "Specify which of the MCP server's tools require approval.\n", + "title": "Require approval", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "server_description": { + "description": "Optional description of the MCP server, used to provide more context.\n", + "title": "Server description", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "server_label": { + "description": "A label for this MCP server, used to identify it in tool calls.\n", + "title": "Server label", + "type": "string", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "server_url": { + "description": "The URL for the MCP server.\n", + "title": "Server url", + "type": "string", + "x-clicky-order": 60, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "mcp", + "description": "The type of the MCP tool. Always `mcp`.\n\nThis field can be elided, and will marshal its zero value as \"mcp\".\n", + "title": "Type", + "x-clicky-order": 70, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "server_label", + "server_url", + "type" + ], + "title": "OpenAI APITool MCP Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIToolMcpRequireApprovalMcpToolApprovalFilterAlwaysParam": { + "additionalProperties": false, + "description": "A list of tools that always require approval.\n", + "properties": { + "tool_names": { + "description": "List of tools that require approval.\n", + "items": { + "description": "Tool names value configuration. See the linked native reference for semantics and availability.", + "title": "Tool names value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "title": "Tool names", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "title": "OpenAI APITool MCP Require Approval MCP Tool Approval Filter Always Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIToolMcpRequireApprovalMcpToolApprovalFilterNeverParam": { + "additionalProperties": false, + "description": "A list of tools that never require approval.\n", + "properties": { + "tool_names": { + "description": "List of tools that do not require approval.\n", + "items": { + "description": "Tool names value configuration. See the linked native reference for semantics and availability.", + "title": "Tool names value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "title": "Tool names", + "type": "array", + "x-array-display": "list", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "title": "OpenAI APITool MCP Require Approval MCP Tool Approval Filter Never Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIToolMcpRequireApprovalMcpToolApprovalFilterParam": { + "additionalProperties": false, + "description": "OpenAI APITool MCP Require Approval MCP Tool Approval Filter Param configuration. See the linked native reference for semantics and availability.", + "properties": { + "always": { + "$ref": "#/$defs/OpenaiAPIToolMcpRequireApprovalMcpToolApprovalFilterAlwaysParam", + "description": "A list of tools that always require approval.\n", + "title": "Always", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "never": { + "$ref": "#/$defs/OpenaiAPIToolMcpRequireApprovalMcpToolApprovalFilterNeverParam", + "description": "A list of tools that never require approval.\n", + "title": "Never", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "title": "OpenAI APITool MCP Require Approval MCP Tool Approval Filter Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIToolMcpRequireApprovalUnionParam": { + "anyOf": [ + { + "$ref": "#/$defs/OpenaiAPIToolMcpRequireApprovalMcpToolApprovalFilterParam", + "description": "OpenAI APITool MCP Require Approval Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APITool MCP Require Approval Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "description": "OpenAI APITool MCP Require Approval Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APITool MCP Require Approval Union Param", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + ], + "description": "OpenAI APITool MCP Require Approval Union Param configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "OpenAI APITool MCP Require Approval Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIToolUnionParam": { + "anyOf": [ + { + "$ref": "#/$defs/OpenaiAPIFunctionToolParam", + "description": "OpenAI APITool Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APITool Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIFileSearchToolParam", + "description": "OpenAI APITool Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APITool Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIWebSearchToolParam", + "description": "OpenAI APITool Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APITool Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIComputerToolParam", + "description": "OpenAI APITool Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APITool Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIToolMcpParam", + "description": "OpenAI APITool Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APITool Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIToolCodeInterpreterParam", + "description": "OpenAI APITool Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APITool Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIToolImageGenerationParam", + "description": "OpenAI APITool Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APITool Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + { + "$ref": "#/$defs/OpenaiAPIToolLocalShellParam", + "description": "OpenAI APITool Union Param configuration. See the linked native reference for semantics and availability.", + "title": "OpenAI APITool Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + ], + "description": "OpenAI APITool Union Param configuration. See the linked native reference for semantics and availability.", + "goJSONSchema": { + "imports": [ + "encoding/json" + ], + "type": "json.RawMessage" + }, + "title": "OpenAI APITool Union Param", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIWebSearchToolParam": { + "additionalProperties": false, + "description": "This tool searches the web for relevant results to use in a response. Learn more\nabout the\n[web search tool](https://platform.openai.com/docs/guides/tools-web-search).\n\nThe property Type is required.\n", + "properties": { + "search_context_size": { + "description": "High level guidance for the amount of context window space to use for the\nsearch. One of `low`, `medium`, or `high`. `medium` is the default.\n\nAny of \"low\", \"medium\", \"high\".\n", + "enum": [ + "low", + "medium", + "high" + ], + "title": "Search context size", + "type": "string", + "x-clicky-order": 10, + "x-enum-display": "segmented", + "x-enum-labels": { + "high": "High", + "low": "Low", + "medium": "Medium" + }, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "description": "The type of the web search tool. One of `web_search_preview` or\n`web_search_preview_2025_03_11`.\n\nAny of \"web_search_preview\", \"web_search_preview_2025_03_11\".\n", + "enum": [ + "web_search_preview", + "web_search_preview_2025_03_11" + ], + "title": "Type", + "type": "string", + "x-clicky-order": 20, + "x-enum-display": "segmented", + "x-enum-labels": { + "web_search_preview": "Web search preview", + "web_search_preview_2025_03_11": "Web search preview 2025 03 11" + }, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "user_location": { + "$ref": "#/$defs/OpenaiAPIWebSearchToolUserLocationParam", + "description": "The user's location.\n", + "title": "User location", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type" + ], + "title": "OpenAI APIWeb Search Tool Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "OpenaiAPIWebSearchToolUserLocationParam": { + "additionalProperties": false, + "description": "The user's location.\n\nThe property Type is required.\n", + "properties": { + "city": { + "description": "Free text input for the city of the user, e.g. `San Francisco`.\n", + "title": "City", + "type": "string", + "x-clicky-order": 10, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "country": { + "description": "The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of\nthe user, e.g. `US`.\n", + "title": "Country", + "type": "string", + "x-clicky-order": 20, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "region": { + "description": "Free text input for the region of the user, e.g. `California`.\n", + "title": "Region", + "type": "string", + "x-clicky-order": 30, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "timezone": { + "description": "The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the\nuser, e.g. `America/Los_Angeles`.\n", + "title": "Timezone", + "type": "string", + "x-clicky-order": 40, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "type": { + "const": "approximate", + "description": "The type of location approximation. Always `approximate`.\n\nThis field can be elided, and will marshal its zero value as \"approximate\".\n", + "title": "Type", + "x-clicky-order": 50, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "required": [ + "type" + ], + "title": "OpenAI APIWeb Search Tool User Location Param", + "type": "object", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + } + }, + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "description": "Native OpenAI Responses API request options used by Captain's API runtime.", + "properties": { "background": { - "title": "Background", "description": "Whether OpenAI runs the response asynchronously in the background.", - "type": "boolean", "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 120, - "x-captain-option": {"nativeName": "background", "support": "unsupported", "note": "Captain expects one foreground streaming response."} + "description": "Whether OpenAI runs the response asynchronously in the background.", + "readOnly": true, + "title": "Background", + "type": "boolean", + "x-captain-option": { + "nativeName": "background", + "note": "Captain expects one foreground streaming response.", + "support": "unsupported" + }, + "x-clicky-order": 120, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "include": { + "description": "Additional response fields requested from the Responses API.", + "items": { + "description": "Include value configuration. See the linked native reference for semantics and availability.", + "enum": [ + "code_interpreter_call.outputs", + "computer_call_output.output.image_url", + "file_search_call.results", + "message.input_image.image_url", + "message.output_text.logprobs", + "reasoning.encrypted_content" + ], + "title": "Include value", + "type": "string", + "x-enum-display": "combobox", + "x-enum-labels": { + "code_interpreter_call.outputs": "Code interpreter call.outputs", + "computer_call_output.output.image_url": "Computer call output.output.image url", + "file_search_call.results": "File search call.results", + "message.input_image.image_url": "Message.input image.image url", + "message.output_text.logprobs": "Message.output text.logprobs", + "reasoning.encrypted_content": "Reasoning.encrypted content" + }, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "readOnly": true, + "title": "Included output data", + "type": "array", + "x-captain-option": { + "nativeName": "include", + "note": "Captain always requests reasoning.encrypted_content for stateless tool loops.", + "support": "managed" + }, + "x-clicky-order": 90, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "input": { + "$ref": "#/$defs/OpenaiAPIResponseNewParamsInputUnion", + "description": "Text, image, file, conversation, and function-result items sent to the model.", + "title": "Input", + "x-array-display": "stacked", + "x-captain-option": { + "nativeName": "input", + "specPath": [ + "messages", + "prompt.user", + "prompt.attachments", + "toolApproval" + ], + "support": "mapped" + }, + "x-clicky-order": 20, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "instructions": { + "description": "System or developer instructions inserted into the model context.", + "title": "Instructions", + "type": "string", + "x-captain-option": { + "nativeName": "instructions", + "specPath": "prompt.system", + "support": "mapped" + }, + "x-clicky-order": 30, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "max_output_tokens": { + "description": "Upper bound covering visible output and reasoning tokens.", + "minimum": 1, + "title": "Maximum output tokens", + "type": "integer", + "x-captain-option": { + "nativeName": "max_output_tokens", + "specPath": "budget.maxTokens", + "support": "mapped" + }, + "x-clicky-order": 40, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + }, + "x-icon": "hash" }, "max_tool_calls": { - "title": "Maximum tool calls", "description": "Maximum total built-in tool calls processed in the response.", - "type": "integer", "minimum": 0, "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 130, - "x-captain-option": {"nativeName": "max_tool_calls", "support": "unsupported", "note": "Captain bounds its local tool loop rather than setting this native limit."} + "description": "Maximum total built-in tool calls processed in the response.", + "minimum": 0, + "readOnly": true, + "title": "Maximum tool calls", + "type": "integer", + "x-captain-option": { + "nativeName": "max_tool_calls", + "note": "Captain bounds its local tool loop rather than setting this native limit.", + "support": "unsupported" + }, + "x-clicky-order": 130, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "metadata": { + "additionalProperties": { + "description": "Metadata value configuration. See the linked native reference for semantics and availability.", + "title": "Metadata value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "description": "Up to sixteen string key-value pairs attached to the response.", + "readOnly": true, + "title": "Metadata", + "type": "object", + "x-captain-option": { + "nativeName": "metadata", + "note": "Captain does not forward per-request OpenAI metadata.", + "support": "unsupported" + }, + "x-clicky-order": 210, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "model": { + "description": "OpenAI model identifier used to generate the response.", + "minLength": 1, + "title": "Model", + "type": "string", + "x-captain-option": { + "nativeName": "model", + "specPath": "model.name", + "support": "mapped" + }, + "x-clicky-order": 10, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + }, + "x-icon": "sparkles" }, "parallel_tool_calls": { - "title": "Parallel tool calls", "description": "Whether the model may issue tool calls in parallel.", - "type": "boolean", "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 140, - "x-captain-option": {"nativeName": "parallel_tool_calls", "support": "unsupported", "note": "Captain does not expose this native option."} + "description": "Whether the model may issue tool calls in parallel.", + "readOnly": true, + "title": "Parallel tool calls", + "type": "boolean", + "x-captain-option": { + "nativeName": "parallel_tool_calls", + "note": "Captain does not expose this native option.", + "support": "unsupported" + }, + "x-clicky-order": 140, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } }, "previous_response_id": { - "title": "Previous response ID", "description": "Remote response identifier used for OpenAI-managed conversation state.", - "type": "string", "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 150, - "x-captain-option": {"nativeName": "previous_response_id", "support": "unsupported", "note": "Captain replays canonical messages instead of referencing stored responses."} - }, - "top_logprobs": { - "title": "Top log probabilities", "description": "Number of likely tokens returned with log probabilities at each position.", - "type": "integer", "minimum": 0, "maximum": 20, "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 160, - "x-captain-option": {"nativeName": "top_logprobs", "support": "unsupported", "note": "Captain does not request token log probabilities."} + "description": "Remote response identifier used for OpenAI-managed conversation state.", + "readOnly": true, + "title": "Previous response ID", + "type": "string", + "x-captain-option": { + "nativeName": "previous_response_id", + "note": "Captain replays canonical messages instead of referencing stored responses.", + "support": "unsupported" + }, + "x-clicky-order": 150, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } }, - "top_p": { - "title": "Top P", "description": "Cumulative probability mass retained during nucleus sampling.", - "type": "number", "minimum": 0, "maximum": 1, "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 170, - "x-captain-option": {"nativeName": "top_p", "support": "unsupported", "note": "Captain has no native top-p Spec field."} + "prompt": { + "$ref": "#/$defs/OpenaiAPIResponsePromptParam", + "description": "Reusable OpenAI prompt template reference and variables.", + "readOnly": true, + "title": "Prompt template", + "x-captain-option": { + "nativeName": "prompt", + "note": "Captain renders its own prompt and does not select remote prompt templates.", + "support": "unsupported" + }, + "x-clicky-order": 220, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } }, "prompt_cache_key": { - "title": "Prompt cache key", "description": "Stable key used by OpenAI to improve prompt-cache routing.", - "type": "string", "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 180, - "x-captain-option": {"nativeName": "prompt_cache_key", "support": "unsupported", "note": "Captain does not send a prompt cache routing key."} + "description": "Stable key used by OpenAI to improve prompt-cache routing.", + "readOnly": true, + "title": "Prompt cache key", + "type": "string", + "x-captain-option": { + "nativeName": "prompt_cache_key", + "note": "Captain does not send a prompt cache routing key.", + "support": "unsupported" + }, + "x-clicky-order": 180, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "reasoning": { + "$ref": "#/$defs/OpenaiAPIReasoningParam", + "description": "Reasoning effort and summary configuration for reasoning models.", + "title": "Reasoning", + "x-captain-option": { + "nativeName": "reasoning", + "specPath": "model.effort", + "support": "mapped" + }, + "x-clicky-order": 60, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } }, "safety_identifier": { - "title": "Safety identifier", "description": "Stable hashed identifier used for abuse detection.", - "type": "string", "readOnly": true, "x-clicky-section": "environment", "x-clicky-order": 190, - "x-captain-option": {"nativeName": "safety_identifier", "support": "unsupported", "note": "Captain does not send per-user safety identifiers."} + "description": "Stable hashed identifier used for abuse detection.", + "readOnly": true, + "title": "Safety identifier", + "type": "string", + "x-captain-option": { + "nativeName": "safety_identifier", + "note": "Captain does not send per-user safety identifiers.", + "support": "unsupported" + }, + "x-clicky-order": 190, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } }, - "user": { - "title": "Legacy user identifier", "description": "Deprecated end-user identifier replaced by safety_identifier and prompt_cache_key.", - "type": "string", "readOnly": true, "x-clicky-section": "environment", "x-clicky-order": 200, - "x-captain-option": {"nativeName": "user", "support": "unsupported", "note": "Captain does not send the deprecated user field."} + "service_tier": { + "description": "Processing tier used to serve the response.", + "enum": [ + "auto", + "default", + "flex", + "scale", + "priority" + ], + "readOnly": true, + "title": "Service tier", + "type": "string", + "x-captain-option": { + "nativeName": "service_tier", + "note": "Captain does not select an OpenAI service tier.", + "support": "unsupported" + }, + "x-clicky-order": 230, + "x-clicky-section": "model", + "x-enum-display": "combobox", + "x-enum-labels": { + "auto": "Auto", + "default": "Default", + "flex": "Flex", + "priority": "Priority", + "scale": "Scale" + }, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } }, - "metadata": { - "title": "Metadata", "description": "Up to sixteen string key-value pairs attached to the response.", - "type": "object", "additionalProperties": {"type": "string"}, "readOnly": true, "x-clicky-section": "environment", "x-clicky-order": 210, - "x-captain-option": {"nativeName": "metadata", "support": "unsupported", "note": "Captain does not forward per-request OpenAI metadata."} + "store": { + "const": false, + "description": "Whether OpenAI stores the generated response for later retrieval.", + "readOnly": true, + "title": "Store response", + "type": "boolean", + "x-captain-option": { + "nativeName": "store", + "note": "Captain always disables remote response storage and replays its own history.", + "support": "managed" + }, + "x-clicky-order": 100, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } }, - "prompt": { - "title": "Prompt template", "description": "Reusable OpenAI prompt template reference and variables.", - "type": "object", "additionalProperties": true, "readOnly": true, "x-clicky-section": "prompt", "x-clicky-order": 220, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "prompt", "support": "unsupported", "note": "Captain renders its own prompt and does not select remote prompt templates."} + "stream": { + "const": true, + "description": "Whether the response is returned as server-sent streaming events.", + "readOnly": true, + "title": "Stream", + "type": "boolean", + "x-captain-option": { + "nativeName": "stream", + "note": "Captain uses Responses.NewStreaming for its streaming provider.", + "support": "managed" + }, + "x-clicky-order": 110, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } }, - "service_tier": { - "title": "Service tier", "description": "Processing tier used to serve the response.", - "type": "string", "enum": ["auto", "default", "flex", "scale", "priority"], "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 230, "x-enum-display": "combobox", - "x-captain-option": {"nativeName": "service_tier", "support": "unsupported", "note": "Captain does not select an OpenAI service tier."} + "temperature": { + "description": "Sampling temperature between zero and two.", + "maximum": 2, + "minimum": 0, + "title": "Temperature", + "type": "number", + "x-captain-option": { + "nativeName": "temperature", + "specPath": "model.temperature", + "support": "mapped" + }, + "x-clicky-order": 50, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } }, - "truncation": { - "title": "Truncation", "description": "Strategy applied when conversation input exceeds the model context window.", - "type": "string", "enum": ["auto", "disabled"], "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 240, "x-enum-display": "segmented", - "x-captain-option": {"nativeName": "truncation", "support": "unsupported", "note": "Captain does not opt into OpenAI input truncation."} + "text": { + "$ref": "#/$defs/OpenaiAPIResponseTextConfigParam", + "description": "Plain-text or JSON Schema output configuration.", + "title": "Text output", + "x-captain-option": { + "nativeName": "text", + "specPath": [ + "prompt.schema", + "prompt.schemaJson" + ], + "support": "mapped" + }, + "x-clicky-order": 70, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } }, "tool_choice": { - "title": "Tool choice", "description": "Policy selecting whether and which tool the model should call.", - "oneOf": [{"type": "string"}, {"type": "object", "additionalProperties": true}], "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 250, - "goJSONSchema": {"type": "json.RawMessage", "imports": ["encoding/json"]}, - "x-captain-option": {"nativeName": "tool_choice", "support": "unsupported", "note": "Captain supplies function tools but does not set Responses tool_choice."} + "$ref": "#/$defs/OpenaiAPIResponseNewParamsToolChoiceUnion", + "description": "Policy selecting whether and which tool the model should call.", + "readOnly": true, + "title": "Tool choice", + "x-captain-option": { + "nativeName": "tool_choice", + "note": "Captain supplies function tools but does not set Responses tool_choice.", + "support": "unsupported" + }, + "x-clicky-order": 250, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "tools": { + "description": "Native Responses API tool definitions derived from Captain caller tools.", + "items": { + "$ref": "#/$defs/OpenaiAPIToolUnionParam", + "description": "Tools value configuration. See the linked native reference for semantics and availability.", + "title": "Tools value", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "readOnly": true, + "title": "Tools", + "type": "array", + "x-array-display": "stacked", + "x-captain-option": { + "nativeName": "tools", + "note": "Captain derives function tools from runtime Config.Tools and the Spec tool policy.", + "support": "managed" + }, + "x-clicky-order": 80, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "top_logprobs": { + "description": "Number of likely tokens returned with log probabilities at each position.", + "maximum": 20, + "minimum": 0, + "readOnly": true, + "title": "Top log probabilities", + "type": "integer", + "x-captain-option": { + "nativeName": "top_logprobs", + "note": "Captain does not request token log probabilities.", + "support": "unsupported" + }, + "x-clicky-order": 160, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "top_p": { + "description": "Cumulative probability mass retained during nucleus sampling.", + "maximum": 1, + "minimum": 0, + "readOnly": true, + "title": "Top P", + "type": "number", + "x-captain-option": { + "nativeName": "top_p", + "note": "Captain has no native top-p Spec field.", + "support": "unsupported" + }, + "x-clicky-order": 170, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "truncation": { + "description": "Strategy applied when conversation input exceeds the model context window.", + "enum": [ + "auto", + "disabled" + ], + "readOnly": true, + "title": "Truncation", + "type": "string", + "x-captain-option": { + "nativeName": "truncation", + "note": "Captain does not opt into OpenAI input truncation.", + "support": "unsupported" + }, + "x-clicky-order": 240, + "x-clicky-section": "model", + "x-enum-display": "segmented", + "x-enum-icons": { + "auto": "sparkles", + "disabled": "prohibit" + }, + "x-enum-labels": { + "auto": "Auto", + "disabled": "Disabled" + }, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } + }, + "user": { + "description": "Deprecated end-user identifier replaced by safety_identifier and prompt_cache_key.", + "readOnly": true, + "title": "Legacy user identifier", + "type": "string", + "x-captain-option": { + "nativeName": "user", + "note": "Captain does not send the deprecated user field.", + "support": "unsupported" + }, + "x-clicky-order": 200, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] + } } + }, + "required": [ + "model", + "input" + ], + "title": "OpenAI API options", + "type": "object", + "x-captain-adapter": { + "mode": "api", + "provider": "openai", + "sources": [ + { + "kind": "sdk", + "reference": "github.com/openai/openai-go/responses.ResponseNewParams", + "version": "v1.12.0" + }, + { + "kind": "official-docs", + "reference": "https://developers.openai.com/api/reference/resources/responses/methods/create", + "version": "retrieved 2026-09-11" + }, + { + "kind": "implementation", + "reference": "pkg/ai/provider/openai/input.go", + "version": "6a2b56cbd26702b18905865f21fc66d44cc864cc" + } + ] + }, + "x-captain-inventory": { + "sourceType": "responses.ResponseNewParams", + "version": "github.com/openai/openai-go v1.12.0" + }, + "x-help": { + "links": [ + { + "href": "https://platform.openai.com/docs/api-reference/responses/create", + "label": "Documentation" + } + ] } } diff --git a/pkg/adapters/openai/cli.schema.json b/pkg/adapters/openai/cli.schema.json index 78e7dc87..71258b10 100644 --- a/pkg/adapters/openai/cli.schema.json +++ b/pkg/adapters/openai/cli.schema.json @@ -1,177 +1,878 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "OpenAICLIOptions", - "description": "Native Codex exec CLI arguments used by Captain's OpenAI CLI runtime.", - "type": "object", "additionalProperties": false, - "x-captain-adapter": { - "provider": "openai", - "mode": "cli", - "sources": [ - {"kind": "cli-help", "reference": "codex exec --help and codex exec resume --help", "version": "codex-cli 0.154.0"}, - {"kind": "implementation", "reference": "pkg/ai/provider/codex_cli.go", "version": "6a2b56cbd26702b18905865f21fc66d44cc864cc"} - ] - }, + "description": "Native Codex exec CLI arguments used by Captain's OpenAI CLI runtime.", "properties": { - "prompt": { - "title": "Prompt", "description": "Prompt text written to Codex standard input.", - "type": "string", "x-clicky-section": "prompt", "x-clicky-order": 10, - "x-captain-option": {"nativeName": "stdin", "support": "mapped", "specPath": "prompt.user"} + "addDir": { + "description": "Additional directories granted write access alongside the primary workspace.", + "items": { + "description": "Add Dir value configuration. See the linked native reference for semantics and availability.", + "format": "path", + "title": "Add Dir value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/config-file/config-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Additional directories", + "type": "array", + "x-array-display": "list", + "x-captain-option": { + "nativeName": "--add-dir", + "specPath": "permissions.directories", + "support": "mapped" + }, + "x-clicky-order": 60, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/config-file/config-reference", + "label": "Documentation" + } + ] + } }, - "model": { - "title": "Model", "description": "Codex model identifier used for the execution.", - "type": "string", "x-clicky-section": "model", "x-clicky-order": 20, "x-icon": "sparkles", - "x-captain-option": {"nativeName": "--model", "support": "mapped", "specPath": "model.name"} + "approveForMe": { + "description": "Whether Codex chooses when to request command approval.", + "readOnly": true, + "title": "Automatic approvals", + "type": "boolean", + "x-captain-option": { + "nativeName": "--approve-for-me", + "note": "Captain maps its permission mode through Codex approval_policy and approvals_reviewer configuration.", + "support": "unsupported" + }, + "x-clicky-order": 210, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/config-file/config-reference", + "label": "Documentation" + } + ] + } + }, + "cd": { + "description": "Directory used as the Codex workspace root.", + "format": "path", + "title": "Working directory", + "type": "string", + "x-captain-option": { + "nativeName": "--cd", + "specPath": "context.dir", + "support": "mapped" + }, + "x-clicky-order": 50, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/config-file/config-reference", + "label": "Documentation" + } + ] + } + }, + "color": { + "description": "Color policy used for human-readable Codex output.", + "enum": [ + "always", + "never", + "auto" + ], + "readOnly": true, + "title": "Color", + "type": "string", + "x-captain-option": { + "nativeName": "--color", + "note": "Captain consumes JSON event output rather than colored terminal text.", + "support": "unsupported" + }, + "x-clicky-order": 270, + "x-clicky-section": "cli", + "x-enum-display": "segmented", + "x-enum-labels": { + "always": "Always", + "auto": "Auto", + "never": "Never" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/config-file/config-reference", + "label": "Documentation" + } + ] + } + }, + "command": { + "const": "exec", + "description": "Codex non-interactive execution subcommand.", + "readOnly": true, + "title": "Exec command", + "type": "string", + "x-captain-option": { + "nativeName": "exec", + "note": "Captain always selects Codex's non-interactive exec command.", + "support": "managed" + }, + "x-clicky-order": 130, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/config-file/config-reference", + "label": "Documentation" + } + ] + } }, "config": { - "title": "Configuration overrides", "description": "Codex TOML key-value overrides emitted on the command line.", - "type": "array", "items": {"type": "string"}, "x-clicky-section": "environment", "x-clicky-order": 30, "x-array-display": "list", - "x-captain-option": {"nativeName": "--config", "support": "mapped", "specPath": ["model.apiUrl", "model.effort", "permissions", "monitoring"]} + "description": "Codex TOML key-value overrides emitted on the command line.", + "items": { + "description": "Config value configuration. See the linked native reference for semantics and availability.", + "title": "Config value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/config-file/config-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Configuration overrides", + "type": "array", + "x-array-display": "list", + "x-captain-option": { + "nativeName": "--config", + "specPath": [ + "model.apiUrl", + "model.effort", + "permissions", + "monitoring" + ], + "support": "mapped" + }, + "x-clicky-order": 30, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/config-file/config-reference", + "label": "Documentation" + } + ] + } }, - "image": { - "title": "Images", "description": "Local image paths attached to the initial prompt.", - "type": "array", "items": {"type": "string", "format": "path"}, "x-clicky-section": "prompt", "x-clicky-order": 40, "x-array-display": "list", - "x-captain-option": {"nativeName": "--image", "support": "mapped", "specPath": "prompt.attachments"} + "cyberAccessProgram": { + "description": "Experimental access program requested for this turn with the OpenAI provider. Fork requires a prompt and review does not support this option.", + "enum": [ + "standard", + "daybreak_blue", + "daybreak_red" + ], + "readOnly": true, + "title": "Access program", + "type": "string", + "x-captain-option": { + "nativeName": "--cyber-access-program", + "note": "Captain does not select experimental access programs.", + "support": "unsupported" + }, + "x-clicky-order": 70, + "x-clicky-section": "cli", + "x-enum-display": "segmented", + "x-enum-labels": { + "daybreak_blue": "Daybreak blue", + "daybreak_red": "Daybreak red", + "standard": "Standard" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/config-file/config-reference", + "label": "Documentation" + } + ] + } }, - "cd": { - "title": "Working directory", "description": "Directory used as the Codex workspace root.", - "type": "string", "format": "path", "x-clicky-section": "workspace", "x-clicky-order": 50, - "x-captain-option": {"nativeName": "--cd", "support": "mapped", "specPath": "context.dir"} + "dangerouslyBypassApprovalsAndSandbox": { + "description": "Whether Codex executes without approval prompts or sandbox isolation.", + "readOnly": true, + "title": "Bypass approvals and sandbox", + "type": "boolean", + "x-captain-option": { + "nativeName": "--dangerously-bypass-approvals-and-sandbox", + "note": "Captain maps validated sandbox and approval settings separately.", + "support": "unsupported" + }, + "x-clicky-order": 220, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/config-file/config-reference", + "label": "Documentation" + } + ] + } }, - "addDir": { - "title": "Additional directories", "description": "Additional directories granted write access alongside the primary workspace.", - "type": "array", "items": {"type": "string", "format": "path"}, "x-clicky-section": "workspace", "x-clicky-order": 60, "x-array-display": "list", - "x-captain-option": {"nativeName": "--add-dir", "support": "mapped", "specPath": "permissions.directories"} + "dangerouslyBypassHookTrust": { + "description": "Whether Codex runs project hooks without trust confirmation.", + "readOnly": true, + "title": "Bypass hook trust", + "type": "boolean", + "x-captain-option": { + "nativeName": "--dangerously-bypass-hook-trust", + "note": "Captain does not bypass Codex hook trust checks.", + "support": "unsupported" + }, + "x-clicky-order": 230, + "x-clicky-section": "permissions", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/config-file/config-reference", + "label": "Documentation" + } + ] + } }, - "sandbox": { - "title": "Sandbox", "description": "Codex command-execution sandbox mode.", - "type": "string", "enum": ["read-only", "workspace-write", "danger-full-access"], "x-clicky-section": "sandbox", "x-clicky-order": 70, "x-enum-display": "segmented", - "x-captain-option": {"nativeName": "--sandbox", "support": "mapped", "specPath": "permissions"} + "disable": { + "description": "Codex feature flags disabled for this invocation.", + "items": { + "description": "Disable value configuration. See the linked native reference for semantics and availability.", + "title": "Disable value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/config-file/config-reference", + "label": "Documentation" + } + ] + } + }, + "readOnly": true, + "title": "Disable features", + "type": "array", + "x-array-display": "list", + "x-captain-option": { + "nativeName": "--disable", + "note": "Captain does not expose raw Codex feature flags.", + "support": "unsupported" + }, + "x-clicky-order": 160, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/config-file/config-reference", + "label": "Documentation" + } + ] + } + }, + "enable": { + "description": "Codex feature flags enabled for this invocation.", + "items": { + "description": "Enable value configuration. See the linked native reference for semantics and availability.", + "title": "Enable value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/config-file/config-reference", + "label": "Documentation" + } + ] + } + }, + "readOnly": true, + "title": "Enable features", + "type": "array", + "x-array-display": "list", + "x-captain-option": { + "nativeName": "--enable", + "note": "Captain does not expose raw Codex feature flags.", + "support": "unsupported" + }, + "x-clicky-order": 150, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/config-file/config-reference", + "label": "Documentation" + } + ] + } }, "ephemeral": { - "title": "Ephemeral", "description": "Whether Codex avoids persisting session files.", - "type": "boolean", "x-clicky-section": "workspace", "x-clicky-order": 80, - "x-captain-option": {"nativeName": "--ephemeral", "support": "mapped", "specPath": ["memory.skip", "memory.bare", "permissions.presets"]} + "description": "Whether Codex avoids persisting session files.", + "title": "Ephemeral", + "type": "boolean", + "x-captain-option": { + "nativeName": "--ephemeral", + "specPath": [ + "memory.skip", + "memory.bare", + "permissions.presets" + ], + "support": "mapped" + }, + "x-clicky-order": 80, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/config-file/config-reference", + "label": "Documentation" + } + ] + } }, - "ignoreUserConfig": { - "title": "Ignore user configuration", "description": "Whether Codex skips user-level configuration and instructions.", - "type": "boolean", "x-clicky-section": "workspace", "x-clicky-order": 90, - "x-captain-option": {"nativeName": "--ignore-user-config", "support": "mapped", "specPath": "memory.skipUser"} + "help": { + "description": "Whether Codex prints exec command help and exits.", + "readOnly": true, + "title": "Help", + "type": "boolean", + "x-captain-option": { + "nativeName": "--help", + "note": "Captain executes requests rather than CLI help.", + "support": "unsupported" + }, + "x-clicky-order": 310, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/config-file/config-reference", + "label": "Documentation" + } + ] + } }, "ignoreRules": { - "title": "Ignore rules", "description": "Whether Codex skips repository instructions and hooks.", - "type": "boolean", "x-clicky-section": "workspace", "x-clicky-order": 100, - "x-captain-option": {"nativeName": "--ignore-rules", "support": "mapped", "specPath": ["memory.skipProject", "memory.skipHooks"]} + "description": "Whether Codex skips repository instructions and hooks.", + "title": "Ignore rules", + "type": "boolean", + "x-captain-option": { + "nativeName": "--ignore-rules", + "specPath": [ + "memory.skipProject", + "memory.skipHooks" + ], + "support": "mapped" + }, + "x-clicky-order": 100, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/config-file/config-reference", + "label": "Documentation" + } + ] + } }, - "outputSchema": { - "title": "Output schema", "description": "Path to a JSON Schema constraining the final response.", - "type": "string", "format": "path", "x-clicky-section": "prompt", "x-clicky-order": 110, - "x-captain-option": {"nativeName": "--output-schema", "support": "mapped", "specPath": ["prompt.schema", "prompt.schemaJson"]} - }, - "resume": { - "title": "Resume session", "description": "Codex thread identifier passed to the exec resume subcommand.", - "type": "string", "x-clicky-section": "workspace", "x-clicky-order": 120, - "x-captain-option": {"nativeName": "exec resume SESSION_ID", "support": "mapped", "specPath": "sessionId"} + "ignoreUserConfig": { + "description": "Whether Codex skips user-level configuration and instructions.", + "title": "Ignore user configuration", + "type": "boolean", + "x-captain-option": { + "nativeName": "--ignore-user-config", + "specPath": "memory.skipUser", + "support": "mapped" + }, + "x-clicky-order": 90, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/config-file/config-reference", + "label": "Documentation" + } + ] + } }, - "command": { - "title": "Exec command", "description": "Codex non-interactive execution subcommand.", - "type": "string", "const": "exec", "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 130, - "x-captain-option": {"nativeName": "exec", "support": "managed", "note": "Captain always selects Codex's non-interactive exec command."} + "image": { + "description": "Local image paths attached to the initial prompt.", + "items": { + "description": "Image value configuration. See the linked native reference for semantics and availability.", + "format": "path", + "title": "Image value", + "type": "string", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/config-file/config-reference", + "label": "Documentation" + } + ] + } + }, + "title": "Images", + "type": "array", + "x-array-display": "list", + "x-captain-option": { + "nativeName": "--image", + "specPath": "prompt.attachments", + "support": "mapped" + }, + "x-clicky-order": 40, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/config-file/config-reference", + "label": "Documentation" + } + ] + } }, "json": { - "title": "JSON events", "description": "Whether Codex prints newline-delimited JSON events.", - "type": "boolean", "const": true, "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 140, - "x-captain-option": {"nativeName": "--json", "support": "managed", "note": "Captain requires JSON events for typed stream parsing."} - }, - "enable": { - "title": "Enable features", "description": "Codex feature flags enabled for this invocation.", - "type": "array", "items": {"type": "string"}, "readOnly": true, "x-clicky-section": "environment", "x-clicky-order": 150, "x-array-display": "list", - "x-captain-option": {"nativeName": "--enable", "support": "unsupported", "note": "Captain does not expose raw Codex feature flags."} + "const": true, + "description": "Whether Codex prints newline-delimited JSON events.", + "readOnly": true, + "title": "JSON events", + "type": "boolean", + "x-captain-option": { + "nativeName": "--json", + "note": "Captain requires JSON events for typed stream parsing.", + "support": "managed" + }, + "x-clicky-order": 140, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/config-file/config-reference", + "label": "Documentation" + } + ] + } }, - "disable": { - "title": "Disable features", "description": "Codex feature flags disabled for this invocation.", - "type": "array", "items": {"type": "string"}, "readOnly": true, "x-clicky-section": "environment", "x-clicky-order": 160, "x-array-display": "list", - "x-captain-option": {"nativeName": "--disable", "support": "unsupported", "note": "Captain does not expose raw Codex feature flags."} + "localProvider": { + "description": "Local model provider selected when --oss is active.", + "readOnly": true, + "title": "Local provider", + "type": "string", + "x-captain-option": { + "nativeName": "--local-provider", + "note": "Captain does not expose Codex local-provider selection.", + "support": "unsupported" + }, + "x-clicky-order": 190, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/config-file/config-reference", + "label": "Documentation" + } + ] + } }, - "strictConfig": { - "title": "Strict configuration", "description": "Whether unknown configuration keys cause an error.", - "type": "boolean", "readOnly": true, "x-clicky-section": "environment", "x-clicky-order": 170, - "x-captain-option": {"nativeName": "--strict-config", "support": "unsupported", "note": "Captain emits known configuration keys but does not enable strict parsing."} + "model": { + "description": "Codex model identifier used for the execution.", + "title": "Model", + "type": "string", + "x-captain-option": { + "nativeName": "--model", + "specPath": "model.name", + "support": "mapped" + }, + "x-clicky-order": 20, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/config-file/config-reference", + "label": "Documentation" + } + ] + }, + "x-icon": "sparkles" }, "oss": { - "title": "Open-source provider", "description": "Whether Codex uses a local open-source model provider.", - "type": "boolean", "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 180, - "x-captain-option": {"nativeName": "--oss", "support": "unsupported", "note": "Captain's OpenAI CLI runtime uses the configured Codex provider."} + "description": "Whether Codex uses a local open-source model provider.", + "readOnly": true, + "title": "Open-source provider", + "type": "boolean", + "x-captain-option": { + "nativeName": "--oss", + "note": "Captain's OpenAI CLI runtime uses the configured Codex provider.", + "support": "unsupported" + }, + "x-clicky-order": 180, + "x-clicky-section": "model", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/config-file/config-reference", + "label": "Documentation" + } + ] + } }, - "localProvider": { - "title": "Local provider", "description": "Local model provider selected when --oss is active.", - "type": "string", "readOnly": true, "x-clicky-section": "model", "x-clicky-order": 190, - "x-captain-option": {"nativeName": "--local-provider", "support": "unsupported", "note": "Captain does not expose Codex local-provider selection."} + "outputLastMessage": { + "description": "File path receiving the final assistant message.", + "format": "path", + "readOnly": true, + "title": "Last message output", + "type": "string", + "x-captain-option": { + "nativeName": "--output-last-message", + "note": "Captain receives the final message through the JSON event stream.", + "support": "unsupported" + }, + "x-clicky-order": 280, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/config-file/config-reference", + "label": "Documentation" + } + ] + } + }, + "outputSchema": { + "description": "Path to a JSON Schema constraining the final response.", + "format": "path", + "title": "Output schema", + "type": "string", + "x-captain-option": { + "nativeName": "--output-schema", + "specPath": [ + "prompt.schema", + "prompt.schemaJson" + ], + "support": "mapped" + }, + "x-clicky-order": 110, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/config-file/config-reference", + "label": "Documentation" + } + ] + } }, "profile": { - "title": "Configuration profile", "description": "Named Codex configuration profile loaded for the invocation.", - "type": "string", "readOnly": true, "x-clicky-section": "environment", "x-clicky-order": 200, - "x-captain-option": {"nativeName": "--profile", "support": "unsupported", "note": "Captain does not select a Codex configuration profile."} + "description": "Named Codex configuration profile loaded for the invocation.", + "readOnly": true, + "title": "Configuration profile", + "type": "string", + "x-captain-option": { + "nativeName": "--profile", + "note": "Captain does not select a Codex configuration profile.", + "support": "unsupported" + }, + "x-clicky-order": 200, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/config-file/config-reference", + "label": "Documentation" + } + ] + } }, - "approveForMe": { - "title": "Automatic approvals", "description": "Whether Codex chooses when to request command approval.", - "type": "boolean", "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 210, - "x-captain-option": {"nativeName": "--approve-for-me", "support": "unsupported", "note": "Captain maps its permission mode through Codex approval_policy and approvals_reviewer configuration."} + "prompt": { + "description": "Prompt text written to Codex standard input.", + "title": "Prompt", + "type": "string", + "x-captain-option": { + "nativeName": "stdin", + "specPath": "prompt.user", + "support": "mapped" + }, + "x-clicky-order": 10, + "x-clicky-section": "prompt", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/config-file/config-reference", + "label": "Documentation" + } + ] + } }, - "dangerouslyBypassApprovalsAndSandbox": { - "title": "Bypass approvals and sandbox", "description": "Whether Codex executes without approval prompts or sandbox isolation.", - "type": "boolean", "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 220, - "x-captain-option": {"nativeName": "--dangerously-bypass-approvals-and-sandbox", "support": "unsupported", "note": "Captain maps validated sandbox and approval settings separately."} + "resume": { + "description": "Codex thread identifier passed to the exec resume subcommand.", + "title": "Resume session", + "type": "string", + "x-captain-option": { + "nativeName": "exec resume SESSION_ID", + "specPath": "sessionId", + "support": "mapped" + }, + "x-clicky-order": 120, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/config-file/config-reference", + "label": "Documentation" + } + ] + } }, - "dangerouslyBypassHookTrust": { - "title": "Bypass hook trust", "description": "Whether Codex runs project hooks without trust confirmation.", - "type": "boolean", "readOnly": true, "x-clicky-section": "permissions", "x-clicky-order": 230, - "x-captain-option": {"nativeName": "--dangerously-bypass-hook-trust", "support": "unsupported", "note": "Captain does not bypass Codex hook trust checks."} + "resumeAll": { + "description": "Whether exec resume ignores cwd filtering while selecting a thread.", + "readOnly": true, + "title": "List all resumable sessions", + "type": "boolean", + "x-captain-option": { + "nativeName": "exec resume --all", + "note": "Captain does not open the interactive resume picker.", + "support": "unsupported" + }, + "x-clicky-order": 300, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/config-file/config-reference", + "label": "Documentation" + } + ] + } }, - "worktree": { - "title": "Worktree", "description": "Whether Codex creates and uses a temporary Git worktree.", - "type": "boolean", "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 240, - "x-captain-option": {"nativeName": "--worktree", "support": "unsupported", "note": "Captain executes in the explicitly supplied working directory."} + "resumeLast": { + "description": "Whether exec resume selects the most recent Codex thread.", + "readOnly": true, + "title": "Resume last session", + "type": "boolean", + "x-captain-option": { + "nativeName": "exec resume --last", + "note": "Captain resumes only an explicit session identifier.", + "support": "unsupported" + }, + "x-clicky-order": 290, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/config-file/config-reference", + "label": "Documentation" + } + ] + } }, - "threadSource": { - "title": "Thread source", "description": "Source label attached to the created Codex thread.", - "type": "string", "readOnly": true, "x-clicky-section": "environment", "x-clicky-order": 250, - "x-captain-option": {"nativeName": "--thread-source", "support": "unsupported", "note": "Captain does not set a native Codex thread-source label."} + "sandbox": { + "description": "Codex command-execution sandbox mode.", + "enum": [ + "read-only", + "workspace-write", + "danger-full-access" + ], + "title": "Sandbox", + "type": "string", + "x-captain-option": { + "nativeName": "--sandbox", + "specPath": "permissions", + "support": "mapped" + }, + "x-clicky-order": 70, + "x-clicky-section": "sandbox", + "x-enum-display": "segmented", + "x-enum-icons": { + "danger-full-access": "lock-open", + "read-only": "lock", + "workspace-write": "folder" + }, + "x-enum-labels": { + "danger-full-access": "Danger full access", + "read-only": "Read only", + "workspace-write": "Workspace write" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/config-file/config-reference", + "label": "Documentation" + } + ] + } }, "skipGitRepoCheck": { - "title": "Skip Git repository check", "description": "Whether Codex runs when the working directory is outside a Git repository.", - "type": "boolean", "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 260, - "x-captain-option": {"nativeName": "--skip-git-repo-check", "support": "unsupported", "note": "Captain leaves Codex's repository safety check enabled."} + "description": "Whether Codex runs when the working directory is outside a Git repository.", + "readOnly": true, + "title": "Skip Git repository check", + "type": "boolean", + "x-captain-option": { + "nativeName": "--skip-git-repo-check", + "note": "Captain leaves Codex's repository safety check enabled.", + "support": "unsupported" + }, + "x-clicky-order": 260, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/config-file/config-reference", + "label": "Documentation" + } + ] + } }, - "color": { - "title": "Color", "description": "Color policy used for human-readable Codex output.", - "type": "string", "enum": ["always", "never", "auto"], "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 270, "x-enum-display": "segmented", - "x-captain-option": {"nativeName": "--color", "support": "unsupported", "note": "Captain consumes JSON event output rather than colored terminal text."} - }, - "outputLastMessage": { - "title": "Last message output", "description": "File path receiving the final assistant message.", - "type": "string", "format": "path", "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 280, - "x-captain-option": {"nativeName": "--output-last-message", "support": "unsupported", "note": "Captain receives the final message through the JSON event stream."} - }, - "resumeLast": { - "title": "Resume last session", "description": "Whether exec resume selects the most recent Codex thread.", - "type": "boolean", "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 290, - "x-captain-option": {"nativeName": "exec resume --last", "support": "unsupported", "note": "Captain resumes only an explicit session identifier."} - }, - "resumeAll": { - "title": "List all resumable sessions", "description": "Whether exec resume ignores cwd filtering while selecting a thread.", - "type": "boolean", "readOnly": true, "x-clicky-section": "workspace", "x-clicky-order": 300, - "x-captain-option": {"nativeName": "exec resume --all", "support": "unsupported", "note": "Captain does not open the interactive resume picker."} + "strictConfig": { + "description": "Whether unknown configuration keys cause an error.", + "readOnly": true, + "title": "Strict configuration", + "type": "boolean", + "x-captain-option": { + "nativeName": "--strict-config", + "note": "Captain emits known configuration keys but does not enable strict parsing.", + "support": "unsupported" + }, + "x-clicky-order": 170, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/config-file/config-reference", + "label": "Documentation" + } + ] + } }, - "help": { - "title": "Help", "description": "Whether Codex prints exec command help and exits.", - "type": "boolean", "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 310, - "x-captain-option": {"nativeName": "--help", "support": "unsupported", "note": "Captain executes requests rather than CLI help."} + "threadSource": { + "description": "Source label attached to the created Codex thread.", + "readOnly": true, + "title": "Thread source", + "type": "string", + "x-captain-option": { + "nativeName": "--thread-source", + "note": "Captain does not set a native Codex thread-source label.", + "support": "unsupported" + }, + "x-clicky-order": 250, + "x-clicky-section": "environment", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/config-file/config-reference", + "label": "Documentation" + } + ] + } }, "version": { - "title": "Version", "description": "Whether Codex prints its version and exits.", - "type": "boolean", "readOnly": true, "x-clicky-section": "cli", "x-clicky-order": 320, - "x-captain-option": {"nativeName": "--version", "support": "unsupported", "note": "Captain resolves the installed CLI version outside request execution."} + "description": "Whether Codex prints its version and exits.", + "readOnly": true, + "title": "Version", + "type": "boolean", + "x-captain-option": { + "nativeName": "--version", + "note": "Captain resolves the installed CLI version outside request execution.", + "support": "unsupported" + }, + "x-clicky-order": 320, + "x-clicky-section": "cli", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/config-file/config-reference", + "label": "Documentation" + } + ] + } + }, + "worktree": { + "description": "Whether Codex creates and uses a temporary Git worktree.", + "readOnly": true, + "title": "Worktree", + "type": "boolean", + "x-captain-option": { + "nativeName": "--worktree", + "note": "Captain executes in the explicitly supplied working directory.", + "support": "unsupported" + }, + "x-clicky-order": 240, + "x-clicky-section": "workspace", + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/config-file/config-reference", + "label": "Documentation" + } + ] + } } + }, + "title": "OpenAI CLI options", + "type": "object", + "x-captain-adapter": { + "mode": "cli", + "provider": "openai", + "sources": [ + { + "kind": "cli-help", + "reference": "codex exec --help and codex exec resume --help", + "version": "codex-cli 0.164.0" + }, + { + "kind": "implementation", + "reference": "pkg/ai/provider/codex_cli.go", + "version": "6a2b56cbd26702b18905865f21fc66d44cc864cc" + } + ] + }, + "x-captain-inventory": { + "flags": [ + "--add-dir", + "--approve-for-me", + "--cd", + "--color", + "--config", + "--cyber-access-program", + "--dangerously-bypass-approvals-and-sandbox", + "--dangerously-bypass-hook-trust", + "--disable", + "--enable", + "--ephemeral", + "--help", + "--ignore-rules", + "--ignore-user-config", + "--image", + "--json", + "--local-provider", + "--model", + "--oss", + "--output-last-message", + "--output-schema", + "--profile", + "--sandbox", + "--skip-git-repo-check", + "--strict-config", + "--thread-source", + "--version", + "--worktree" + ], + "version": "codex-cli 0.164.0" + }, + "x-help": { + "links": [ + { + "href": "https://learn.chatgpt.com/docs/config-file/config-reference", + "label": "Documentation" + } + ] } } diff --git a/pkg/adapters/presentation/presentation.go b/pkg/adapters/presentation/presentation.go new file mode 100644 index 00000000..97f4d3d9 --- /dev/null +++ b/pkg/adapters/presentation/presentation.go @@ -0,0 +1,178 @@ +package presentation + +import ( + "fmt" + "sort" + "strings" + "unicode" +) + +// AnnotateSchema adds form presentation without changing validation keywords. +func AnnotateSchema(schema map[string]any, docs string) { + annotateNode(schema, "Configuration", docs) +} + +func annotateNode(node map[string]any, name, docs string) { + annotateArbitraryJSON(node) + if node["title"] == nil { + node["title"] = Title(name) + } + if node["description"] == nil && name != "Configuration" { + node["description"] = fmt.Sprintf("%s configuration. See the linked native reference for semantics and availability.", Title(name)) + } + if docs != "" && node["x-help"] == nil { + node["x-help"] = map[string]any{"links": []any{map[string]any{"label": "Documentation", "href": docs}}} + } + annotateEnum(node) + if properties, ok := node["properties"].(map[string]any); ok { + keys := sortedKeys(properties) + for i, key := range keys { + if child, ok := properties[key].(map[string]any); ok { + if child["x-clicky-order"] == nil { + child["x-clicky-order"] = (i + 1) * 10 + } + annotateNode(child, key, docs) + } + } + } + for _, keyword := range []string{"$defs", "definitions", "patternProperties"} { + if children, ok := node[keyword].(map[string]any); ok { + for _, key := range sortedKeys(children) { + if child, ok := children[key].(map[string]any); ok { + annotateNode(child, key, docs) + } + } + } + } + for _, keyword := range []string{"items", "additionalProperties", "propertyNames", "if", "then", "else", "not"} { + if child, ok := node[keyword].(map[string]any); ok { + annotateNode(child, name+" value", docs) + } + } + for _, keyword := range []string{"oneOf", "anyOf", "allOf", "prefixItems"} { + if children, ok := node[keyword].([]any); ok { + for _, raw := range children { + if child, ok := raw.(map[string]any); ok { + annotateNode(child, name, docs) + } + } + } + } + if node["type"] == "array" { + items, _ := node["items"].(map[string]any) + plainString := items["type"] == "string" + for _, keyword := range []string{"$ref", "enum", "const", "oneOf", "anyOf", "allOf", "properties", "items", "additionalProperties"} { + if items[keyword] != nil { + plainString = false + } + } + if !plainString && node["x-array-display"] == "list" { + delete(node, "x-array-display") + } + if plainString && node["x-array-display"] == nil { + node["x-array-display"] = "list" + } + } +} + +func annotateArbitraryJSON(node map[string]any) { + if node["type"] == "object" { + _, properties := node["properties"] + if node["additionalProperties"] == true || (!properties && node["additionalProperties"] == nil) { + node["additionalProperties"] = map[string]any{"format": "json"} + } + return + } + if node["format"] != nil { + return + } + for _, keyword := range []string{"type", "$ref", "enum", "const", "properties", "additionalProperties", "patternProperties", "items", "anyOf", "oneOf", "allOf", "not", "if", "required"} { + if _, exists := node[keyword]; exists { + return + } + } + node["format"] = "json" +} + +func annotateEnum(node map[string]any) { + values, ok := node["enum"].([]any) + if !ok || len(values) == 0 { + return + } + labels := map[string]any{} + existing, _ := node["x-enum-labels"].(map[string]any) + icons := map[string]any{} + for _, raw := range values { + value, ok := raw.(string) + if !ok { + return + } + labels[value] = Title(value) + if value == "" { + labels[value] = "Default" + } + if label, ok := existing[value].(string); ok && label != "" { + labels[value] = label + } + if icon, ok := enumIcons[value]; ok { + icons[value] = icon + } + } + node["x-enum-labels"] = labels + if node["x-enum-display"] == nil { + node["x-enum-display"] = "combobox" + if len(values) <= 4 { + node["x-enum-display"] = "segmented" + } + } + if len(icons) == len(values) && node["x-enum-icons"] == nil { + node["x-enum-icons"] = icons + } +} + +var enumIcons = map[string]string{ + "": "shield", + "read-only": "lock", "read": "lock", "workspace-write": "folder", "write": "folder", + "danger-full-access": "lock-open", "full": "lock-open", "deny": "prohibit", "allow": "check", + "ask": "question", "auto": "sparkles", "default": "shield", "plan": "list-dashes", + "acceptEdits": "folder", "bypassPermissions": "lock-open", "dontAsk": "prohibit", + "enabled": "check", "disabled": "prohibit", "restricted": "shield", "unrestricted": "globe", + "off": "prohibit", "native": "shield", "docker": "package", "git-agent": "git-branch", +} + +// Title turns a native property name into a form label. +func Title(value string) string { + var out []rune + var previous rune + for _, r := range value { + if r == '_' || r == '-' { + out = append(out, ' ') + previous = r + continue + } + if unicode.IsUpper(r) && unicode.IsLower(previous) { + out = append(out, ' ') + } + if len(out) == 0 { + r = unicode.ToUpper(r) + } + out = append(out, r) + previous = r + } + words := strings.Fields(string(out)) + for index, word := range words { + if replacement, ok := map[string]string{"openai": "OpenAI", "deepseek": "DeepSeek", "mcp": "MCP", "api": "API", "cli": "CLI", "http": "HTTP", "https": "HTTPS", "json": "JSON", "yaml": "YAML", "toml": "TOML", "sdk": "SDK"}[strings.ToLower(word)]; ok { + words[index] = replacement + } + } + return strings.Join(words, " ") +} + +func sortedKeys(values map[string]any) []string { + keys := make([]string, 0, len(values)) + for key := range values { + keys = append(keys, key) + } + sort.Strings(keys) + return keys +} diff --git a/pkg/adapters/published_resources_ginkgo_test.go b/pkg/adapters/published_resources_ginkgo_test.go new file mode 100644 index 00000000..2b86c44a --- /dev/null +++ b/pkg/adapters/published_resources_ginkgo_test.go @@ -0,0 +1,76 @@ +//go:build adapterresources + +package adapters + +import ( + "encoding/json" + "os" + "path/filepath" + + "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +// These specs check the generated catalog that CI publishes to the schemas branch. +// Run them after `go run ./hack/adapterresources resources` with +// CAPTAIN_ADAPTER_RESOURCES pointing at its -out directory. +var _ = ginkgo.Describe("published native resource catalog", func() { + var documents map[string]SchemaDocument + + ginkgo.BeforeEach(func() { + dir := os.Getenv("CAPTAIN_ADAPTER_RESOURCES") + Expect(dir).NotTo(BeEmpty(), "CAPTAIN_ADAPTER_RESOURCES must name the generated adapter resource directory") + raw, err := os.ReadFile(filepath.Join(dir, NativeResourceCatalogFile)) + Expect(err).NotTo(HaveOccurred()) + var catalog []SchemaDocument + Expect(json.Unmarshal(raw, &catalog)).To(Succeed()) + documents = map[string]SchemaDocument{} + for _, document := range catalog { + Expect(documents).NotTo(HaveKey(document.ID)) + documents[document.ID] = document + } + }) + + ginkgo.It("publishes every native projection with presentation annotations", func() { + Expect(documents).To(HaveLen(len(resourceProjections))) + for _, projection := range resourceProjections { + id := projection.provider + "/" + projection.name + Expect(documents).To(HaveKey(id)) + var root map[string]any + Expect(json.Unmarshal(documents[id].Schema, &root)).To(Succeed()) + walkPresentation(root, id) + } + }) + + ginkgo.It("validates native examples against the published schemas", func() { + for _, example := range []struct { + id string + value string + valid bool + }{ + {"openai/permission-profile", `{"extends":"team-workspace","workspace_roots":{"/workspace":true}}`, true}, + {"openai/permission-profile", `{"network":{"enabled":"yes"}}`, false}, + {"openai/permission-profile", `{"workspace_roots":{"/workspace":"yes"}}`, false}, + {"openai/filesystem", `{"/workspace":"write","/private":"deny"}`, true}, + {"openai/filesystem", `{"/workspace":"execute"}`, false}, + {"anthropic/sandbox", `{"network":{"allowedDomains":["example.com"]}}`, true}, + {"anthropic/sandbox", `{"network":{"allowedDomains":42}}`, false}, + {"anthropic/permissions", `{"defaultMode":"manual"}`, true}, + {"anthropic/settings", `{"cleanupPeriodDays":1.5}`, false}, + {"google/settings", `{"model":{"name":"gemini-example"}}`, true}, + } { + result, err := ValidateResource(ValidationRequest{ID: example.id, Schema: documents[example.id].Schema, + Value: decodeInstance(example.value)}) + Expect(err).NotTo(HaveOccurred(), example.id) + Expect(result.Valid).To(Equal(example.valid), "%s %s: %v", example.id, example.value, result.Errors) + } + }) + + ginkgo.It("applies the declarative help-text patches", func() { + var sandbox map[string]any + Expect(json.Unmarshal(documents["anthropic/sandbox"].Schema, &sandbox)).To(Succeed()) + Expect(sandbox["description"]).To(ContainSubstring("sandbox")) + enabled := objectField(objectField(sandbox, "properties", "anthropic/sandbox"), "enabled", "anthropic/sandbox") + Expect(enabled["description"]).To(ContainSubstring("Bash")) + }) +}) diff --git a/pkg/adapters/resource_annotations_ginkgo_test.go b/pkg/adapters/resource_annotations_ginkgo_test.go new file mode 100644 index 00000000..6cee940a --- /dev/null +++ b/pkg/adapters/resource_annotations_ginkgo_test.go @@ -0,0 +1,78 @@ +package adapters + +import ( + "encoding/json" + "fmt" + "net/url" + + "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +var _ = ginkgo.Describe("resource schema presentation", func() { + ginkgo.It("annotates nested properties, definitions, maps, arrays and union branches", func() { + documents, err := Schemas() + Expect(err).NotTo(HaveOccurred()) + for _, document := range documents { + var root map[string]any + Expect(json.Unmarshal(document.Schema, &root)).To(Succeed()) + walkPresentation(root, document.ID) + } + }) + + ginkgo.It("accounts for every captured CLI flag and alias", func() { + for _, document := range loadAdapterSchemas() { + if document.body["x-captain-inventory"] == nil || stringField(objectField(document.body, "x-captain-adapter", document.path), "mode") != "cli" { + continue + } + mapped := map[string]bool{} + for _, raw := range objectField(document.body, "properties", document.path) { + option := objectField(raw.(map[string]any), "x-captain-option", document.path) + mapped[stringField(option, "nativeName")] = true + if aliases, ok := option["aliases"].([]any); ok { + for _, alias := range aliases { + mapped[alias.(string)] = true + } + } + } + flags := objectField(document.body, "x-captain-inventory", document.path)["flags"].([]any) + Expect(len(flags)).To(BeNumerically(">", 10), document.path) + for _, flag := range flags { + Expect(mapped).To(HaveKeyWithValue(flag, true), document.path) + } + } + }) +}) + +func walkPresentation(node map[string]any, path string) { + Expect(node["title"]).To(BeAssignableToTypeOf(""), path) + links := objectField(node, "x-help", path)["links"].([]any) + Expect(links).NotTo(BeEmpty(), path) + for _, raw := range links { + href, err := url.Parse(stringField(raw.(map[string]any), "href")) + Expect(err).NotTo(HaveOccurred(), path) + Expect(href.Scheme).To(BeElementOf("https", "http"), path) + Expect(href.Host).NotTo(BeEmpty(), path) + } + for _, keyword := range []string{"properties", "$defs", "definitions", "patternProperties"} { + for key, raw := range objectFieldOrEmpty(node, keyword) { + if child, ok := raw.(map[string]any); ok { + walkPresentation(child, path+"/"+keyword+"/"+key) + } + } + } + for _, keyword := range []string{"items", "additionalProperties", "propertyNames", "if", "then", "else", "not"} { + if child, ok := node[keyword].(map[string]any); ok { + walkPresentation(child, path+"/"+keyword) + } + } + for _, keyword := range []string{"oneOf", "anyOf", "allOf", "prefixItems"} { + if children, ok := node[keyword].([]any); ok { + for index, raw := range children { + if child, ok := raw.(map[string]any); ok { + walkPresentation(child, fmt.Sprintf("%s/%s/%d", path, keyword, index)) + } + } + } + } +} diff --git a/pkg/adapters/resource_catalog.go b/pkg/adapters/resource_catalog.go new file mode 100644 index 00000000..90982555 --- /dev/null +++ b/pkg/adapters/resource_catalog.go @@ -0,0 +1,171 @@ +package adapters + +import ( + "encoding/json" + "fmt" + "strings" + + "github.com/flanksource/captain/pkg/adapters/presentation" + "github.com/flanksource/captain/pkg/api" +) + +type resourceProjection struct { + provider string + name string + pointer string +} + +var resourceProjections = []resourceProjection{ + {"openai", "config", ""}, + {"openai", "permission-profile", "/definitions/PermissionProfileToml"}, + {"openai", "filesystem", "/definitions/FilesystemPermissionsToml"}, + {"openai", "network", "/definitions/NetworkToml"}, + {"openai", "sandbox", "/definitions/SandboxWorkspaceWrite"}, + {"openai", "mcp-server", "/definitions/RawMcpServerConfig"}, + {"openai", "hooks", "/definitions/HooksToml"}, + {"openai", "agent-definition", "/definitions/AgentRoleToml"}, + {"openai", "profile", "/definitions/ConfigProfile"}, + {"anthropic", "settings", ""}, + {"anthropic", "sandbox", "/definitions/Settings/properties/sandbox"}, + {"anthropic", "permissions", "/definitions/Settings/properties/permissions"}, + {"anthropic", "hooks", "/definitions/Settings/properties/hooks"}, + {"anthropic", "skills", "/definitions/Settings/properties/skillOverrides"}, + {"anthropic", "plugins", "/definitions/Settings/properties/enabledPlugins"}, + {"anthropic", "mcp-server", "/definitions/McpServerConfigForProcessTransport"}, + {"anthropic", "agent-definition", "/definitions/AgentDefinition"}, + {"anthropic", "plugin", "/definitions/SdkPluginConfig"}, + {"google", "settings", ""}, + {"google", "sandbox", "/properties/tools/properties/sandbox"}, + {"google", "permissions", "/properties/security"}, + {"google", "mcp-servers", "/properties/mcpServers"}, + {"google", "hooks", "/properties/hooks"}, + {"google", "agents", "/properties/agents"}, + {"google", "skills", "/properties/skills"}, + {"google", "extensions", "/properties/extensions"}, + {"google", "model", "/properties/model"}, + {"google", "context", "/properties/context"}, + {"google", "environment", "/properties/advanced"}, +} + +// NativeResourceCatalogFile is the generated catalog of native provider resources. +// CI publishes it to the schemas branch (see NativeResourceCatalogURL); it is not embedded. +const NativeResourceCatalogFile = "native-resources.json" + +// NativeResourceCatalogURL is where the browser loads the published native resource catalog. +const NativeResourceCatalogURL = "https://raw.githubusercontent.com/flanksource/captain/schemas/adapters/" + NativeResourceCatalogFile + +// NativeResourceProviders are the providers whose native configuration snapshots feed the catalog. +var NativeResourceProviders = []string{"openai", "anthropic", "google"} + +// NativeResourceSchemas projects native provider configuration snapshots, keyed by +// provider, into catalog documents. Every provider in NativeResourceProviders is required. +func NativeResourceSchemas(sources map[string]map[string]any) ([]SchemaDocument, error) { + for _, provider := range NativeResourceProviders { + if sources[provider] == nil { + return nil, fmt.Errorf("native resource source for %s is missing", provider) + } + } + var documents []SchemaDocument + for _, projection := range resourceProjections { + document, err := projectResource(sources[projection.provider], projection) + if err != nil { + return nil, err + } + documents = append(documents, document) + } + return documents, nil +} + +func resourceSchemas() ([]SchemaDocument, error) { + documents, err := captainResourceSchemas() + if err != nil { + return nil, err + } + backends, err := backendResourceSchemas() + return append(documents, backends...), err +} + +func projectResource(source map[string]any, projection resourceProjection) (SchemaDocument, error) { + selected, err := schemaPointer(source, projection.pointer) + if err != nil { + return SchemaDocument{}, fmt.Errorf("resource %s/%s: %w", projection.provider, projection.name, err) + } + schema := map[string]any{} + for key, value := range selected { + schema[key] = value + } + for _, key := range []string{"$schema", "definitions", "$defs", "x-captain-resource"} { + if value, ok := source[key]; ok { + schema[key] = value + } + } + schema["title"] = presentation.Title(projection.provider) + " " + presentation.Title(projection.name) + if schema["description"] == nil { + schema["description"] = fmt.Sprintf("Native %s %s configuration.", projection.provider, projection.name) + } + return resourceDocument(projection.provider, projection.name, schema) +} + +func schemaPointer(root map[string]any, pointer string) (map[string]any, error) { + node := root + for _, key := range strings.Split(strings.TrimPrefix(pointer, "/"), "/") { + if pointer == "" { + break + } + key = strings.ReplaceAll(strings.ReplaceAll(key, "~1", "/"), "~0", "~") + child, ok := node[key].(map[string]any) + if !ok { + return nil, fmt.Errorf("schema pointer %q has no object at %q", pointer, key) + } + node = child + } + return node, nil +} + +func resourceDocument(provider, name string, schema map[string]any) (SchemaDocument, error) { + pruneDefinitions(schema) + raw, err := json.Marshal(schema) + if err != nil { + return SchemaDocument{}, fmt.Errorf("encode resource %s/%s: %w", provider, name, err) + } + kind := "resource" + if name == "config" || name == "settings" { + kind = "configuration" + } + title, _ := schema["title"].(string) + description, _ := schema["description"].(string) + return SchemaDocument{ID: provider + "/" + name, Kind: kind, Provider: provider, + Title: title, Description: description, Schema: raw}, nil +} + +func captainResourceSchemas() ([]SchemaDocument, error) { + resources := []struct { + name string + value any + }{ + {"sandbox", api.SandboxRef{}}, {"sandbox-policy", api.NativeSandboxPolicy{}}, + {"permissions", api.Permissions{}}, {"preset", api.RuntimePreset{}}, + {"spec", api.Spec{}}, {"tools", api.Tools{}}, {"mcp", api.MCP{}}, + {"resource-policy", api.ResourcePolicies{}}, {"dispatch", api.SandboxDispatchPolicy{}}, + } + var documents []SchemaDocument + for _, resource := range resources { + raw, err := api.SchemaJSON(resource.value) + if err != nil { + return nil, err + } + var schema map[string]any + if err := json.Unmarshal(raw, &schema); err != nil { + return nil, err + } + schema["title"] = "Captain " + presentation.Title(resource.name) + schema["description"] = "Portable Captain " + presentation.Title(resource.name) + " configuration. Runtime capabilities determine which settings can be enforced." + presentation.AnnotateSchema(schema, "https://github.com/flanksource/captain") + document, err := resourceDocument("captain", resource.name, schema) + if err != nil { + return nil, err + } + documents = append(documents, document) + } + return documents, nil +} diff --git a/pkg/adapters/resource_references.go b/pkg/adapters/resource_references.go new file mode 100644 index 00000000..bd7d693c --- /dev/null +++ b/pkg/adapters/resource_references.go @@ -0,0 +1,44 @@ +package adapters + +import "strings" + +func pruneDefinitions(schema map[string]any) { + for _, keyword := range []string{"definitions", "$defs"} { + definitions, ok := schema[keyword].(map[string]any) + if !ok { + continue + } + used := map[string]any{} + var walk func(any) + walk = func(raw any) { + switch node := raw.(type) { + case map[string]any: + if ref, ok := node["$ref"].(string); ok && strings.HasPrefix(ref, "#/"+keyword+"/") { + key := strings.SplitN(strings.TrimPrefix(ref, "#/"+keyword+"/"), "/", 2)[0] + key = strings.ReplaceAll(strings.ReplaceAll(key, "~1", "/"), "~0", "~") + if _, exists := used[key]; !exists { + if definition, exists := definitions[key]; exists { + used[key] = definition + walk(definition) + } + } + } + for key, value := range node { + if key != "definitions" && key != "$defs" { + walk(value) + } + } + case []any: + for _, value := range node { + walk(value) + } + } + } + walk(schema) + if len(used) == 0 { + delete(schema, keyword) + } else { + schema[keyword] = used + } + } +} diff --git a/pkg/adapters/resources/README.md b/pkg/adapters/resources/README.md new file mode 100644 index 00000000..d31dc87b --- /dev/null +++ b/pkg/adapters/resources/README.md @@ -0,0 +1,5 @@ +# Captain resource schemas + +`captain-backends.json` describes Captain's own sandbox backends and is embedded in the binary. + +Native provider resource schemas (OpenAI, Anthropic, Google) are not committed or embedded. The `Adapter schemas` workflow generates them with `go run ./hack/adapterresources resources` and publishes them to the `schemas` branch, where the web UI loads `adapters/native-resources.json`. See the [adapter resource guide](../../../docs/adapter-resource-schemas.md). diff --git a/pkg/adapters/resources/captain-backends.json b/pkg/adapters/resources/captain-backends.json new file mode 100644 index 00000000..a5bfbde1 --- /dev/null +++ b/pkg/adapters/resources/captain-backends.json @@ -0,0 +1,50 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$defs": { + "docker": { + "type": "object", + "title": "Docker backend", + "description": "Trusted Docker backend entry in ~/.captain.yaml under sandbox.backends.. An image may instead come from the project's .container-sandbox.yaml. Host mounts and environment access are grants made by the machine owner.", + "additionalProperties": false, + "required": ["kind"], + "x-captain-source": "pkg/sandbox/adapter/container.go", + "properties": { + "kind": { "type": "string", "const": "docker", "default": "docker" }, + "image": { "type": "string", "description": "Container image override. Required at execution when no project image is configured." }, + "presets": { "type": "array", "items": { "type": "string" }, "description": "Named dependency presets that grant host cache mounts and credential environment passthrough." }, + "env": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Environment variables expanded from the trusted machine environment and passed into Docker." }, + "envPassthrough": { "type": "array", "items": { "type": "string", "minLength": 1 }, "description": "Names of existing host environment variables to pass into the container." }, + "volumes": { "type": "array", "items": { "type": "string", "pattern": "^[^:]+:[^:]+(?::ro)?$" }, "description": "Trusted host mounts as source:target[:ro]. Project configuration uses structured volume objects instead." } + } + }, + "git-agent": { + "type": "object", + "title": "Git Agent backend", + "description": "Trusted Git Agent backend entry in ~/.captain.yaml under sandbox.backends.. Enrollment records are managed by captain sandbox git-agent add. This preview does not read credential files or contact agents.", + "additionalProperties": false, + "required": ["kind"], + "x-captain-source": "pkg/sandbox/adapter/gitagent.go", + "properties": { + "kind": { "type": "string", "const": "git-agent", "default": "git-agent" }, + "relay": { "type": "string", "enum": ["sync", "async"], "default": "sync", "description": "Mailbox relay behavior for dispatched tasks." }, + "key": { "type": "string", "description": "Path to the supervisor's dispatch SSH key. Defaults beside the Captain configuration." }, + "mailboxRoot": { "type": "string", "description": "Root served by the long-running mailbox endpoint." }, + "waitTimeout": { "type": "string", "pattern": "^(?:[0-9]+(?:\\.[0-9]+)?(?:ns|us|µs|μs|ms|s|m|h))+$", "description": "Positive Go duration for waiting for a terminal verdict, for example 1h or 30m. Runtime validation also rejects zero durations.", "default": "1h" }, + "agents": { + "type": "object", "readOnly": true, + "description": "Enrollment-managed endpoints and paths. Re-enroll an agent to update transport trust and credentials.", + "additionalProperties": { + "type": "object", "additionalProperties": false, "required": ["url"], + "properties": { + "url": { "type": "string", "pattern": "^(ssh|https)://", "description": "Enrolled agent endpoint." }, + "hostFingerprint": { "type": "string", "description": "Pinned SSH host key fingerprint." }, + "tokenPath": { "type": "string", "description": "Path to the HTTPS dispatch token, never its contents." }, + "caPath": { "type": "string", "description": "Path to the trusted HTTPS certificate authority." }, + "pinnedPubkey": { "type": "string", "description": "Pinned HTTPS server public key." } + } + } + } + } + } + } +} diff --git a/pkg/adapters/resources_contract_ginkgo_test.go b/pkg/adapters/resources_contract_ginkgo_test.go new file mode 100644 index 00000000..d1472e48 --- /dev/null +++ b/pkg/adapters/resources_contract_ginkgo_test.go @@ -0,0 +1,105 @@ +package adapters + +import ( + "bytes" + "encoding/json" + + "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + jsonschema "github.com/santhosh-tekuri/jsonschema/v6" +) + +var _ = ginkgo.Describe("resource schema catalog", func() { + ginkgo.It("embeds Captain-owned execution and portable resources, leaving native provider resources to the published catalog", func() { + documents, err := Schemas() + Expect(err).NotTo(HaveOccurred()) + ids := make([]any, 0, len(documents)) + for _, document := range documents { + ids = append(ids, document.ID) + } + Expect(ids).To(ContainElements("anthropic/api", "openai/cli", "captain/sandbox", "captain/permissions", + "captain/preset", "captain/docker-backend", "captain/git-agent-backend")) + for _, projection := range resourceProjections { + Expect(ids).NotTo(ContainElement(projection.provider + "/" + projection.name)) + } + Expect(ids).To(ConsistOf(uniqueResourceIDs(ids))) + }) + + ginkgo.It("refuses to project native resources when a provider source is missing", func() { + _, err := NativeResourceSchemas(map[string]map[string]any{"openai": {"properties": map[string]any{}}}) + Expect(err).To(MatchError(ContainSubstring("anthropic"))) + }) + + ginkgo.It("compiles every catalog document with self-contained references", func() { + documents, err := Schemas() + Expect(err).NotTo(HaveOccurred()) + for _, document := range documents { + body, err := jsonschema.UnmarshalJSON(bytes.NewReader(document.Schema)) + Expect(err).NotTo(HaveOccurred(), document.Title) + compiler := jsonschema.NewCompiler() + Expect(compiler.AddResource("mem:///resource.json", body)).To(Succeed()) + _, err = compiler.Compile("mem:///resource.json") + Expect(err).NotTo(HaveOccurred(), document.Title) + } + }) + + ginkgo.It("rejects invalid nested sandbox values and preserves named profile references", func() { + for _, example := range []struct { + id string + value string + valid bool + }{ + {"captain/sandbox", `{"mode":"native","policy":{"network":{"httpProxyPort":70000}}}`, false}, + {"captain/permissions", `{"mode":"plan","tools":{"Bash":"deny"}}`, true}, + {"captain/permissions", `{"tools":{"Bash":"unknown"}}`, false}, + {"captain/docker-backend", `{"kind":"docker","env":{"EXAMPLE":42}}`, false}, + {"captain/git-agent-backend", `{"kind":"git-agent","relay":"invalid"}`, false}, + {"anthropic/api", `{"model":"claude-sonnet-5","max_tokens":128,"messages":[{"role":"user","content":[{"type":"text","text":"Inspect the example"}]}]}`, true}, + {"anthropic/api", `{"model":"claude-sonnet-5","max_tokens":128,"messages":[{"role":"user","content":[{"type":"text","text":42}]}]}`, false}, + } { + result, err := ValidateResource(ValidationRequest{ID: example.id, Value: decodeInstance(example.value)}) + Expect(err).NotTo(HaveOccurred(), example.id) + Expect(result.Valid).To(Equal(example.valid), "%s: %v", example.id, result.Errors) + } + }) + + ginkgo.It("validates a published document against the schema it carries and reports the failing instance path", func() { + schema := json.RawMessage(`{"type":"object","properties":{"roots":{"type":"object","additionalProperties":{"$ref":"#/$defs/Flag"}}},"$defs":{"Flag":{"type":"boolean"}}}`) + result, err := ValidateResource(ValidationRequest{ID: "openai/permission-profile", Schema: schema, + Value: decodeInstance(`{"roots":{"/workspace":"yes"}}`)}) + Expect(err).NotTo(HaveOccurred()) + Expect(result.Valid).To(BeFalse()) + Expect(result.Errors).To(HaveLen(1)) + Expect(result.Errors[0].InstancePath).To(Equal("/roots/~1workspace")) + Expect(result.Errors[0].Message).To(ContainSubstring("boolean")) + }) + + ginkgo.It("never loads external references from a carried schema", func() { + _, err := ValidateResource(ValidationRequest{ID: "example/remote", Schema: json.RawMessage(`{"$ref":"file:///etc/hosts"}`), + Value: decodeInstance(`{}`)}) + Expect(err).To(MatchError(ContainSubstring("example/remote"))) + }) + + ginkgo.It("reports an unknown embedded schema id", func() { + _, err := ValidateResource(ValidationRequest{ID: "anthropic/settings", Value: decodeInstance(`{}`)}) + Expect(err).To(MatchError(ErrUnknownSchema)) + }) +}) + +func decodeInstance(raw string) any { + value, err := jsonschema.UnmarshalJSON(bytes.NewBufferString(raw)) + Expect(err).NotTo(HaveOccurred()) + return value +} + +func uniqueResourceIDs(ids []any) []any { + seen := map[any]bool{} + var unique []any + for _, id := range ids { + if !seen[id] { + unique = append(unique, id) + seen[id] = true + } + } + return unique +} diff --git a/pkg/adapters/schema_contract_ginkgo_test.go b/pkg/adapters/schema_contract_ginkgo_test.go index 97c8aee2..cec0ece3 100644 --- a/pkg/adapters/schema_contract_ginkgo_test.go +++ b/pkg/adapters/schema_contract_ginkgo_test.go @@ -60,10 +60,11 @@ var _ = ginkgo.Describe("Adapter schema contract", func() { ginkgo.It("embeds every schema for runtime viewers in canonical order", func() { documents, err := Schemas() Expect(err).NotTo(HaveOccurred()) - Expect(documents).To(HaveLen(len(expectedSchemaPaths()))) - actual := make([]string, 0, len(documents)) for _, document := range documents { + if document.Kind != "execution" { + continue + } path := filepath.Join(document.Provider, document.Mode+".schema.json") actual = append(actual, path) raw, err := os.ReadFile(path) @@ -105,7 +106,7 @@ var _ = ginkgo.Describe("Adapter schema contract", func() { }) ginkgo.It("round trips native JSON names through every generated root DTO", func() { - assertJSONRoundTrip[AnthropicAPIOptions](map[string]any{"model": "claude-sonnet-5", "max_tokens": 2048, "messages": []any{map[string]any{"role": "user"}}, "stream": true, "metadata": map[string]any{"user_id": "tenant-x"}}) + assertJSONRoundTrip[AnthropicAPIOptions](map[string]any{"model": "claude-sonnet-5", "max_tokens": 2048, "messages": []any{map[string]any{"role": "user", "content": []any{map[string]any{"type": "text", "text": "Inspect the example"}}}}, "stream": true, "metadata": map[string]any{"user_id": "tenant-x"}}) assertJSONRoundTrip[AnthropicAgentOptions](map[string]any{"model": "claude-sonnet-5", "includePartialMessages": true, "agent": "reviewer"}) assertJSONRoundTrip[AnthropicCLIOptions](map[string]any{"model": "claude-sonnet-5", "print": true, "agent": "reviewer"}) assertJSONRoundTrip[OpenAIAPIOptions](map[string]any{"model": "gpt-5.6", "input": "hello", "stream": true, "background": true}) @@ -161,9 +162,9 @@ var _ = ginkgo.Describe("Adapter schema contract", func() { ginkgo.It("generates named permission profiles as strings", func() { for _, field := range []reflect.StructField{ - generatedField(reflect.TypeFor[ThreadStart](), "Permissions"), - generatedField(reflect.TypeFor[ThreadResume](), "Permissions"), - generatedField(reflect.TypeFor[TurnStart](), "Permissions"), + generatedField(reflect.TypeFor[OpenAIAgentOptionsThreadStart](), "Permissions"), + generatedField(reflect.TypeFor[OpenAIAgentOptionsThreadResume](), "Permissions"), + generatedField(reflect.TypeFor[OpenAIAgentOptionsTurnStart](), "Permissions"), } { Expect(field.Type.Kind()).To(Equal(reflect.Pointer), field.Name) Expect(field.Type.Elem().Kind()).To(Equal(reflect.String), field.Name) @@ -247,7 +248,7 @@ func walkLeafOptions(schema map[string]any, prefix string, visit func(string, ma field, ok := properties[name].(map[string]any) Expect(ok).To(BeTrue(), "%s/%s must be an object", prefix, name) path := prefix + "/" + name - if len(objectFieldOrEmpty(field, "properties")) > 0 { + if field["x-captain-option"] == nil && len(objectFieldOrEmpty(field, "properties")) > 0 { walkLeafOptions(field, path, visit) continue } diff --git a/pkg/adapters/validation.go b/pkg/adapters/validation.go new file mode 100644 index 00000000..2e8fe5e8 --- /dev/null +++ b/pkg/adapters/validation.go @@ -0,0 +1,124 @@ +package adapters + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "sync" + + jsonschema "github.com/santhosh-tekuri/jsonschema/v6" +) + +var ( + ErrUnknownSchema = errors.New("unknown schema") + // ErrInvalidSchema marks a carried schema that cannot be compiled. + ErrInvalidSchema = errors.New("invalid schema") +) + +type ValidationIssue struct { + InstancePath string `json:"instancePath"` + SchemaPath string `json:"schemaPath"` + Message string `json:"message"` +} + +type ValidationResult struct { + Valid bool `json:"valid"` + Errors []ValidationIssue `json:"errors"` +} + +// ValidationRequest names the document a value is checked against. Schema carries +// a published document's schema (native provider resources are not embedded); +// without it the ID must name an embedded catalog document. +type ValidationRequest struct { + ID string + Schema json.RawMessage + Value any +} + +var compiledResources = sync.OnceValues(func() (map[string]*jsonschema.Schema, error) { + documents, err := Schemas() + if err != nil { + return nil, err + } + compiled := make(map[string]*jsonschema.Schema, len(documents)) + for _, document := range documents { + if _, exists := compiled[document.ID]; exists { + return nil, fmt.Errorf("duplicate resource id %q", document.ID) + } + schema, err := compileSchema(document.ID, document.Schema) + if err != nil { + return nil, err + } + compiled[document.ID] = schema + } + return compiled, nil +}) + +// compileSchema compiles a self-contained schema; external references are never loaded. +func compileSchema(id string, raw json.RawMessage) (*jsonschema.Schema, error) { + body, err := jsonschema.UnmarshalJSON(bytes.NewReader(raw)) + if err != nil { + return nil, fmt.Errorf("decode %s: %w", id, err) + } + compiler := jsonschema.NewCompiler() + compiler.UseLoader(jsonschema.SchemeURLLoader{}) + uri := "mem:///" + id + ".json" + if err := compiler.AddResource(uri, body); err != nil { + return nil, fmt.Errorf("register %s: %w", id, err) + } + schema, err := compiler.Compile(uri) + if err != nil { + return nil, fmt.Errorf("compile %s: %w", id, err) + } + return schema, nil +} + +// ValidateResource checks a value against its schema without resolving or executing it. +func ValidateResource(request ValidationRequest) (ValidationResult, error) { + schema, err := requestSchema(request) + if err != nil { + return ValidationResult{}, err + } + result := ValidationResult{Valid: true, Errors: []ValidationIssue{}} + if err := schema.Validate(request.Value); err != nil { + var invalid *jsonschema.ValidationError + if !errors.As(err, &invalid) { + return ValidationResult{}, fmt.Errorf("validate %s: %w", request.ID, err) + } + result.Valid = false + result.Errors = validationIssues(*invalid.DetailedOutput()) + } + return result, nil +} + +func requestSchema(request ValidationRequest) (*jsonschema.Schema, error) { + if len(request.Schema) > 0 { + schema, err := compileSchema(request.ID, request.Schema) + if err != nil { + return nil, fmt.Errorf("%w: %w", ErrInvalidSchema, err) + } + return schema, nil + } + compiled, err := compiledResources() + if err != nil { + return nil, err + } + schema, exists := compiled[request.ID] + if !exists { + return nil, fmt.Errorf("%w %q", ErrUnknownSchema, request.ID) + } + return schema, nil +} + +func validationIssues(output jsonschema.OutputUnit) []ValidationIssue { + if len(output.Errors) == 0 && output.Error != nil { + return []ValidationIssue{{InstancePath: output.InstanceLocation, + SchemaPath: output.KeywordLocation, Message: output.Error.String()}} + } + var issues []ValidationIssue + for _, child := range output.Errors { + issues = append(issues, validationIssues(child)...) + } + return issues +} diff --git a/pkg/adapters/zz_generated_anthropic_agent.go b/pkg/adapters/zz_generated_anthropic_agent.go index 7d88bad6..6cd31ff7 100644 --- a/pkg/adapters/zz_generated_anthropic_agent.go +++ b/pkg/adapters/zz_generated_anthropic_agent.go @@ -4,6 +4,252 @@ package adapters import "encoding/json" +// Definition for a custom subagent that can be invoked via the Agent tool. +type AnthropicAgentAgentDefinition struct { + // Run this agent as a background task (non-blocking, fire-and-forget) when + // invoked + Background *bool `json:"background,omitempty,omitzero"` + + // Experimental: Critical reminder added to system prompt + CriticalSystemReminderEXPERIMENTAL *string `json:"criticalSystemReminder_EXPERIMENTAL,omitempty,omitzero"` + + // Natural language description of when to use this agent + Description string `json:"description"` + + // Array of tool names to explicitly disallow for this agent. MCP server-level + // specs (mcp__server, mcp__server__*, mcp__*) remove every tool from the named + // server (or all MCP tools). + DisallowedTools []string `json:"disallowedTools,omitempty,omitzero"` + + // Reasoning effort level for this agent. Either a named level or an integer + Effort *json.RawMessage `json:"effort,omitempty,omitzero"` + + // Auto-submitted as the first user turn when this agent is the main thread agent. + // Slash commands are processed. Prepended to any user-provided prompt. + InitialPrompt *string `json:"initialPrompt,omitempty,omitzero"` + + // Maximum number of agentic turns (API round-trips) before stopping + MaxTurns *float64 `json:"maxTurns,omitempty,omitzero"` + + // MCP Servers configuration. See the linked native reference for semantics and + // availability. + McpServers []AnthropicAgentAgentMcpServerSpec `json:"mcpServers,omitempty,omitzero"` + + // Scope for auto-loading agent memory files. 'user' - + // ~/.claude/agent-memory//, 'project' - + // .claude/agent-memory//, 'local' - + // .claude/agent-memory-local// + Memory *AnthropicAgentAgentDefinitionMemory `json:"memory,omitempty,omitzero"` + + // Model alias (e.g. 'fable', 'opus', 'sonnet', 'haiku') or full model ID (e.g. + // 'claude-fable-5'). 'inherit' uses the main model; if omitted, uses the default + // subagent model when one is configured, else the main model + Model *string `json:"model,omitempty,omitzero"` + + // Agent type auto-spawned as a background observer whenever this agent runs. The + // observer receives read-only activity digests and reports via the ObserverReport + // tool; it never participates in the task. + Observer *string `json:"observer,omitempty,omitzero"` + + // Supplemental postamble appended (after the harness-owned default) to each + // activity digest sent to the observer. Blank values are ignored. + ObserverMessage *string `json:"observerMessage,omitempty,omitzero"` + + // Run this agent without the user, project and local CLAUDE.md instruction files + // when it runs as a subagent; managed policy files are kept. For agents that take + // everything they need from the delegation prompt. No effect on the main session + // agent. + OmitClaudeMd *bool `json:"omitClaudeMd,omitempty,omitzero"` + + // Permission mode controlling how tool executions are handled + PermissionMode *AnthropicAgentPermissionMode `json:"permissionMode,omitempty,omitzero"` + + // The agent's system prompt + Prompt string `json:"prompt"` + + // Array of skill names to preload into the agent context + Skills []string `json:"skills,omitempty,omitzero"` + + // Array of allowed tool names. If omitted, inherits all tools from parent. Note: + // passing 'Skill' here is deprecated — use the `skills` field instead. + Tools []string `json:"tools,omitempty,omitzero"` +} + +type AnthropicAgentAgentDefinitionMemory string + +const AnthropicAgentAgentDefinitionMemoryLocal AnthropicAgentAgentDefinitionMemory = "local" +const AnthropicAgentAgentDefinitionMemoryProject AnthropicAgentAgentDefinitionMemory = "project" +const AnthropicAgentAgentDefinitionMemoryUser AnthropicAgentAgentDefinitionMemory = "user" + +// Agent MCP Server Spec configuration. See the linked native reference for +// semantics and availability. +type AnthropicAgentAgentMcpServerSpec = json.RawMessage + +// MCP HTTP Server Config configuration. See the linked native reference for +// semantics and availability. +type AnthropicAgentMcpHttpServerConfig struct { + // When true, all tools from this server are always included in the prompt and + // never deferred behind tool search. Equivalent to setting defer_loading: false + // on the API. Default: tools are deferred when tool search is enabled. As a side + // effect this also blocks startup until the server is connected (capped at the + // standard 5s connect timeout) even though MCP startup is otherwise non-blocking + // by default, since the tools must be present when the turn-1 prompt is built. + AlwaysLoad *bool `json:"alwaysLoad,omitempty,omitzero"` + + // Headers configuration. See the linked native reference for semantics and + // availability. + Headers AnthropicAgentMcpHttpServerConfigHeaders `json:"headers,omitempty,omitzero"` + + // Per-server tool-call timeout in milliseconds. Overrides the MCP_TOOL_TIMEOUT + // environment variable for this server. Hard wall-clock limit per call; progress + // notifications do not extend it. Values below 1000ms are ignored (falls through + // to MCP_TOOL_TIMEOUT or the default). + Timeout *float64 `json:"timeout,omitempty,omitzero"` + + // Tools configuration. See the linked native reference for semantics and + // availability. + Tools []AnthropicAgentMcpServerToolPolicy `json:"tools,omitempty,omitzero"` + + // Type configuration. See the linked native reference for semantics and + // availability. + Type string `json:"type"` + + // Url configuration. See the linked native reference for semantics and + // availability. + Url string `json:"url"` +} + +// Headers configuration. See the linked native reference for semantics and +// availability. +type AnthropicAgentMcpHttpServerConfigHeaders map[string]string + +// MCP SSEServer Config configuration. See the linked native reference for +// semantics and availability. +type AnthropicAgentMcpSSEServerConfig struct { + // When true, all tools from this server are always included in the prompt and + // never deferred behind tool search. Equivalent to setting defer_loading: false + // on the API. Default: tools are deferred when tool search is enabled. As a side + // effect this also blocks startup until the server is connected (capped at the + // standard 5s connect timeout) even though MCP startup is otherwise non-blocking + // by default, since the tools must be present when the turn-1 prompt is built. + AlwaysLoad *bool `json:"alwaysLoad,omitempty,omitzero"` + + // Headers configuration. See the linked native reference for semantics and + // availability. + Headers AnthropicAgentMcpSSEServerConfigHeaders `json:"headers,omitempty,omitzero"` + + // Per-server tool-call timeout in milliseconds. Overrides the MCP_TOOL_TIMEOUT + // environment variable for this server. Hard wall-clock limit per call; progress + // notifications do not extend it. Values below 1000ms are ignored (falls through + // to MCP_TOOL_TIMEOUT or the default). + Timeout *float64 `json:"timeout,omitempty,omitzero"` + + // Tools configuration. See the linked native reference for semantics and + // availability. + Tools []AnthropicAgentMcpServerToolPolicy `json:"tools,omitempty,omitzero"` + + // Type configuration. See the linked native reference for semantics and + // availability. + Type string `json:"type"` + + // Url configuration. See the linked native reference for semantics and + // availability. + Url string `json:"url"` +} + +// Headers configuration. See the linked native reference for semantics and +// availability. +type AnthropicAgentMcpSSEServerConfigHeaders map[string]string + +// MCP SDK Server Config configuration. See the linked native reference for +// semantics and availability. +type AnthropicAgentMcpSdkServerConfig struct { + // Name configuration. See the linked native reference for semantics and + // availability. + Name string `json:"name"` + + // Per-server tool-call timeout in milliseconds. Overrides the MCP_TOOL_TIMEOUT + // environment variable for this server. Hard wall-clock limit per call; progress + // notifications do not extend it. Values below 1000ms are ignored (falls through + // to MCP_TOOL_TIMEOUT or the default). Applies when the server is first + // registered; changing it for an already-registered server has no effect until it + // is removed and re-added. + Timeout *float64 `json:"timeout,omitempty,omitzero"` + + // Type configuration. See the linked native reference for semantics and + // availability. + Type string `json:"type"` +} + +// MCP Server Config For Process Transport configuration. See the linked native +// reference for semantics and availability. +type AnthropicAgentMcpServerConfigForProcessTransport = json.RawMessage + +// Per-tool permission policy carried on mcp_set_servers for remote servers. +type AnthropicAgentMcpServerToolPolicy struct { + // Name configuration. See the linked native reference for semantics and + // availability. + Name string `json:"name"` + + // Org admin's per-tool ceiling. Drives the auto-mode isOrgAskCeiling gate so an + // admin 'ask' cap forces a user prompt even in auto mode. + OrgMaxPermission *AnthropicAgentMcpServerToolPolicyOrgMaxPermission `json:"org_max_permission,omitempty,omitzero"` + + // Permission policy configuration. See the linked native reference for semantics + // and availability. + PermissionPolicy *AnthropicAgentMcpServerToolPolicyPermissionPolicy `json:"permission_policy,omitempty,omitzero"` +} + +type AnthropicAgentMcpServerToolPolicyOrgMaxPermission string + +const AnthropicAgentMcpServerToolPolicyOrgMaxPermissionAllow AnthropicAgentMcpServerToolPolicyOrgMaxPermission = "allow" +const AnthropicAgentMcpServerToolPolicyOrgMaxPermissionAsk AnthropicAgentMcpServerToolPolicyOrgMaxPermission = "ask" +const AnthropicAgentMcpServerToolPolicyOrgMaxPermissionBlocked AnthropicAgentMcpServerToolPolicyOrgMaxPermission = "blocked" + +type AnthropicAgentMcpServerToolPolicyPermissionPolicy string + +const AnthropicAgentMcpServerToolPolicyPermissionPolicyAlwaysAllow AnthropicAgentMcpServerToolPolicyPermissionPolicy = "always_allow" +const AnthropicAgentMcpServerToolPolicyPermissionPolicyAlwaysAsk AnthropicAgentMcpServerToolPolicyPermissionPolicy = "always_ask" +const AnthropicAgentMcpServerToolPolicyPermissionPolicyAlwaysDeny AnthropicAgentMcpServerToolPolicyPermissionPolicy = "always_deny" + +// MCP Stdio Server Config configuration. See the linked native reference for +// semantics and availability. +type AnthropicAgentMcpStdioServerConfig struct { + // When true, all tools from this server are always included in the prompt and + // never deferred behind tool search. Equivalent to setting defer_loading: false + // on the API. Default: tools are deferred when tool search is enabled. As a side + // effect this also blocks startup until the server is connected (capped at the + // standard 5s connect timeout) even though MCP startup is otherwise non-blocking + // by default, since the tools must be present when the turn-1 prompt is built. + AlwaysLoad *bool `json:"alwaysLoad,omitempty,omitzero"` + + // Args configuration. See the linked native reference for semantics and + // availability. + Args []string `json:"args,omitempty,omitzero"` + + // Command configuration. See the linked native reference for semantics and + // availability. + Command string `json:"command"` + + // Env configuration. See the linked native reference for semantics and + // availability. + Env AnthropicAgentMcpStdioServerConfigEnv `json:"env,omitempty,omitzero"` + + // Per-server tool-call timeout in milliseconds. Overrides the MCP_TOOL_TIMEOUT + // environment variable for this server. Hard wall-clock limit per call; progress + // notifications do not extend it. Values below 1000ms are ignored (falls through + // to MCP_TOOL_TIMEOUT or the default). + Timeout *float64 `json:"timeout,omitempty,omitzero"` + + // Type configuration. See the linked native reference for semantics and + // availability. + Type *string `json:"type,omitempty,omitzero"` +} + +// Env configuration. See the linked native reference for semantics and +// availability. +type AnthropicAgentMcpStdioServerConfigEnv map[string]string + // Native Claude Agent SDK options and Captain bridge arguments used by the // Anthropic agent runtime. type AnthropicAgentOptions struct { @@ -65,7 +311,7 @@ type AnthropicAgentOptions struct { EnableFileCheckpointing *bool `json:"enableFileCheckpointing,omitempty,omitzero"` // Environment variables supplied to the Claude Code child process. - Env Environment `json:"env,omitempty,omitzero"` + Env AnthropicAgentOptionsEnv `json:"env,omitempty,omitzero"` // JavaScript runtime used to launch the Agent SDK child process. Executable *string `json:"executable,omitempty,omitzero"` @@ -100,7 +346,7 @@ type AnthropicAgentOptions struct { LoadTimeoutMs *int `json:"loadTimeoutMs,omitempty,omitzero"` // Enterprise-managed Claude Code settings applied to the query. - ManagedSettings *json.RawMessage `json:"managedSettings,omitempty,omitzero"` + ManagedSettings *AnthropicAgentOptionsManagedSettings `json:"managedSettings,omitempty,omitzero"` // Maximum spend in US dollars before the SDK stops. MaxBudgetUsd *float64 `json:"maxBudgetUsd,omitempty,omitzero"` @@ -185,7 +431,8 @@ type AnthropicAgentOptions struct { // Message identifier at which an existing session is resumed. ResumeSessionAt *string `json:"resumeSessionAt,omitempty,omitzero"` - // Claude Agent SDK filesystem and command sandbox configuration. + // Sandbox configuration. See the linked native reference for semantics and + // availability. Sandbox *json.RawMessage `json:"sandbox,omitempty,omitzero"` // Explicit UUID assigned when starting a new Agent SDK session. @@ -201,7 +448,7 @@ type AnthropicAgentOptions struct { SettingSources []AnthropicAgentOptionsSettingSourcesElem `json:"settingSources,omitempty,omitzero"` // In-memory Claude Code settings applied to the query. - Settings *json.RawMessage `json:"settings,omitempty,omitzero"` + Settings *AnthropicAgentOptionsSettings `json:"settings,omitempty,omitzero"` // Skill configuration made available to the Agent SDK query. Skills *json.RawMessage `json:"skills,omitempty,omitzero"` @@ -258,6 +505,12 @@ const AnthropicAgentOptionsEffortMax AnthropicAgentOptionsEffort = "max" const AnthropicAgentOptionsEffortMedium AnthropicAgentOptionsEffort = "medium" const AnthropicAgentOptionsEffortXhigh AnthropicAgentOptionsEffort = "xhigh" +// Environment variables supplied to the Claude Code child process. +type AnthropicAgentOptionsEnv map[string]string + +// Enterprise-managed Claude Code settings applied to the query. +type AnthropicAgentOptionsManagedSettings = json.RawMessage + type AnthropicAgentOptionsPermissionMode string const AnthropicAgentOptionsPermissionModeAcceptEdits AnthropicAgentOptionsPermissionMode = "acceptEdits" @@ -282,5 +535,2081 @@ const AnthropicAgentOptionsSettingSourcesElemLocal AnthropicAgentOptionsSettingS const AnthropicAgentOptionsSettingSourcesElemProject AnthropicAgentOptionsSettingSourcesElem = "project" const AnthropicAgentOptionsSettingSourcesElemUser AnthropicAgentOptionsSettingSourcesElem = "user" -// Environment variables supplied to the Claude Code child process. -type Environment map[string]string +// In-memory Claude Code settings applied to the query. +type AnthropicAgentOptionsSettings = json.RawMessage + +type AnthropicAgentPermissionMode string + +const AnthropicAgentPermissionModeAcceptEdits AnthropicAgentPermissionMode = "acceptEdits" +const AnthropicAgentPermissionModeAuto AnthropicAgentPermissionMode = "auto" +const AnthropicAgentPermissionModeBypassPermissions AnthropicAgentPermissionMode = "bypassPermissions" +const AnthropicAgentPermissionModeDefault AnthropicAgentPermissionMode = "default" +const AnthropicAgentPermissionModeDontAsk AnthropicAgentPermissionMode = "dontAsk" +const AnthropicAgentPermissionModePlan AnthropicAgentPermissionMode = "plan" + +// Configuration for loading a plugin. +type AnthropicAgentSdkPluginConfig struct { + // Absolute or relative path to the plugin directory + Path string `json:"path"` + + // When true, the engine loads skills/hooks/agents/commands from this plugin but + // does NOT read its .mcp.json or manifest mcpServers. Use when the SDK host owns + // this plugin's MCP connections. + SkipMcpDiscovery *bool `json:"skipMcpDiscovery,omitempty,omitzero"` + + // Plugin type. Currently only 'local' is supported + Type string `json:"type"` +} + +// AUTO-GENERATED - DO NOT EDIT +// +// This file is auto-generated from the settings JSON schema. To modify these +// types, edit SettingsSchema in src/utils/settings/types.ts and run: +// +// bun scripts/generate-sdk-types.ts +type AnthropicAgentSettings struct { + // JSON Schema reference for Claude Code settings + Schema *string `json:"$schema,omitempty,omitzero"` + + // Alias for extraKnownMarketplaces: this key is read exactly as if it were + // spelled extraKnownMarketplaces. Do not set both in one file — if both appear, + // this key is ignored with a warning. Claude Code may rewrite this key as + // extraKnownMarketplaces when it updates the file. Clients older than this alias + // ignore it, so prefer extraKnownMarketplaces while older Claude Code versions + // still share the same settings. + AdditionalMarketplaces AnthropicAgentSettingsAdditionalMarketplaces `json:"additionalMarketplaces,omitempty,omitzero"` + + // Advisor model for the server-side advisor tool. + AdvisorModel *string `json:"advisorModel,omitempty,omitzero"` + + // Name of an agent (built-in or custom) to use for the main thread. Applies the + // agent's system prompt, tool restrictions, and model. + Agent *string `json:"agent,omitempty,omitzero"` + + // Allow Claude to push proactive mobile notifications + AgentPushNotifEnabled *bool `json:"agentPushNotifEnabled,omitempty,omitzero"` + + // When true (and set in managed settings), claude.ai cloud MCP connectors load + // alongside managed-mcp.json instead of being suppressed by its exclusive-control + // lockdown. Default off preserves the lockdown. Read from managed settings only. + AllowAllClaudeAiMcps *bool `json:"allowAllClaudeAiMcps,omitempty,omitzero"` + + // When true (and set in managed settings), only hooks from managed settings and + // from plugins that managed settings enable run. User, project, and local hooks + // and the hooks of plugins the user installed are ignored. Features built into + // Claude Code are not hooks in this sense and keep working. + AllowManagedHooksOnly *bool `json:"allowManagedHooksOnly,omitempty,omitzero"` + + // When true (and set in managed settings), allowedMcpServers is only read from + // managed settings. deniedMcpServers still merges from all sources, so users can + // deny servers for themselves. Users can still add their own MCP servers, but + // only the admin-defined allowlist applies. + AllowManagedMcpServersOnly *bool `json:"allowManagedMcpServersOnly,omitempty,omitzero"` + + // When true (and set in managed settings), permission rules from user, project, + // local, and --settings files and allow rules from --allowedTools are ignored; + // only managed settings can add allow rules through settings. --disallowedTools + // and other deny and ask rules from the command line or the current session still + // apply. + AllowManagedPermissionRulesOnly *bool `json:"allowManagedPermissionRulesOnly,omitempty,omitzero"` + + // Managed-org allowlist of channel plugins. When set, replaces the default + // Anthropic allowlist — admins decide which plugins may push inbound messages. + // Undefined falls back to the default. Requires channelsEnabled: true. + AllowedChannelPlugins []AnthropicAgentSettingsAllowedChannelPluginsElem `json:"allowedChannelPlugins,omitempty,omitzero"` + + // Allowlist of URL patterns that HTTP hooks may target. Supports * as a wildcard + // (e.g. "https://hooks.example.com/*"). When set, HTTP hooks with non-matching + // URLs are blocked. If undefined, all URLs are allowed. If empty array, no HTTP + // hooks are allowed. Arrays merge across settings sources (same semantics as + // allowedMcpServers). + AllowedHttpHookUrls []string `json:"allowedHttpHookUrls,omitempty,omitzero"` + + // Alias for strictKnownMarketplaces (managed settings only): this key is read + // exactly as if it were spelled strictKnownMarketplaces. Do not set both in one + // file — if both appear, this key is ignored with a warning. Clients older than + // this alias ignore it, so keep using strictKnownMarketplaces when the allowlist + // must also bind older Claude Code versions. + AllowedMarketplaces []json.RawMessage `json:"allowedMarketplaces,omitempty,omitzero"` + + // Enterprise allowlist of the MCP servers users may use. Governs servers users + // add (user, project and local config, --mcp-config, agent frontmatter, plugins, + // claude.ai connectors); servers the organization itself delivers + // (managedMcpServers, and managed-mcp.json entries that use no ${VAR} expansion) + // are allowed without being listed; a managed-mcp.json entry that uses ${VAR} + // expansion is still checked against this list. If undefined, all servers are + // allowed. If empty array, users can use no servers of their own. Denylist takes + // precedence - if a server is on both lists, it is denied. + AllowedMcpServers []AnthropicAgentSettingsAllowedMcpServersElem `json:"allowedMcpServers,omitempty,omitzero"` + + // When false, thinking is disabled. When absent or true, thinking is enabled + // automatically for supported models. + AlwaysThinkingEnabled *bool `json:"alwaysThinkingEnabled,omitempty,omitzero"` + + // Path to a script that outputs authentication values + ApiKeyHelper *string `json:"apiKeyHelper,omitempty,omitzero"` + + // Managed plugins (plugin\@marketplace ids that managed enabledPlugins sets true) + // whose hooks run last among plugins, innermost, in the listed order: the last id + // listed sits just above the built-in plugins and sees each event as every other + // plugin left it. Only honored from managed settings (or, on a machine with none, + // from user settings for your own plugins); ignored in project, local and + // --settings sources. + AppendPlugins []string `json:"appendPlugins,omitempty,omitzero"` + + // Idle time before Claude's questions auto-continue with any answers selected so + // far. Defaults to never — auto-continue only runs when explicitly set to + // 60s/5m/10m. + AskUserQuestionTimeout *AnthropicAgentSettingsAskUserQuestionTimeout `json:"askUserQuestionTimeout,omitempty,omitzero"` + + // Customize attribution text for commits and PRs. Each field defaults to the + // standard Claude Code attribution if not set. + Attribution *AnthropicAgentSettingsAttribution `json:"attribution,omitempty,omitzero"` + + // Automatically compact conversation when context fills + AutoCompactEnabled *bool `json:"autoCompactEnabled,omitempty,omitzero"` + + // Auto-compact window size + AutoCompactWindow *float64 `json:"autoCompactWindow,omitempty,omitzero"` + + // When a claude.ai usage limit stops your session, wait for the limit to reset + // and continue the task automatically. When off, the limit dialog offers the wait + // as a choice instead. + AutoContinueAtUsageLimit *bool `json:"autoContinueAtUsageLimit,omitempty,omitzero"` + + // Enable background memory consolidation (auto-dream). When set, overrides the + // server-side default. + AutoDreamEnabled *bool `json:"autoDreamEnabled,omitempty,omitzero"` + + // Custom directory path for auto-memory storage. Supports ~/ prefix for home + // directory expansion. Ignored if set in projectSettings (checked-in + // .claude/settings.json) for security. When unset, defaults to + // ~/.claude/projects//memory/. + AutoMemoryDirectory *string `json:"autoMemoryDirectory,omitempty,omitzero"` + + // Enable auto-memory for this project. When false, Claude will not read from or + // write to the auto-memory directory. + AutoMemoryEnabled *bool `json:"autoMemoryEnabled,omitempty,omitzero"` + + // Auto-scroll the conversation view to bottom (fullscreen mode only) + AutoScrollEnabled *bool `json:"autoScrollEnabled,omitempty,omitzero"` + + // Release channel for auto-updates (latest or stable) + AutoUpdatesChannel *AnthropicAgentSettingsAutoUpdatesChannel `json:"autoUpdatesChannel,omitempty,omitzero"` + + // Mirror local sessions to claude.ai as view-only (no remote control) + AutoUploadSessions *bool `json:"autoUploadSessions,omitempty,omitzero"` + + // Allowlist of models that users can select. Accepts family aliases ("opus" + // allows any opus version), version prefixes ("opus-4-5" allows only that + // version), and full model IDs. If undefined, all models are available. If empty + // array, only the default model is available. Typically set in managed settings + // by enterprise administrators. + AvailableModels []string `json:"availableModels,omitempty,omitzero"` + + // Path to a script that refreshes AWS authentication + AwsAuthRefresh *string `json:"awsAuthRefresh,omitempty,omitzero"` + + // Path to a script that exports AWS credentials + AwsCredentialExport *string `json:"awsCredentialExport,omitempty,omitzero"` + + // Whether the Bash tool shows a diff of the files a Bash command changed + // (PostToolUse Bash hooks get the changed-file list in tool_response). Set to + // false to turn that off. Default: on when the Bash tool handles file edits. Only + // user, flag or policy settings can turn it on outside auto and bypassPermissions + // modes. + BashEditDiffEnabled *bool `json:"bashEditDiffEnabled,omitempty,omitzero"` + + // How many characters of a successful Bash or PowerShell command's output Claude + // receives inline (default 30000; values clamp to 4000-128000). Output past this + // is saved to a file and Claude receives a short preview plus the path. When set, + // this also replaces BASH_MAX_OUTPUT_LENGTH, which on its own only sizes the + // read-back window. + BashOutputMaxChars *float64 `json:"bashOutputMaxChars,omitempty,omitzero"` + + // Enterprise blocklist of marketplace sources. When set in managed settings, + // these sources are blocked from being added as marketplaces. Entries match + // exactly, except that a github entry may use the owner-wildcard form + // {"source":"github","repo":"owner/*"} to block every repository under that + // owner. The check happens BEFORE downloading, so blocked sources never touch the + // filesystem. + BlockedMarketplaces []json.RawMessage `json:"blockedMarketplaces,omitempty,omitzero"` + + // Managed-org opt-in for channel notifications (MCP servers with the + // claude/channel capability pushing inbound messages). claude.ai + // Teams/Enterprise: default off. Console: default on unless managed settings + // exist. Set true to allow; users then select servers via --channels. + ChannelsEnabled *bool `json:"channelsEnabled,omitempty,omitzero"` + + // CLAUDE.md-style instructions injected as organization-managed memory. Only + // honored from managed/policy settings. + ClaudeMd *string `json:"claudeMd,omitempty,omitzero"` + + // Glob patterns or absolute paths of CLAUDE.md files to exclude from loading. + // Patterns are matched against absolute file paths using picomatch. Only applies + // to User, Project, and Local memory types (Managed/policy files cannot be + // excluded). Examples: "/home/user/monorepo/CLAUDE.md", "** /code/CLAUDE.md", "** + // /some-dir/.claude/rules/**" + ClaudeMdExcludes []string `json:"claudeMdExcludes,omitempty,omitzero"` + + // Number of days to retain chat transcripts before automatic cleanup (default: + // 30). Minimum 1. Use a large value for long retention; use + // --no-session-persistence to disable transcript writes entirely. + CleanupPeriodDays *float64 `json:"cleanupPeriodDays,omitempty,omitzero"` + + // Company announcements to display at startup (one will be randomly selected if + // multiple are provided) + CompanyAnnouncements []string `json:"companyAnnouncements,omitempty,omitzero"` + + // Inbound cross-session peer messages (SendMessage from your other sessions): + // 'accept' delivers them, 'hold' parks them for your review without letting + // Claude act, 'refuse' opts this session out. An explicit value always wins. + // Unset (mode parity): a message auto-delivers only when the sending session's + // permission-mode class matches yours (bypass↔bypass or prompting↔prompting); a + // mismatched sender's message is held for your approval; a sender that asserts no + // class is held only while this session bypasses permission prompts. + CrossSessionInbound *AnthropicAgentSettingsCrossSessionInbound `json:"crossSessionInbound,omitempty,omitzero"` + + // When no background service is running: 'transient' spawns one for this login + // session; 'ask' offers to install it persistently + DaemonColdStart *AnthropicAgentSettingsDaemonColdStart `json:"daemonColdStart,omitempty,omitzero"` + + // Default shell for input-box ! commands. Defaults to 'bash' on all platforms (no + // Windows auto-flip). + DefaultShell *AnthropicAgentSettingsDefaultShell `json:"defaultShell,omitempty,omitzero"` + + // Default transcript view: chat (SendUserMessage checkpoints only) or transcript + // (full) + DefaultView *AnthropicAgentSettingsDefaultView `json:"defaultView,omitempty,omitzero"` + + // Enterprise denylist of MCP servers that are explicitly blocked. If a server is + // on the denylist, it will be blocked across all scopes including enterprise. + // Denylist takes precedence over allowlist - if a server is on both lists, it is + // denied. + DeniedMcpServers []AnthropicAgentSettingsDeniedMcpServersElem `json:"deniedMcpServers,omitempty,omitzero"` + + // Retention ceiling in days for session transcripts created or last written by a + // desktop-host surface (Claude Desktop, Cowork), which are otherwise exempt from + // the cleanupPeriodDays sweep. 0 (the default) means no ceiling: such transcripts + // are kept until deleted another way. Unlike cleanupPeriodDays, 0 is allowed + // because this setting never disables writes — it only bounds an exemption from + // deletion. The ceiling is a hard cap: it also bounds an active archive grace, so + // the grace window of a release marker never keeps files past the ceiling. + // Ignored when cleanupPeriodDays is managed by org policy. A ceiling at or below + // cleanupPeriodDays effectively disables the exemption: those transcripts age out + // on the regular cleanupPeriodDays schedule, so the effective retention is + // whichever of the two periods is longer. + DesktopSessionCleanupPeriodDays *float64 `json:"desktopSessionCleanupPeriodDays,omitempty,omitzero"` + + // Max time a permission/user dialog forwarded to a remote client stays parked + // awaiting an answer, and how long a HELD cross-session message awaits approval, + // before either resolves to its safe no-action default (cancelled / + // dropped-with-denial). Defaults to 5m to match the long-standing remote-dialog + // deadline; "never" disables the deadline. Local-only permission prompts (no + // remote client) are unaffected. The CLAUDE_CODE_USER_DIALOG_TIMEOUT_MS env var, + // when set, overrides this. Read from trusted sources only (never a checked-in + // repo settings file). + DialogExpiry *AnthropicAgentSettingsDialogExpiry `json:"dialogExpiry,omitempty,omitzero"` + + // Disable agent view (`claude agents`, `--bg`, /background, the on-demand + // daemon). Typically set in managed settings. Equivalent to + // CLAUDE_CODE_DISABLE_AGENT_VIEW=1. + DisableAgentView *bool `json:"disableAgentView,omitempty,omitzero"` + + // Disable all hooks and statusLine execution: the hooks defined in settings files + // and by installed plugins. Features built into Claude Code are not hooks in this + // sense and keep working; each has its own switch. + DisableAllHooks *bool `json:"disableAllHooks,omitempty,omitzero"` + + // Deprecated: use enableArtifact: false. Still honored — true disables the + // Artifact tool; false is ignored. + DisableArtifact *bool `json:"disableArtifact,omitempty,omitzero"` + + // Disable auto mode + DisableAutoMode *string `json:"disableAutoMode,omitempty,omitzero"` + + // Disable the skills and workflows that ship with Claude Code: bundled skills and + // workflows are removed entirely; built-in slash commands stay typable but are + // hidden from the model. Plugins, .claude/skills/, and .claude/commands/ are + // unaffected. Equivalent to CLAUDE_CODE_DISABLE_BUNDLED_SKILLS=1. + DisableBundledSkills *bool `json:"disableBundledSkills,omitempty,omitzero"` + + // When true in any settings source, claude.ai MCP cloud connectors are not + // auto-fetched or connected. Only gates auto-fetched connectors — a + // claudeai-proxy server passed explicitly (e.g. via --mcp-config or the SDK + // mcpServers option) still follows the normal MCP config trust flow. + // Any-source-true wins: a project can opt out, but a project-level false cannot + // override a user-level true. + DisableClaudeAiConnectors *bool `json:"disableClaudeAiConnectors,omitempty,omitzero"` + + // Controls the `command` plugin source, whose plugin directory is produced by + // running a marketplace-declared command on this machine. true: command-sourced + // plugins are never installed, updated, or re-resolved (the command never runs). + // false: explicitly allowed. Unset: follows allowManagedHooksOnly — an org that + // restricts hook execution to managed settings gets command sources disabled too. + // Only honored from managed settings. + DisableCommandPluginSources *bool `json:"disableCommandPluginSources,omitempty,omitzero"` + + // Prevent claude-cli:// protocol handler registration with the OS + DisableDeepLinkRegistration *string `json:"disableDeepLinkRegistration,omitempty,omitzero"` + + // Disable Remote Control (claude.ai/code, `claude remote-control`, + // `--remote-control`/`--rc`, auto-start, and the in-session toggle). Typically + // set in managed settings. + DisableRemoteControl *bool `json:"disableRemoteControl,omitempty,omitzero"` + + // When true (and set in managed settings), rejects the --plugin-dir, + // --plugin-url, --agents, and non-sdk --mcp-config CLI flags at startup. Closes + // the CLI-flag bypass of strictKnownMarketplaces. Pair with allowedMcpServers for + // per-server MCP control; this setting does not gate other MCP entry points (SDK + // setMcpServers, claude mcp add, .mcp.json). Also blocks surfaces that spawn the + // CLI with these flags internally (see settings documentation). Only honored from + // managed settings; ignored in user/project/local settings. + DisableSideloadFlags *bool `json:"disableSideloadFlags,omitempty,omitzero"` + + // Disable inline shell execution in skills and custom slash commands from user, + // project, or plugin sources. Commands are replaced with a placeholder instead of + // being run. + DisableSkillShellExecution *bool `json:"disableSkillShellExecution,omitempty,omitzero"` + + // Disable the Workflows feature (also via CLAUDE_CODE_DISABLE_WORKFLOWS). + DisableWorkflows *bool `json:"disableWorkflows,omitempty,omitzero"` + + // List of rejected MCP servers from .mcp.json + DisabledMcpjsonServers []string `json:"disabledMcpjsonServers,omitempty,omitzero"` + + // Key binding mode for the prompt input + EditorMode *AnthropicAgentSettingsEditorMode `json:"editorMode,omitempty,omitzero"` + + // Persisted effort level for supported models. + EffortLevel *AnthropicAgentSettingsEffortLevel `json:"effortLevel,omitempty,omitzero"` + + // When false, the :emoji: shortcode typeahead (the suggestion popup and the + // :name: inline replacement) is disabled. When absent or true, it is enabled. + EmojiCompletionEnabled *bool `json:"emojiCompletionEnabled,omitempty,omitzero"` + + // Whether to automatically approve all MCP servers in the project + EnableAllProjectMcpServers *bool `json:"enableAllProjectMcpServers,omitempty,omitzero"` + + // Turn the Artifact tool on or off. Off in any of managed, --settings, or user + // settings wins; project and local settings can only turn it off. Unset defaults + // to on once the feature is available. + EnableArtifact *bool `json:"enableArtifact,omitempty,omitzero"` + + // Enable or disable the Workflows feature for this user. Unset = default by plan + // once the feature is available. + EnableWorkflows *bool `json:"enableWorkflows,omitempty,omitzero"` + + // List of approved MCP servers from .mcp.json + EnabledMcpjsonServers []string `json:"enabledMcpjsonServers,omitempty,omitzero"` + + // Enabled plugins using plugin-id\@marketplace-id format. Example: { + // "formatter\@anthropic-tools": true }. Also supports extended format with + // version constraints. Settings precedence is user < project < local < flag < + // policy, so to disable a plugin that project settings enable, set it to false in + // .claude/settings.local.json — setting false in ~/.claude/settings.json is + // overridden by the project. + EnabledPlugins AnthropicAgentSettingsEnabledPlugins `json:"enabledPlugins,omitempty,omitzero"` + + // When true and availableModels is a non-empty array, the Default model selection + // is also constrained: if the default model for the user tier is not in + // availableModels, Default resolves to the first allowed availableModels entry + // instead. Has no effect when availableModels is unset or an empty array. + // Typically set in managed settings by enterprise administrators. + EnforceAvailableModels *bool `json:"enforceAvailableModels,omitempty,omitzero"` + + // Environment variables to set for Claude Code sessions + Env AnthropicAgentSettingsEnv `json:"env,omitempty,omitzero"` + + // Additional marketplaces to make available for this repository. Typically used + // in repository .claude/settings.json to ensure team members have required plugin + // sources. + ExtraKnownMarketplaces AnthropicAgentSettingsExtraKnownMarketplaces `json:"extraKnownMarketplaces,omitempty,omitzero"` + + // Fallback model(s) tried in order when the primary model is overloaded or + // unavailable. Each element accepts a model name or alias; "default" expands to + // the default model. CLI --fallback-model takes precedence. + FallbackModel []string `json:"fallbackModel,omitempty,omitzero"` + + // When true, fast mode is enabled. When absent or false, fast mode is off. + FastMode *bool `json:"fastMode,omitempty,omitzero"` + + // When true, fast mode does not persist across sessions. Each session starts with + // fast mode off. + FastModePerSessionOptIn *bool `json:"fastModePerSessionOptIn,omitempty,omitzero"` + + // Model-drafted feedback (the SendFeedback tool). "notify" (default) shows a + // one-line notice when a draft is queued; "quiet" shows only the footer counter; + // "off" disables the tool entirely so drafts are never queued. + FeedbackDrafts *AnthropicAgentSettingsFeedbackDrafts `json:"feedbackDrafts,omitempty,omitzero"` + + // Probability (0–1) that the session quality survey appears when eligible. 0.05 + // is a reasonable starting point. + FeedbackSurveyRate *float64 `json:"feedbackSurveyRate,omitempty,omitzero"` + + // Snapshot files before edits so /rewind can restore them + FileCheckpointingEnabled *bool `json:"fileCheckpointingEnabled,omitempty,omitzero"` + + // Custom file suggestion configuration for \@ mentions + FileSuggestion *AnthropicAgentSettingsFileSuggestion `json:"fileSuggestion,omitempty,omitzero"` + + // Extra clickable footer badges that appear when a regex matches turn output + // (tool results and assistant responses). Read from user, flag, and managed + // settings only; ignored in project .claude/settings.json and local + // .claude/settings.local.json. At most 5 badges render; the oldest is displaced + // by newer matches and /clear removes them. Use to surface IDs printed by project + // CLIs as session links. + FooterLinksRegexes []json.RawMessage `json:"footerLinksRegexes,omitempty,omitzero"` + + // Cloud gateway URL to pre-fill and auto-connect to during login, alongside + // forceLoginMethod: "gateway". Honored only from admin-controlled managed + // settings (MDM / managed-settings.json / policy helper); ignored in user, + // project, and remote-delivered settings. + ForceLoginGatewayUrl *string `json:"forceLoginGatewayUrl,omitempty,omitzero"` + + // Force a specific login method: "claudeai" for Claude Pro/Max, "console" for + // Console billing, "gateway" for the Cloud gateway OIDC device flow + ForceLoginMethod *AnthropicAgentSettingsForceLoginMethod `json:"forceLoginMethod,omitempty,omitzero"` + + // Organization UUID to require for OAuth login. Accepts a single UUID string or + // an array of UUIDs (any one is permitted). When set in managed settings, login + // fails if the authenticated account does not belong to a listed organization. + ForceLoginOrgUUID *json.RawMessage `json:"forceLoginOrgUUID,omitempty,omitzero"` + + // When set in managed settings, the CLI blocks startup until remote managed + // settings are freshly fetched, and exits if the fetch fails + ForceRemoteSettingsRefresh *bool `json:"forceRemoteSettingsRefresh,omitempty,omitzero"` + + // IPv4 CIDR blocks (at most 4, each /8 to /32, not overlapping) your Cloud + // gateway sits in: the public block your organization numbers its internal + // network from, which lets /login reach a gateway there. A block must lie + // entirely outside private space, where /login accepts a gateway without this + // key. /login accepts a gateway inside a listed block over a direct connection + // only, and only when this machine's own address on that connection is inside the + // same block, so /login must happen from a machine whose own address is inside + // the block (not through a proxy, VPN pool, container or NAT segment outside it). + // A bar against copied settings files, not proof of location. Honored only from + // admin-controlled managed settings (MDM / managed-settings.json / policy + // helper); ignored in user, project, and remote-delivered settings. + GatewayInternalNetworks []string `json:"gatewayInternalNetworks,omitempty,omitzero"` + + // Command to refresh GCP authentication (e.g., gcloud auth application-default + // login) + GcpAuthRefresh *string `json:"gcpAuthRefresh,omitempty,omitzero"` + + // Custom commands to run before/after tool executions + Hooks AnthropicAgentSettingsHooks `json:"hooks,omitempty,omitzero"` + + // Allowlist of environment variable names HTTP hooks may interpolate into + // headers. When set, each hook's effective allowedEnvVars is the intersection + // with this list. If undefined, no restriction is applied. Arrays merge across + // settings sources (same semantics as allowedMcpServers). + HttpHookAllowedEnvVars []string `json:"httpHookAllowedEnvVars,omitempty,omitzero"` + + // Deprecated: Use attribution instead. Whether to include Claude's co-authored by + // attribution in commits and PRs (defaults to true) + IncludeCoAuthoredBy *bool `json:"includeCoAuthoredBy,omitempty,omitzero"` + + // Include built-in commit and PR workflow instructions in Claude's system prompt + // (default: true) + IncludeGitInstructions *bool `json:"includeGitInstructions,omitempty,omitzero"` + + // Push to mobile when a permission prompt or question is waiting + InputNeededNotifEnabled *bool `json:"inputNeededNotifEnabled,omitempty,omitzero"` + + // Require explicit approval before SendMessage can reach a peer session on + // another machine via Remote Control + IsolatePeerMachines *bool `json:"isolatePeerMachines,omitempty,omitzero"` + + // Deprecated: no longer has any effect. The prompt's word-editing keys always + // follow Bash (readline) conventions. + KeybindingFlavor *AnthropicAgentSettingsKeybindingFlavor `json:"keybindingFlavor,omitempty,omitzero"` + + // Preferred language for Claude responses and voice dictation (e.g., "japanese", + // "spanish") + Language *string `json:"language,omitempty,omitzero"` + + // MCP servers the organization provides to every user, keyed by server name, each + // with the .mcp.json entry shape; only "http" and "sse" servers are accepted + // (nothing that names a program to run, no ${VAR} references). Honored from + // managed settings only; users cannot remove them, deniedMcpServers still + // applies, and they need no allowedMcpServers entry. Not read in Claude Desktop's + // Code tab on a third-party deployment or in Cowork sessions, where Claude + // Desktop supplies and locks the session's MCP servers itself. + ManagedMcpServers AnthropicAgentSettingsManagedMcpServers `json:"managedMcpServers,omitempty,omitzero"` + + // Controls how the managed settings sources compose. "first-wins" (default): the + // highest-priority source present (server-managed > MDM (managed plist / HKLM) > + // managed-settings.json) is the managed tier alone. "merge": every present source + // deep-merges with fixed precedence server-managed > MDM > managed-settings.json + // — scalars take the highest source's value (a restrictive boolean or enum — the + // allowManaged*Only locks, the disable* switches, the sandbox lock family — takes + // the strictest value any source sets) and arrays union, except fallbackModel, + // the restriction allowlists allowedMcpServers, availableModels, + // strictKnownMarketplaces and allowedChannelPlugins, and + // sandbox.credentials.awsPairs and sandbox.ripgrep (the highest source that sets + // one owns it whole), modelOverrides (the whole map of the highest source that + // sets it, dropped when that source sits below the one that sets + // availableModels), managedMcpServers (server names union; a name set by two + // sources takes the higher source's whole entry), and the keys taken from the + // highest source only: the auth pins forceLoginOrgUUID, forceLoginMethod, + // forceLoginGatewayUrl and gatewayInternalNetworks, the credential helpers + // apiKeyHelper, awsAuthRefresh, awsCredentialExport, gcpAuthRefresh, + // otelHeadersHelper and proxyAuthHelper, modelPicker, permissions.defaultMode, + // parentSettingsBehavior and the policyHelper configuration (env keeps its own + // per-key union). Honored only from the highest-priority source present; enable + // it only when every lower source is admin-controlled, since lower sources then + // contribute entries such as permissions.allow. HKCU and --managed-settings never + // take part in the merge. + ManagedSourcesBehavior *AnthropicAgentSettingsManagedSourcesBehavior `json:"managedSourcesBehavior,omitempty,omitzero"` + + // Maximum effort level. Anything above it (an /effort or /model pick, --effort, + // CLAUDE_CODE_EFFORT_LEVEL, a model default) is clamped to it, on every provider + // including Bedrock, Vertex and Foundry. Combines with an organization's + // per-model effort cap by taking the lower of the two; across settings files the + // lowest value wins, and modelSettings..maxEffortLevel replaces it per + // model. Enforced client-side: an effort supplied through CLAUDE_CODE_EXTRA_BODY + // is not clamped. + MaxEffortLevel *AnthropicAgentSettingsMaxEffortLevel `json:"maxEffortLevel,omitempty,omitzero"` + + // Minimum version to stay on - prevents downgrades when switching to stable + // channel + MinimumVersion *string `json:"minimumVersion,omitempty,omitzero"` + + // Override the default model used by Claude Code + Model *string `json:"model,omitempty,omitzero"` + + // Override mapping from Anthropic model ID (e.g. "claude-opus-4-6") to + // provider-specific model ID (e.g. a Bedrock inference profile ARN). Typically + // set in managed settings by enterprise administrators. + ModelOverrides AnthropicAgentSettingsModelOverrides `json:"modelOverrides,omitempty,omitzero"` + + // Curate the /model picker: an ordered list of models with your own labels, + // independent of the built-in lineup and of Claude Code releases. availableModels + // still applies to these rows. Honored from managed, --settings/SDK, and user + // settings only (not from a project checkout); the highest-precedence of those + // that defines modelPicker wins outright (no merging across sources). Typically + // set in managed settings by enterprise administrators. + ModelPicker *AnthropicAgentSettingsModelPicker `json:"modelPicker,omitempty,omitzero"` + + // Price usage at your organization's contracted rates instead of list price. + // Affects every spend figure Claude Code reports — /cost, the status line, the + // SDK total_cost_usd, --max-budget-usd, and the OpenTelemetry cost metric and + // events — which remain USD estimates, not an invoice (the per-Mtok price labels + // in /model stay at list). "overrides" maps a model ID to its + // USD-per-million-token rates (input, output, cacheRead, cacheWrite — all four + // required, each 0 to 10000; cacheWrite prices both 5-minute and 1-hour cache + // writes). A matching row is charged exactly as written; fast-mode and + // US-data-residency surcharges are not added on top. A key Claude Code itself + // uses for a built-in model — its ID such as "claude-sonnet-4-6", or its + // first-party, Bedrock (any or no region prefix), Vertex or Foundry ID — covers + // every dated and provider form of that model; any other key — a gateway model + // alias, or a spelling Claude Code does not itself use — matches that model ID + // only (case-insensitive), and such an exact match wins over a built-in row. On + // Bedrock an application inference profile is matched by its backing model. An + // invalid row or multiplier is reported and skipped; the rest still apply. + // "multiplier" in (0, 10] scales every computed cost, overridden or not (0.85 = + // 85% of the price, 1.2 = 120%). Only honored from managed settings + // (server-managed, MDM / OS policy, or managed-settings.json), or — when none of + // those sets it — when supplied by a host application that manages the model + // provider; ignored in user, project, local and --settings sources. + ModelPricing *AnthropicAgentSettingsModelPricing `json:"modelPricing,omitempty,omitzero"` + + // Per-model settings keyed by canonical model name. + ModelSettings AnthropicAgentSettingsModelSettings `json:"modelSettings,omitempty,omitzero"` + + // Path to a script that outputs OpenTelemetry headers + OtelHeadersHelper *string `json:"otelHeadersHelper,omitempty,omitzero"` + + // Controls the output style for assistant responses + OutputStyle *string `json:"outputStyle,omitempty,omitzero"` + + // Controls whether the SDK parent tier (Options.managedSettings / + // --managed-settings) layers under this admin tier. "first-wins" (default): + // parent is dropped — admin tiers are the only policy source. "merge": parent's + // restrictive-only-filtered settings union under the admin winner. Has no effect + // when no admin tier exists (parent applies as the sole policy tier, still + // filtered restrictive-only). + ParentSettingsBehavior *AnthropicAgentSettingsParentSettingsBehavior `json:"parentSettingsBehavior,omitempty,omitzero"` + + // Tool usage permissions configuration + Permissions *AnthropicAgentSettingsPermissions `json:"permissions,omitempty,omitzero"` + + // Custom directory for plan files, relative to project root. If not set, defaults + // to ~/.claude/plans/ + PlansDirectory *string `json:"plansDirectory,omitempty,omitzero"` + + // Per-plugin configuration including MCP server user configs, keyed by plugin ID + // (plugin\@marketplace format) + PluginConfigs AnthropicAgentSettingsPluginConfigs `json:"pluginConfigs,omitempty,omitzero"` + + // Marketplace names whose plugins may surface as contextual install suggestions + // (relevance-based tips). No marketplace-declared suggestions surface without + // this allowlist; the built-in first-party frontend-design tip is unaffected. + // Only honored when set in managed settings (policy scope); the key is ignored in + // user, project, and local settings. A name only takes effect when the + // marketplace is registered on the machine AND its registered source is also + // declared in managed settings, either as the extraKnownMarketplaces entry for + // that name or as an entry of strictKnownMarketplaces. A marketplace registered + // from a different source under an allowlisted name is ignored. The official + // marketplace is exempt from the source requirement: allowlisting its name alone + // suffices, since that name can only register from the official Anthropic source. + PluginSuggestionMarketplaces []string `json:"pluginSuggestionMarketplaces,omitempty,omitzero"` + + // Custom message to append to the plugin trust warning shown before installation. + // Only read from policy settings (managed-settings.json / MDM). Useful for + // enterprise administrators to add organization-specific context (e.g., "All + // plugins from our internal marketplace are vetted and approved."). + PluginTrustMessage *string `json:"pluginTrustMessage,omitempty,omitzero"` + + // Executable that computes managed settings at startup. Honored only from + // admin-controlled policy sources. + PolicyHelper *AnthropicAgentSettingsPolicyHelper `json:"policyHelper,omitempty,omitzero"` + + // URL template for PR links in the footer link badges and inline messages. The + // detected git PR is rendered as the first footer-link badge. Placeholders: + // {host} {owner} {repo} {number} {url}. Example: + // "https://reviews.example.com/{owner}/{repo}/pull/{number}" + PrUrlTemplate *string `json:"prUrlTemplate,omitempty,omitzero"` + + // Precompute the compaction summary in the background before it is needed. Only + // applies when auto-compact is on. + PrecomputeCompactionEnabled *bool `json:"precomputeCompactionEnabled,omitempty,omitzero"` + + // Preferred OS notification channel + PreferredNotifChannel *AnthropicAgentSettingsPreferredNotifChannel `json:"preferredNotifChannel,omitempty,omitzero"` + + // Reduce or disable animations for accessibility (spinner shimmer, flash effects, + // etc.) + PrefersReducedMotion *bool `json:"prefersReducedMotion,omitempty,omitzero"` + + // Managed plugins (plugin\@marketplace ids that managed enabledPlugins sets true) + // whose hooks run first, outermost, in the listed order: the first id listed sees + // every event before any other plugin and every result after it. Managed plugins + // not listed here or in appendPlugins follow the listed ones; user, project and + // marketplace plugins come after those; then appendPlugins; then the built-in + // plugins. The bundled sec-default\@builtin seats itself outermost (on a machine + // with managed settings and for Team and Enterprise organizations) unless this + // list is set, in which case list sec-default\@builtin where it should sit or + // leave it out. Any other id that is not an enabled managed plugin is skipped; an + // id listed in both keys is prepended. Only honored from managed settings (or, on + // a machine with none, from user settings for your own plugins); ignored in + // project, local and --settings sources. + PrependPlugins []string `json:"prependPlugins,omitempty,omitzero"` + + // Corporate launcher argv prefix for the background-agent supervisor, the + // sessions and workers it hosts, and the other covered background processes + // listed in the Claude Code corporate-launcher documentation. Equivalent to the + // CLAUDE_CODE_PROCESS_WRAPPER environment variable, which takes precedence when + // set. Honored from managed settings, a --settings/SDK-supplied settings file, + // and user settings, in that precedence order; project and local settings are + // ignored. + ProcessWrapper *string `json:"processWrapper,omitempty,omitzero"` + + // Prompt cache TTL for the main conversation (interactive, -p and SDK turns, plus + // the helpers that run inline with it): "5m" or "1h". Unset = automatic: 1 hour + // on a Claude subscription within its usage limits, 5 minutes on an API key, + // Bedrock, Vertex or Foundry. 1-hour cache writes are billed at a higher rate; + // the cache stays warm across longer breaks. The CLAUDE_CODE_PROMPT_CACHE_TTL + // environment variable takes precedence. + PromptCacheTtl *AnthropicAgentSettingsPromptCacheTtl `json:"promptCacheTtl,omitempty,omitzero"` + + // When false, prompt suggestions are disabled. When absent or true, prompt + // suggestions are enabled. + PromptSuggestionEnabled *bool `json:"promptSuggestionEnabled,omitempty,omitzero"` + + // Shell command that outputs a Proxy-Authorization header value (EAP) + ProxyAuthHelper *string `json:"proxyAuthHelper,omitempty,omitzero"` + + // Cloud session configuration + Remote *AnthropicAgentSettingsRemote `json:"remote,omitempty,omitzero"` + + // Start Remote Control bridge automatically each session + RemoteControlAtStartup *bool `json:"remoteControlAtStartup,omitempty,omitzero"` + + // Maximum Claude Code version allowed to start. If the running version is newer, + // Claude Code exits at startup with instructions to install an approved version. + // Only enforced from managed (policy) settings. + RequiredMaximumVersion *string `json:"requiredMaximumVersion,omitempty,omitzero"` + + // Minimum Claude Code version required to start. If the running version is older, + // Claude Code exits at startup with instructions to update. Only enforced from + // managed (policy) settings. + RequiredMinimumVersion *string `json:"requiredMinimumVersion,omitempty,omitzero"` + + // Whether file picker should respect .gitignore files (default: true). Note: + // .ignore files are always respected. + RespectGitignore *bool `json:"respectGitignore,omitempty,omitzero"` + + // Whether Claude responds after an input-box ! bash command runs. Set to false to + // add the command output to context without a response. Default: true. + RespondToBashCommands *bool `json:"respondToBashCommands,omitempty,omitzero"` + + // Sandbox configuration. See the linked native reference for semantics and + // availability. + Sandbox *AnthropicAgentSettingsSandbox `json:"sandbox,omitempty,omitzero"` + + // When true, the plan-approval dialog offers a "clear context" option. Defaults + // to false. + ShowClearContextOnPlanAccept *bool `json:"showClearContextOnPlanAccept,omitempty,omitzero"` + + // Stamp each message with its arrival time + ShowMessageTimestamps *bool `json:"showMessageTimestamps,omitempty,omitzero"` + + // Request API-side thinking summaries and show them in the conversation and in + // the transcript view (ctrl+o). Set explicitly to override the default for your + // install. + ShowThinkingSummaries *bool `json:"showThinkingSummaries,omitempty,omitzero"` + + // Show "Cooked for Nm Ns" after each assistant turn + ShowTurnDuration *bool `json:"showTurnDuration,omitempty,omitzero"` + + // Fraction of the context window (in characters) reserved for the skill listing + // sent to Claude (default: 0.01 = 1%). When the listing exceeds this, + // descriptions are shortened to fit. Raise to opt in to higher per-turn context + // cost. + SkillListingBudgetFraction *float64 `json:"skillListingBudgetFraction,omitempty,omitzero"` + + // Per-skill description character cap in the skill listing sent to Claude + // (default: 1536). Descriptions longer than this are truncated. Raise to opt in + // to higher per-turn context cost. + SkillListingMaxDescChars *float64 `json:"skillListingMaxDescChars,omitempty,omitzero"` + + // Per-skill listing overrides keyed by skill name. "name-only" lists the skill + // without its description; "user-invocable-only" hides it from the model but + // keeps /name; "off" hides it from both. Absent = on. + SkillOverrides AnthropicAgentSettingsSkillOverrides `json:"skillOverrides,omitempty,omitzero"` + + // Whether the user has accepted the bypass permissions mode dialog + SkipDangerousModePermissionPrompt *bool `json:"skipDangerousModePermissionPrompt,omitempty,omitzero"` + + // Skip the WebFetch blocklist check for enterprise environments with restrictive + // security policies + SkipWebFetchPreflight *bool `json:"skipWebFetchPreflight,omitempty,omitzero"` + + // Underline misspelled words in the prompt input as you type, using an installed + // aspell, hunspell or ispell (off unless "enabled" is true; does nothing if none + // is installed). Read from user, flag and managed settings only (the whole block + // from the highest-precedence of those applies); ignored in project + // .claude/settings.json and .claude/settings.local.json. + Spellcheck *AnthropicAgentSettingsSpellcheck `json:"spellcheck,omitempty,omitzero"` + + // Whether to show tips in the spinner + SpinnerTipsEnabled *bool `json:"spinnerTipsEnabled,omitempty,omitzero"` + + // Add your organization's own tips to the spinner tip rotation. tips: strings or + // {id, text, cooldownSessions?, priority?} objects; tipsFile: a JSON file of the + // same; label: prefix shown before your tips; excludeDefault: if true, only show + // your tips (default: false). + SpinnerTipsOverride *AnthropicAgentSettingsSpinnerTipsOverride `json:"spinnerTipsOverride,omitempty,omitzero"` + + // Customize spinner verbs. mode: "append" adds verbs to defaults, "replace" uses + // only your verbs. + SpinnerVerbs *AnthropicAgentSettingsSpinnerVerbs `json:"spinnerVerbs,omitempty,omitzero"` + + // SSH connection configurations for remote environments. Typically set in managed + // settings by enterprise administrators to pre-configure SSH connections for team + // members. + SshConfigs []AnthropicAgentSettingsSshConfigsElem `json:"sshConfigs,omitempty,omitzero"` + + // Custom status line display configuration + StatusLine *AnthropicAgentSettingsStatusLine `json:"statusLine,omitempty,omitzero"` + + // Enterprise strict list of allowed marketplace sources. When set in managed + // settings, ONLY these sources can be added as marketplaces. Entries match + // exactly, except that a github entry may use the owner-wildcard form + // {"source":"github","repo":"owner/*"} to allow every repository under that + // owner. The check happens BEFORE downloading, so blocked sources never touch the + // filesystem. Note: this is a policy gate only — it does NOT register + // marketplaces. To pre-register allowed marketplaces for users, also set + // extraKnownMarketplaces. + StrictKnownMarketplaces []json.RawMessage `json:"strictKnownMarketplaces,omitempty,omitzero"` + + // When set in managed settings, blocks non-plugin customization sources for the + // listed surfaces. Array form locks specific surfaces (e.g. ["skills", "hooks"]); + // `true` locks all four; `false` is an explicit no-op. Blocked: + // ~/.claude/{surface}/, .claude/{surface}/ (project), settings.json hooks, + // .mcp.json. NOT blocked: managed (policySettings) sources, plugin-provided + // customizations. Composes with strictKnownMarketplaces for end-to-end admin + // control — plugins gated by marketplace allowlist, everything else blocked here. + StrictPluginOnlyCustomization *json.RawMessage `json:"strictPluginOnlyCustomization,omitempty,omitzero"` + + // Prompt cache TTL for everything outside the main conversation — subagents, + // workflows, background and helper requests: "5m" or "1h". Unset = automatic (5 + // minutes unless ENABLE_PROMPT_CACHING_1H=1). The + // CLAUDE_CODE_SUBAGENT_PROMPT_CACHE_TTL environment variable takes precedence. + SubagentPromptCacheTtl *AnthropicAgentSettingsSubagentPromptCacheTtl `json:"subagentPromptCacheTtl,omitempty,omitzero"` + + // Custom per-subagent status line shown in the agent panel; receives row context + // as JSON on stdin + SubagentStatusLine *AnthropicAgentSettingsSubagentStatusLine `json:"subagentStatusLine,omitempty,omitzero"` + + // When safeguards flag a message, automatically switch to a different model to + // keep chatting. When off, your session will pause instead. + SwitchModelsOnFlag *bool `json:"switchModelsOnFlag,omitempty,omitzero"` + + // Set to false to turn off syncing of the plugins you have enabled on claude.ai. + // In your user settings (or managed settings): nothing more is downloaded, + // previously synced plugins (~/.claude/plugins/synced) are hidden from every + // session started afterwards and moved to ~/.claude/plugins/.trash at the next + // launch (deleted after cleanupPeriodDays; re-downloaded, not restored, if you + // re-enable). In .claude/settings.local.json or --settings: downloads stop and + // synced plugins are hidden for sessions in that workspace or invocation only + // (nothing is moved). Not read from project settings (.claude/settings.json). + // Only false is honored — the feature is enabled server-side for your account, so + // setting true does not turn it on early. While it is on, synced plugins load in + // every session like plugins you installed yourself (a plugin you installed with + // the same name takes precedence), are re-synced at each launch, and are removed + // when you disable them on claude.ai. Only applies when signed in with your + // Claude account. + SyncClaudeAiPlugins *bool `json:"syncClaudeAiPlugins,omitempty,omitzero"` + + // Set to false to turn off syncing of the skills you have enabled on claude.ai. + // In your user settings (or managed settings): nothing more is downloaded, + // previously synced skills (~/.claude/skills/synced) can no longer be run, are + // hidden from every session started afterwards, and are moved to + // ~/.claude/skills/.trash at the next launch (deleted after cleanupPeriodDays; + // re-downloaded, not restored, if you re-enable). In .claude/settings.local.json + // or --settings: downloads stop and synced skills are blocked and hidden for + // sessions in that workspace or invocation only (nothing is moved). Not read from + // project settings (.claude/settings.json). Only false is honored — the feature + // is enabled server-side for your account, so setting true does not turn it on + // early. While it is on, synced skills are available in every session, re-synced + // every 10 minutes, and removed when you disable them on claude.ai. Only applies + // when signed in with your Claude account. + SyncClaudeAiSkills *bool `json:"syncClaudeAiSkills,omitempty,omitzero"` + + // Whether to disable syntax highlighting in diffs + SyntaxHighlightingDisabled *bool `json:"syntaxHighlightingDisabled,omitempty,omitzero"` + + // Deprecated: no longer has any effect (the TaskOutput tool was removed). Read a + // background task's output file with the Read tool instead. + TaskOutputMaxChars *float64 `json:"taskOutputMaxChars,omitempty,omitzero"` + + // How spawned teammates execute (tmux, iterm2, in-process, auto) + TeammateMode *AnthropicAgentSettingsTeammateMode `json:"teammateMode,omitempty,omitzero"` + + // Emit OSC 9;4 progress sequences during long operations + TerminalProgressBarEnabled *bool `json:"terminalProgressBarEnabled,omitempty,omitzero"` + + // Whether /rename updates the terminal tab title (defaults to true). Set to false + // to keep auto-generated topic titles. + TerminalTitleFromRename *bool `json:"terminalTitleFromRename,omitempty,omitzero"` + + // Color theme for the UI + Theme *string `json:"theme,omitempty,omitzero"` + + // Clock format for times shown in the UI: "auto" (default, follows the locale), + // "12-hour", "24-hour", "24-hour-utc" ("18:05Z"), or a strftime pattern such as + // "%H:%M" (any value containing "%"; other values read as "auto"). A pattern + // replaces the time everywhere; message timestamps show only the pattern, so + // include %Y-%m-%d for the date. /config offers the presets; a pattern is set + // here. + TimeFormat *string `json:"timeFormat,omitempty,omitzero"` + + // IANA time zone for times shown in the UI, e.g. "UTC" or "Europe/Dublin". + // Default: the system time zone. An unknown name falls back to the system time + // zone. + TimeZone *string `json:"timeZone,omitempty,omitzero"` + + // Enable the todo / task tracking panel + TodoFeatureEnabled *bool `json:"todoFeatureEnabled,omitempty,omitzero"` + + // Terminal UI renderer. "fullscreen" uses the flicker-free alt-screen renderer + // with virtualized scrollback (equivalent to CLAUDE_CODE_NO_FLICKER=1). "default" + // uses the classic main-screen renderer. + Tui *AnthropicAgentSettingsTui `json:"tui,omitempty,omitzero"` + + // Enable ultracode for the session: xhigh effort plus standing dynamic-workflow + // orchestration. Session-scoped — typically provided via --settings or the + // apply_flag_settings control request; interactive toggles never persist it. + // Requires workflows to be enabled and an xhigh-capable model. + Ultracode *bool `json:"ultracode,omitempty,omitzero"` + + // Show full tool output instead of truncated summaries + Verbose *bool `json:"verbose,omitempty,omitzero"` + + // Default transcript view mode on startup + ViewMode *AnthropicAgentSettingsViewMode `json:"viewMode,omitempty,omitzero"` + + // Vim INSERT-mode key-sequence remaps, e.g. {"jj": ""}. Each key is exactly + // two printable characters typed in sequence; "" (return to NORMAL mode) is + // the only supported target. Applies when editorMode is "vim". + VimInsertModeRemaps AnthropicAgentSettingsVimInsertModeRemaps `json:"vimInsertModeRemaps,omitempty,omitzero"` + + // Voice mode settings (hold-to-talk / tap-to-toggle dictation) + Voice *AnthropicAgentSettingsVoice `json:"voice,omitempty,omitzero"` + + // Enable voice mode (hold-to-talk dictation) + VoiceEnabled *bool `json:"voiceEnabled,omitempty,omitzero"` + + // Ramp mouse-wheel scroll speed during fast scrolls (fullscreen mode only) + WheelScrollAccelerationEnabled *bool `json:"wheelScrollAccelerationEnabled,omitempty,omitzero"` + + // Enable the "ultracode" keyword trigger: including the keyword in a prompt opts + // that turn into the Workflow tool. Set to false to disable the trigger. Default: + // true. + WorkflowKeywordTriggerEnabled *bool `json:"workflowKeywordTriggerEnabled,omitempty,omitzero"` + + // Advisory size guideline for the dynamic workflows Claude writes: "small" aims + // for fewer than 5 agents, "medium" fewer than 10, "large" fewer than 50, and + // "unrestricted" sends no guideline. Unset defaults to "medium", or "small" on + // Pro plans. A value here — including from managed settings — takes precedence + // over the "Dynamic workflow size" choice in /config, and that /config row is + // hidden while a settings file provides the key. This is a guideline, not an + // enforced limit. + WorkflowSizeGuideline *AnthropicAgentSettingsWorkflowSizeGuideline `json:"workflowSizeGuideline,omitempty,omitzero"` + + // Git worktree configuration: the CLI --worktree flag, EnterWorktree and agent + // isolation, plus the location Claude Code Desktop uses for SSH-session worktrees + // on this machine. + Worktree *AnthropicAgentSettingsWorktree `json:"worktree,omitempty,omitzero"` + + // When set to true in either admin-only Windows source — the HKLM + // SOFTWARE/Policies/ClaudeCode registry key or C:/Program + // Files/ClaudeCode/managed-settings.json — WSL reads managed settings from the + // full Windows policy chain (HKLM, C:/Program Files/ClaudeCode via DrvFs, HKCU) + // in addition to /etc/claude-code. Windows sources take priority. The flag is + // also required in HKCU itself for HKCU policy to apply on WSL (double opt-in: + // admin enables the chain, user confirms HKCU). On native Windows the flag has no + // effect. + WslInheritsWindowsSettings *bool `json:"wslInheritsWindowsSettings,omitempty,omitzero"` + + AdditionalProperties interface{} `mapstructure:",remain"` +} + +// Alias for extraKnownMarketplaces: this key is read exactly as if it were spelled +// extraKnownMarketplaces. Do not set both in one file — if both appear, this key +// is ignored with a warning. Claude Code may rewrite this key as +// extraKnownMarketplaces when it updates the file. Clients older than this alias +// ignore it, so prefer extraKnownMarketplaces while older Claude Code versions +// still share the same settings. +type AnthropicAgentSettingsAdditionalMarketplaces map[string]struct { + // Whether to automatically update this marketplace and its installed plugins on + // startup + AutoUpdate *bool `json:"autoUpdate,omitempty,omitzero"` + + // Local cache path where marketplace manifest is stored (auto-generated if not + // provided) + InstallLocation *string `json:"installLocation,omitempty,omitzero"` + + // Where to fetch the marketplace from + Source json.RawMessage `json:"source"` +} + +// Allowed Channel Plugins value configuration. See the linked native reference for +// semantics and availability. +type AnthropicAgentSettingsAllowedChannelPluginsElem struct { + // Marketplace configuration. See the linked native reference for semantics and + // availability. + Marketplace string `json:"marketplace"` + + // Plugin configuration. See the linked native reference for semantics and + // availability. + Plugin string `json:"plugin"` +} + +// Allowed MCP Servers value configuration. See the linked native reference for +// semantics and availability. +type AnthropicAgentSettingsAllowedMcpServersElem struct { + // Command array [command, ...args] to match exactly for allowed stdio servers + // + // \@minItems 1 + ServerCommand []string `json:"serverCommand,omitempty,omitzero"` + + // Name of the MCP server that users are allowed to configure + ServerName *string `json:"serverName,omitempty,omitzero"` + + // URL pattern with wildcard support (e.g., "https://*.example.com/*") for allowed + // remote MCP servers + ServerUrl *string `json:"serverUrl,omitempty,omitzero"` +} + +type AnthropicAgentSettingsAskUserQuestionTimeout string + +const AnthropicAgentSettingsAskUserQuestionTimeoutA10M AnthropicAgentSettingsAskUserQuestionTimeout = "10m" +const AnthropicAgentSettingsAskUserQuestionTimeoutA5M AnthropicAgentSettingsAskUserQuestionTimeout = "5m" +const AnthropicAgentSettingsAskUserQuestionTimeoutA60S AnthropicAgentSettingsAskUserQuestionTimeout = "60s" +const AnthropicAgentSettingsAskUserQuestionTimeoutNever AnthropicAgentSettingsAskUserQuestionTimeout = "never" + +// Customize attribution text for commits and PRs. Each field defaults to the +// standard Claude Code attribution if not set. +type AnthropicAgentSettingsAttribution struct { + // Attribution text for git commits, including any trailers. Empty string hides + // attribution. + Commit *string `json:"commit,omitempty,omitzero"` + + // Attribution text for pull request descriptions. Empty string hides attribution. + Pr *string `json:"pr,omitempty,omitzero"` + + // Whether to append the claude.ai session link to commits and PRs created from + // web or Remote Control sessions (default: true). Set to false to omit the + // Claude-Session trailer and PR-body link. + SessionUrl *bool `json:"sessionUrl,omitempty,omitzero"` + + AdditionalProperties interface{} `mapstructure:",remain"` +} + +type AnthropicAgentSettingsAutoUpdatesChannel string + +const AnthropicAgentSettingsAutoUpdatesChannelLatest AnthropicAgentSettingsAutoUpdatesChannel = "latest" +const AnthropicAgentSettingsAutoUpdatesChannelRc AnthropicAgentSettingsAutoUpdatesChannel = "rc" +const AnthropicAgentSettingsAutoUpdatesChannelStable AnthropicAgentSettingsAutoUpdatesChannel = "stable" + +type AnthropicAgentSettingsCrossSessionInbound string + +const AnthropicAgentSettingsCrossSessionInboundAccept AnthropicAgentSettingsCrossSessionInbound = "accept" +const AnthropicAgentSettingsCrossSessionInboundHold AnthropicAgentSettingsCrossSessionInbound = "hold" +const AnthropicAgentSettingsCrossSessionInboundRefuse AnthropicAgentSettingsCrossSessionInbound = "refuse" + +type AnthropicAgentSettingsDaemonColdStart string + +const AnthropicAgentSettingsDaemonColdStartAsk AnthropicAgentSettingsDaemonColdStart = "ask" +const AnthropicAgentSettingsDaemonColdStartTransient AnthropicAgentSettingsDaemonColdStart = "transient" + +type AnthropicAgentSettingsDefaultShell string + +const AnthropicAgentSettingsDefaultShellBash AnthropicAgentSettingsDefaultShell = "bash" +const AnthropicAgentSettingsDefaultShellPowershell AnthropicAgentSettingsDefaultShell = "powershell" + +type AnthropicAgentSettingsDefaultView string + +const AnthropicAgentSettingsDefaultViewChat AnthropicAgentSettingsDefaultView = "chat" +const AnthropicAgentSettingsDefaultViewTranscript AnthropicAgentSettingsDefaultView = "transcript" + +// Denied MCP Servers value configuration. See the linked native reference for +// semantics and availability. +type AnthropicAgentSettingsDeniedMcpServersElem struct { + // Command array [command, ...args] to match exactly for blocked stdio servers + // + // \@minItems 1 + ServerCommand []string `json:"serverCommand,omitempty,omitzero"` + + // Name of the MCP server that is explicitly blocked + ServerName *string `json:"serverName,omitempty,omitzero"` + + // URL pattern with wildcard support (e.g., "https://*.example.com/*") for blocked + // remote MCP servers + ServerUrl *string `json:"serverUrl,omitempty,omitzero"` +} + +type AnthropicAgentSettingsDialogExpiry string + +const AnthropicAgentSettingsDialogExpiryA10M AnthropicAgentSettingsDialogExpiry = "10m" +const AnthropicAgentSettingsDialogExpiryA5M AnthropicAgentSettingsDialogExpiry = "5m" +const AnthropicAgentSettingsDialogExpiryA60S AnthropicAgentSettingsDialogExpiry = "60s" +const AnthropicAgentSettingsDialogExpiryNever AnthropicAgentSettingsDialogExpiry = "never" + +type AnthropicAgentSettingsEditorMode string + +const AnthropicAgentSettingsEditorModeNormal AnthropicAgentSettingsEditorMode = "normal" +const AnthropicAgentSettingsEditorModeVim AnthropicAgentSettingsEditorMode = "vim" + +type AnthropicAgentSettingsEffortLevel string + +const AnthropicAgentSettingsEffortLevelHigh AnthropicAgentSettingsEffortLevel = "high" +const AnthropicAgentSettingsEffortLevelLow AnthropicAgentSettingsEffortLevel = "low" +const AnthropicAgentSettingsEffortLevelMedium AnthropicAgentSettingsEffortLevel = "medium" +const AnthropicAgentSettingsEffortLevelXhigh AnthropicAgentSettingsEffortLevel = "xhigh" + +// Enabled plugins using plugin-id\@marketplace-id format. Example: { +// "formatter\@anthropic-tools": true }. Also supports extended format with version +// constraints. Settings precedence is user < project < local < flag < policy, so +// to disable a plugin that project settings enable, set it to false in +// .claude/settings.local.json — setting false in ~/.claude/settings.json is +// overridden by the project. +type AnthropicAgentSettingsEnabledPlugins map[string]json.RawMessage + +// Environment variables to set for Claude Code sessions +type AnthropicAgentSettingsEnv map[string]string + +// Additional marketplaces to make available for this repository. Typically used in +// repository .claude/settings.json to ensure team members have required plugin +// sources. +type AnthropicAgentSettingsExtraKnownMarketplaces map[string]struct { + // Whether to automatically update this marketplace and its installed plugins on + // startup + AutoUpdate *bool `json:"autoUpdate,omitempty,omitzero"` + + // Local cache path where marketplace manifest is stored (auto-generated if not + // provided) + InstallLocation *string `json:"installLocation,omitempty,omitzero"` + + // Where to fetch the marketplace from + Source json.RawMessage `json:"source"` +} + +type AnthropicAgentSettingsFeedbackDrafts string + +const AnthropicAgentSettingsFeedbackDraftsNotify AnthropicAgentSettingsFeedbackDrafts = "notify" +const AnthropicAgentSettingsFeedbackDraftsOff AnthropicAgentSettingsFeedbackDrafts = "off" +const AnthropicAgentSettingsFeedbackDraftsQuiet AnthropicAgentSettingsFeedbackDrafts = "quiet" + +// Custom file suggestion configuration for \@ mentions +type AnthropicAgentSettingsFileSuggestion struct { + // Command configuration. See the linked native reference for semantics and + // availability. + Command string `json:"command"` + + // Type configuration. See the linked native reference for semantics and + // availability. + Type string `json:"type"` +} + +type AnthropicAgentSettingsForceLoginMethod string + +const AnthropicAgentSettingsForceLoginMethodClaudeai AnthropicAgentSettingsForceLoginMethod = "claudeai" +const AnthropicAgentSettingsForceLoginMethodConsole AnthropicAgentSettingsForceLoginMethod = "console" +const AnthropicAgentSettingsForceLoginMethodGateway AnthropicAgentSettingsForceLoginMethod = "gateway" + +// Custom commands to run before/after tool executions +type AnthropicAgentSettingsHooks map[string][]struct { + // List of hooks to execute when the matcher matches + Hooks []json.RawMessage `json:"hooks"` + + // String pattern to match (e.g. tool names like "Write") + Matcher *string `json:"matcher,omitempty,omitzero"` +} + +type AnthropicAgentSettingsKeybindingFlavor string + +const AnthropicAgentSettingsKeybindingFlavorClassic AnthropicAgentSettingsKeybindingFlavor = "classic" +const AnthropicAgentSettingsKeybindingFlavorReadline AnthropicAgentSettingsKeybindingFlavor = "readline" + +// MCP servers the organization provides to every user, keyed by server name, each +// with the .mcp.json entry shape; only "http" and "sse" servers are accepted +// (nothing that names a program to run, no ${VAR} references). Honored from +// managed settings only; users cannot remove them, deniedMcpServers still applies, +// and they need no allowedMcpServers entry. Not read in Claude Desktop's Code tab +// on a third-party deployment or in Cowork sessions, where Claude Desktop supplies +// and locks the session's MCP servers itself. +type AnthropicAgentSettingsManagedMcpServers map[string]map[string]interface{} + +type AnthropicAgentSettingsManagedSourcesBehavior string + +const AnthropicAgentSettingsManagedSourcesBehaviorFirstWins AnthropicAgentSettingsManagedSourcesBehavior = "first-wins" +const AnthropicAgentSettingsManagedSourcesBehaviorMerge AnthropicAgentSettingsManagedSourcesBehavior = "merge" + +type AnthropicAgentSettingsMaxEffortLevel string + +const AnthropicAgentSettingsMaxEffortLevelHigh AnthropicAgentSettingsMaxEffortLevel = "high" +const AnthropicAgentSettingsMaxEffortLevelLow AnthropicAgentSettingsMaxEffortLevel = "low" +const AnthropicAgentSettingsMaxEffortLevelMax AnthropicAgentSettingsMaxEffortLevel = "max" +const AnthropicAgentSettingsMaxEffortLevelMedium AnthropicAgentSettingsMaxEffortLevel = "medium" +const AnthropicAgentSettingsMaxEffortLevelXhigh AnthropicAgentSettingsMaxEffortLevel = "xhigh" + +// Override mapping from Anthropic model ID (e.g. "claude-opus-4-6") to +// provider-specific model ID (e.g. a Bedrock inference profile ARN). Typically set +// in managed settings by enterprise administrators. +type AnthropicAgentSettingsModelOverrides map[string]string + +// Curate the /model picker: an ordered list of models with your own labels, +// independent of the built-in lineup and of Claude Code releases. availableModels +// still applies to these rows. Honored from managed, --settings/SDK, and user +// settings only (not from a project checkout); the highest-precedence of those +// that defines modelPicker wins outright (no merging across sources). Typically +// set in managed settings by enterprise administrators. +type AnthropicAgentSettingsModelPicker struct { + // Rows to show in the /model picker, in order. + Options []AnthropicAgentSettingsModelPickerOptionsElem `json:"options"` + + // When true, the picker shows only the Default row and these options — the + // built-in lineup, gateway-discovered models and ANTHROPIC_CUSTOM_MODEL_OPTION + // are hidden. When false or unset, these options are added after the built-in + // lineup. + ReplaceBuiltInOptions *bool `json:"replaceBuiltInOptions,omitempty,omitzero"` +} + +// Options value configuration. See the linked native reference for semantics and +// availability. +type AnthropicAgentSettingsModelPickerOptionsElem struct { + // For a model this version of Claude Code does not know: the ID of a model it + // does know (e.g. "claude-opus-4-8") whose client-side handling — prompt profile, + // capability and effort defaults — applies to it. Changes neither the row's label + // nor the model ID sent. Without it, a model-catalog row for a model this version + // does not know is not offered until Claude Code is updated. + BehavesAs *string `json:"behavesAs,omitempty,omitzero"` + + // Row subtitle. Defaults to a generic description. + Description *string `json:"description,omitempty,omitzero"` + + // Row title. Defaults to the model name. + Label *string `json:"label,omitempty,omitzero"` + + // Model to select, taken verbatim: an alias ("opus"), an Anthropic model ID, or a + // provider-format ID (Vertex, Bedrock, gateway). Same values --model accepts. + Model string `json:"model"` +} + +// Price usage at your organization's contracted rates instead of list price. +// Affects every spend figure Claude Code reports — /cost, the status line, the SDK +// total_cost_usd, --max-budget-usd, and the OpenTelemetry cost metric and events — +// which remain USD estimates, not an invoice (the per-Mtok price labels in /model +// stay at list). "overrides" maps a model ID to its USD-per-million-token rates +// (input, output, cacheRead, cacheWrite — all four required, each 0 to 10000; +// cacheWrite prices both 5-minute and 1-hour cache writes). A matching row is +// charged exactly as written; fast-mode and US-data-residency surcharges are not +// added on top. A key Claude Code itself uses for a built-in model — its ID such +// as "claude-sonnet-4-6", or its first-party, Bedrock (any or no region prefix), +// Vertex or Foundry ID — covers every dated and provider form of that model; any +// other key — a gateway model alias, or a spelling Claude Code does not itself use +// — matches that model ID only (case-insensitive), and such an exact match wins +// over a built-in row. On Bedrock an application inference profile is matched by +// its backing model. An invalid row or multiplier is reported and skipped; the +// rest still apply. "multiplier" in (0, 10] scales every computed cost, overridden +// or not (0.85 = 85% of the price, 1.2 = 120%). Only honored from managed settings +// (server-managed, MDM / OS policy, or managed-settings.json), or — when none of +// those sets it — when supplied by a host application that manages the model +// provider; ignored in user, project, local and --settings sources. +type AnthropicAgentSettingsModelPricing struct { + // Multiplier configuration. See the linked native reference for semantics and + // availability. + Multiplier *float64 `json:"multiplier,omitempty,omitzero"` + + // Overrides configuration. See the linked native reference for semantics and + // availability. + Overrides AnthropicAgentSettingsModelPricingOverrides `json:"overrides,omitempty,omitzero"` +} + +// Overrides configuration. See the linked native reference for semantics and +// availability. +type AnthropicAgentSettingsModelPricingOverrides map[string]struct { + // Cache Read configuration. See the linked native reference for semantics and + // availability. + CacheRead float64 `json:"cacheRead"` + + // Cache Write configuration. See the linked native reference for semantics and + // availability. + CacheWrite float64 `json:"cacheWrite"` + + // Input configuration. See the linked native reference for semantics and + // availability. + Input float64 `json:"input"` + + // Output configuration. See the linked native reference for semantics and + // availability. + Output float64 `json:"output"` +} + +// Per-model settings keyed by canonical model name. +type AnthropicAgentSettingsModelSettings map[string]struct { + // Persisted effort level for this model. + EffortLevel *AnthropicAgentSettingsModelSettingsValueEffortLevel `json:"effortLevel,omitempty,omitzero"` + + // Maximum effort level for this model. Within one settings file it replaces the + // top-level maxEffortLevel for the model ("max" exempts it); across settings + // files the lowest applicable value wins. Keyed like effortLevel: the canonical + // model name also matches its dated, [1m], Bedrock and Vertex spellings. + MaxEffortLevel *AnthropicAgentSettingsModelSettingsValueMaxEffortLevel `json:"maxEffortLevel,omitempty,omitzero"` + + AdditionalProperties interface{} `mapstructure:",remain"` +} + +type AnthropicAgentSettingsModelSettingsValueEffortLevel string + +const AnthropicAgentSettingsModelSettingsValueEffortLevelHigh AnthropicAgentSettingsModelSettingsValueEffortLevel = "high" +const AnthropicAgentSettingsModelSettingsValueEffortLevelLow AnthropicAgentSettingsModelSettingsValueEffortLevel = "low" +const AnthropicAgentSettingsModelSettingsValueEffortLevelMedium AnthropicAgentSettingsModelSettingsValueEffortLevel = "medium" +const AnthropicAgentSettingsModelSettingsValueEffortLevelXhigh AnthropicAgentSettingsModelSettingsValueEffortLevel = "xhigh" + +type AnthropicAgentSettingsModelSettingsValueMaxEffortLevel string + +const AnthropicAgentSettingsModelSettingsValueMaxEffortLevelHigh AnthropicAgentSettingsModelSettingsValueMaxEffortLevel = "high" +const AnthropicAgentSettingsModelSettingsValueMaxEffortLevelLow AnthropicAgentSettingsModelSettingsValueMaxEffortLevel = "low" +const AnthropicAgentSettingsModelSettingsValueMaxEffortLevelMax AnthropicAgentSettingsModelSettingsValueMaxEffortLevel = "max" +const AnthropicAgentSettingsModelSettingsValueMaxEffortLevelMedium AnthropicAgentSettingsModelSettingsValueMaxEffortLevel = "medium" +const AnthropicAgentSettingsModelSettingsValueMaxEffortLevelXhigh AnthropicAgentSettingsModelSettingsValueMaxEffortLevel = "xhigh" + +type AnthropicAgentSettingsParentSettingsBehavior string + +const AnthropicAgentSettingsParentSettingsBehaviorFirstWins AnthropicAgentSettingsParentSettingsBehavior = "first-wins" +const AnthropicAgentSettingsParentSettingsBehaviorMerge AnthropicAgentSettingsParentSettingsBehavior = "merge" + +// Tool usage permissions configuration +type AnthropicAgentSettingsPermissions struct { + // Additional directories to include in the permission scope + AdditionalDirectories []string `json:"additionalDirectories,omitempty,omitzero"` + + // List of permission rules for allowed operations + Allow []string `json:"allow,omitempty,omitzero"` + + // List of permission rules that should always prompt for confirmation + Ask []string `json:"ask,omitempty,omitzero"` + + // Refuse file-tool reads (Read, Grep, Glob, LSP) outside the working directories + // in every permission mode; true in any settings source wins. Also set when the + // user picks "block" on the one-time auto-mode prompt for a read outside the + // working directories. + BlockReadsOutsideWorkingDirectories *bool `json:"blockReadsOutsideWorkingDirectories,omitempty,omitzero"` + + // Default permission mode when Claude Code needs access ('manual' is accepted as + // an alias for 'default') + DefaultMode *AnthropicAgentSettingsPermissionsDefaultMode `json:"defaultMode,omitempty,omitzero"` + + // List of permission rules for denied operations + Deny []string `json:"deny,omitempty,omitzero"` + + // Disable the ability to bypass permission prompts + DisableBypassPermissionsMode *string `json:"disableBypassPermissionsMode,omitempty,omitzero"` + + AdditionalProperties interface{} `mapstructure:",remain"` +} + +type AnthropicAgentSettingsPermissionsDefaultMode string + +const AnthropicAgentSettingsPermissionsDefaultModeAcceptEdits AnthropicAgentSettingsPermissionsDefaultMode = "acceptEdits" +const AnthropicAgentSettingsPermissionsDefaultModeAuto AnthropicAgentSettingsPermissionsDefaultMode = "auto" +const AnthropicAgentSettingsPermissionsDefaultModeBypassPermissions AnthropicAgentSettingsPermissionsDefaultMode = "bypassPermissions" +const AnthropicAgentSettingsPermissionsDefaultModeDefault AnthropicAgentSettingsPermissionsDefaultMode = "default" +const AnthropicAgentSettingsPermissionsDefaultModeDontAsk AnthropicAgentSettingsPermissionsDefaultMode = "dontAsk" +const AnthropicAgentSettingsPermissionsDefaultModePlan AnthropicAgentSettingsPermissionsDefaultMode = "plan" + +// Per-plugin configuration including MCP server user configs, keyed by plugin ID +// (plugin\@marketplace format) +type AnthropicAgentSettingsPluginConfigs map[string]json.RawMessage + +// Executable that computes managed settings at startup. Honored only from +// admin-controlled policy sources. +type AnthropicAgentSettingsPolicyHelper struct { + // Absolute path to the helper executable + Path string `json:"path"` + + // Refresh Interval Ms configuration. See the linked native reference for + // semantics and availability. + RefreshIntervalMs *json.RawMessage `json:"refreshIntervalMs,omitempty,omitzero"` + + // Timeout Ms configuration. See the linked native reference for semantics and + // availability. + TimeoutMs *float64 `json:"timeoutMs,omitempty,omitzero"` +} + +type AnthropicAgentSettingsPreferredNotifChannel string + +const AnthropicAgentSettingsPreferredNotifChannelAuto AnthropicAgentSettingsPreferredNotifChannel = "auto" +const AnthropicAgentSettingsPreferredNotifChannelGhostty AnthropicAgentSettingsPreferredNotifChannel = "ghostty" +const AnthropicAgentSettingsPreferredNotifChannelIterm2 AnthropicAgentSettingsPreferredNotifChannel = "iterm2" +const AnthropicAgentSettingsPreferredNotifChannelIterm2WithBell AnthropicAgentSettingsPreferredNotifChannel = "iterm2_with_bell" +const AnthropicAgentSettingsPreferredNotifChannelKitty AnthropicAgentSettingsPreferredNotifChannel = "kitty" +const AnthropicAgentSettingsPreferredNotifChannelNotificationsDisabled AnthropicAgentSettingsPreferredNotifChannel = "notifications_disabled" +const AnthropicAgentSettingsPreferredNotifChannelTerminalBell AnthropicAgentSettingsPreferredNotifChannel = "terminal_bell" + +type AnthropicAgentSettingsPromptCacheTtl string + +const AnthropicAgentSettingsPromptCacheTtlA1H AnthropicAgentSettingsPromptCacheTtl = "1h" +const AnthropicAgentSettingsPromptCacheTtlA5M AnthropicAgentSettingsPromptCacheTtl = "5m" + +// Cloud session configuration +type AnthropicAgentSettingsRemote struct { + // Default environment ID to use for cloud sessions + DefaultEnvironmentId *string `json:"defaultEnvironmentId,omitempty,omitzero"` +} + +// Sandbox configuration. See the linked native reference for semantics and +// availability. +type AnthropicAgentSettingsSandbox struct { + // macOS only: Allow sandboxed commands to send Apple Events (and look up the + // appleeventsd Mach service). Needed for `open`, `osascript`, and browser-based + // auth flows that open URLs. **Removes code-execution isolation** — sandboxed + // commands can launch other applications unsandboxed with no user prompt, and can + // script running apps (e.g. Terminal) subject to the user's per-app TCC + // automation consent. Only honored from user, managed/policy, or CLI (--settings) + // settings — project settings (.claude/settings.json and + // .claude/settings.local.json) are ignored. Default: false + AllowAppleEvents *bool `json:"allowAppleEvents,omitempty,omitzero"` + + // Allow commands to run outside the sandbox via the dangerouslyDisableSandbox + // parameter. When false, the dangerouslyDisableSandbox parameter is completely + // ignored and all commands must run sandboxed. Default: true. + AllowUnsandboxedCommands *bool `json:"allowUnsandboxedCommands,omitempty,omitzero"` + + // Auto Allow Bash If Sandboxed configuration. See the linked native reference for + // semantics and availability. + AutoAllowBashIfSandboxed *bool `json:"autoAllowBashIfSandboxed,omitempty,omitzero"` + + // Linux/WSL only: Absolute path to the bwrap (bubblewrap) binary. Overrides + // auto-detection via PATH. Only honored from admin-controlled managed settings. + BwrapPath *string `json:"bwrapPath,omitempty,omitzero"` + + // Credentials configuration. See the linked native reference for semantics and + // availability. + Credentials *AnthropicAgentSettingsSandboxCredentials `json:"credentials,omitempty,omitzero"` + + // Enable Weaker Nested Sandbox configuration. See the linked native reference for + // semantics and availability. + EnableWeakerNestedSandbox *bool `json:"enableWeakerNestedSandbox,omitempty,omitzero"` + + // macOS only: Allow access to com.apple.trustd.agent in the sandbox. Needed for + // Go-based CLI tools (gh, gcloud, terraform, etc.) to verify TLS certificates + // when using httpProxyPort with a MITM proxy and custom CA. **Reduces security** + // — opens a potential data exfiltration vector through the trustd service. + // Default: false + EnableWeakerNetworkIsolation *bool `json:"enableWeakerNetworkIsolation,omitempty,omitzero"` + + // Enabled configuration. See the linked native reference for semantics and + // availability. + Enabled *bool `json:"enabled,omitempty,omitzero"` + + // Excluded Commands configuration. See the linked native reference for semantics + // and availability. + ExcludedCommands []string `json:"excludedCommands,omitempty,omitzero"` + + // Exit with an error at startup if sandbox.enabled is true but the sandbox cannot + // start (missing dependencies or unsupported platform). When false (default), a + // warning is shown and commands run unsandboxed. Intended for managed-settings + // deployments that require sandboxing as a hard gate. + FailIfUnavailable *bool `json:"failIfUnavailable,omitempty,omitzero"` + + // Filesystem configuration. See the linked native reference for semantics and + // availability. + Filesystem *AnthropicAgentSettingsSandboxFilesystem `json:"filesystem,omitempty,omitzero"` + + // Ignore Violations configuration. See the linked native reference for semantics + // and availability. + IgnoreViolations AnthropicAgentSettingsSandboxIgnoreViolations `json:"ignoreViolations,omitempty,omitzero"` + + // Network configuration. See the linked native reference for semantics and + // availability. + Network *AnthropicAgentSettingsSandboxNetwork `json:"network,omitempty,omitzero"` + + // Custom ripgrep configuration for bundled ripgrep support. Only honored from + // user, managed/policy, or CLI (--settings) settings — project settings + // (.claude/settings.json and .claude/settings.local.json) are ignored. + Ripgrep *AnthropicAgentSettingsSandboxRipgrep `json:"ripgrep,omitempty,omitzero"` + + // Linux/WSL only: Absolute path to the socat binary used for the sandbox network + // proxy. Overrides auto-detection via PATH. Only honored from admin-controlled + // managed settings. + SocatPath *string `json:"socatPath,omitempty,omitzero"` + + AdditionalProperties interface{} `mapstructure:",remain"` +} + +// Credentials configuration. See the linked native reference for semantics and +// availability. +type AnthropicAgentSettingsSandboxCredentials struct { + // Allow sentinel→real substitution on the plain-HTTP proxy path. Defaults to + // false: without TLS termination the upstream identity is unverified and the + // credential travels in cleartext. Set only for trusted-network test fixtures. + // Only honored from user, managed/policy, or CLI (`--settings`) settings — + // project settings (.claude/settings.json and .claude/settings.local.json) are + // ignored. + AllowPlaintextInject *bool `json:"allowPlaintextInject,omitempty,omitzero"` + + // Explicit groupings of masked env vars into AWS credential pairs for SigV4 + // re-signing, for non-standard variable names. The conventional AWS_ACCESS_KEY_ID + // / AWS_SECRET_ACCESS_KEY / AWS_SESSION_TOKEN trio is paired automatically when + // masked. Only honored from user, managed/policy, or CLI (`--settings`) settings + // — project settings (.claude/settings.json and .claude/settings.local.json) are + // ignored. A member is only usable when its env var is forwarded as a whole-value + // `mask` entry (an entry carrying `extract` or `decode` does not qualify — + // re-signing needs the whole real value). A pair whose key id or secret member is + // unusable never re-signs: it is dropped, unless it names a conventional AWS + // variable, in which case it is forwarded as an inert suppressor so implicit + // auto-pairing stays overridden. A pair whose ONLY unusable member is the session + // token still re-signs, without an x-amz-security-token (temporary-credential + // requests fail upstream until the entry is fixed). + AwsPairs []AnthropicAgentSettingsSandboxCredentialsAwsPairsElem `json:"awsPairs,omitempty,omitzero"` + + // Environment variables to protect. `deny` unsets the variable for sandboxed + // commands; `mask` substitutes a sentinel inside the sandbox and injects the real + // value at the proxy. + EnvVars []AnthropicAgentSettingsSandboxCredentialsEnvVarsElem `json:"envVars,omitempty,omitzero"` + + // Credential files or directories to protect. `deny` blocks reads inside the + // sandbox; `mask` substitutes a sentinel inside the sandbox (whole-file, or + // per-`extract` capture) and injects the real value at the proxy. On macOS and + // Windows `mask` degrades to `deny`. + Files []AnthropicAgentSettingsSandboxCredentialsFilesElem `json:"files,omitempty,omitzero"` + + // Policies for AWS SigV4 request shapes the proxy cannot re-sign (streaming, + // presigned, sigv4a) when they reference a masked credential pair: `deny` + // (default) or `passthrough`. Only honored from user, managed/policy, or CLI + // (`--settings`) settings — project settings (.claude/settings.json and + // .claude/settings.local.json) are ignored. + Sigv4 *AnthropicAgentSettingsSandboxCredentialsSigv4 `json:"sigv4,omitempty,omitzero"` +} + +// Aws Pairs value configuration. See the linked native reference for semantics and +// availability. +type AnthropicAgentSettingsSandboxCredentialsAwsPairsElem struct { + // Name of the masked env var holding the AWS access key id. + AccessKeyIdVar string `json:"accessKeyIdVar"` + + // Name of the masked env var holding the AWS secret access key. + SecretAccessKeyVar string `json:"secretAccessKeyVar"` + + // Optional name of the masked env var holding the AWS session token (temporary + // credentials). When set, the proxy sends the real token as x-amz-security-token + // on re-signed requests and adds it to the signed header set if the client did + // not. + SessionTokenVar *string `json:"sessionTokenVar,omitempty,omitzero"` +} + +// Env Vars value configuration. See the linked native reference for semantics and +// availability. +type AnthropicAgentSettingsSandboxCredentialsEnvVarsElem struct { + // Optional encoded-credential format for `mask` mode. `jwt`: the variable's whole + // value is verified to actually be a JWT and replaced with a structurally valid + // fake JWT so client-side token parsing inside the sandbox keeps working; the + // proxy swaps the whole fake token on egress. If the value does not verify, the + // variable is left unmasked with a stderr warning (fail-open). Cannot be combined + // with `extract` — the decode path never consults it. Accepted but ignored for + // `deny`. + Decode *string `json:"decode,omitempty,omitzero"` + + // Optional regex for structured masking when mode is `mask`. Applied globally to + // the value; capture group 1 of each match is a credential value, and only those + // captured spans are replaced with sentinels — the rest of the value is preserved + // so a tool that parses it (a `DATABASE_URL` connection string, a composite + // `KEY:SECRET` pair) still succeeds inside the sandbox. Without `extract`, the + // entire value is replaced with one sentinel (whole-value masking, suited to bare + // tokens). If the regex matches nothing, behavior is governed by + // `onExtractNoMatch` (default `warn`). Cannot be combined with `decode` (the + // decode path never consults it). Accepted but ignored for `deny`. + Extract *string `json:"extract,omitempty,omitzero"` + + // Optional narrowing of where the proxy substitutes this credential. Only + // meaningful when mode is `mask`; accepted but ignored for `deny`. If unset, + // defaults to `network.allowedDomains` — the credential is injected at every + // reachable host. Each entry must be reachable via `network.allowedDomains` + // (sandbox-runtime validates this). + InjectHosts []string `json:"injectHosts,omitempty,omitzero"` + + // Names of top-level payload claims to mask inside the decoded value, instead of + // replacing the whole token. Each named claim present with a string value gets + // its own sentinel and the token is rebuilt around the modified payload; all + // other claims are preserved so claim-reading clients keep working. Requires + // `decode`. If no named claim matches, the variable is left unmasked with a + // stderr warning (fail-open). Only meaningful when mode is `mask`; accepted but + // ignored for `deny`. + MaskClaims []string `json:"maskClaims,omitempty,omitzero"` + + // Access mode for this environment variable. `deny` unsets the variable for + // sandboxed commands; `mask` shows sandboxed commands a sentinel value and the + // host proxy swaps sentinel→real on egress to `injectHosts`. + Mode AnthropicAgentSettingsSandboxCredentialsEnvVarsElemMode `json:"mode"` + + // Environment variable name. + Name string `json:"name"` + + // What to do when `extract` matches nothing in the value. `warn` (default) emits + // a stderr warning and lets the variable pass through unmasked (fail-open, for + // credentials that may be legitimately absent); `deny` unsets the variable inside + // the sandbox (fail-closed); `error` aborts at sandbox setup so nothing runs + // until the config is fixed. Only meaningful when mode is `mask` and `extract` is + // set without `decode`. On a mask entry with `decode`, the runtime takes the + // decode path and never consults this field, so a fail-closed setting cannot be + // honored — `deny` and `error` are rejected there; only `warn` is accepted. In + // all other shapes the field is accepted but ignored. + OnExtractNoMatch *AnthropicAgentSettingsSandboxCredentialsEnvVarsElemOnExtractNoMatch `json:"onExtractNoMatch,omitempty,omitzero"` +} + +type AnthropicAgentSettingsSandboxCredentialsEnvVarsElemMode string + +const AnthropicAgentSettingsSandboxCredentialsEnvVarsElemModeDeny AnthropicAgentSettingsSandboxCredentialsEnvVarsElemMode = "deny" +const AnthropicAgentSettingsSandboxCredentialsEnvVarsElemModeMask AnthropicAgentSettingsSandboxCredentialsEnvVarsElemMode = "mask" + +type AnthropicAgentSettingsSandboxCredentialsEnvVarsElemOnExtractNoMatch string + +const AnthropicAgentSettingsSandboxCredentialsEnvVarsElemOnExtractNoMatchDeny AnthropicAgentSettingsSandboxCredentialsEnvVarsElemOnExtractNoMatch = "deny" +const AnthropicAgentSettingsSandboxCredentialsEnvVarsElemOnExtractNoMatchError AnthropicAgentSettingsSandboxCredentialsEnvVarsElemOnExtractNoMatch = "error" +const AnthropicAgentSettingsSandboxCredentialsEnvVarsElemOnExtractNoMatchWarn AnthropicAgentSettingsSandboxCredentialsEnvVarsElemOnExtractNoMatch = "warn" + +// Files value configuration. See the linked native reference for semantics and +// availability. +type AnthropicAgentSettingsSandboxCredentialsFilesElem struct { + // Optional encoded-credential format for `mask` mode. `jwt`: candidates are + // located with a built-in JWT regex (or the explicit `extract` pattern, if set), + // verified to actually be JWTs before masking, and replaced with a structurally + // valid fake JWT so client-side token parsing inside the sandbox keeps working. + // If no candidate verifies, behavior is governed by `onExtractNoMatch` (default + // `warn`). Accepted but ignored for `deny`. + Decode *string `json:"decode,omitempty,omitzero"` + + // Optional regex for structured masking when mode is `mask`. Applied globally to + // the file; capture group 1 of each match is a credential value, and only those + // captured spans are replaced with sentinels — the rest of the file is preserved + // so a tool that parses it (.netrc, JSON, YAML) still succeeds. Without + // `extract`, the entire file content is replaced with one sentinel (whole-file + // masking, suited to single-secret files). If the regex matches nothing, behavior + // is governed by `onExtractNoMatch` (default `warn`). Accepted but ignored for + // `deny`. + Extract *string `json:"extract,omitempty,omitzero"` + + // Optional narrowing of where the proxy substitutes this credential. Only + // meaningful when mode is `mask`; accepted but ignored for `deny`. If unset, + // defaults to `network.allowedDomains` — the credential is injected at every + // reachable host. Each entry must be reachable via `network.allowedDomains` + // (sandbox-runtime validates this). + InjectHosts []string `json:"injectHosts,omitempty,omitzero"` + + // Names of top-level payload claims to mask inside each decoded value, instead of + // replacing the whole token. Each named claim present with a string value gets + // its own sentinel and the token is rebuilt around the modified payload; all + // other claims are preserved so a tool that decodes the token and reads a + // non-secret claim keeps working. Requires `decode`. If no named claim matches in + // any verified token, behavior is governed by `onExtractNoMatch` (default + // `warn`). Only meaningful when mode is `mask`; accepted but ignored for `deny`. + MaskClaims []string `json:"maskClaims,omitempty,omitzero"` + + // If true, verbatim occurrences of each captured credential value outside the + // regex-matched spans are also replaced with the corresponding sentinel — for a + // secret repeated where the regex does not reach (e.g. pasted into a comment). + // Matches raw substrings, so short or common values may corrupt unrelated + // content; intended for long, high-entropy secrets. Defaults to false. Only + // meaningful when mode is `mask` and `extract` or `decode` is set; accepted but + // ignored otherwise. + MaskDuplicates *bool `json:"maskDuplicates,omitempty,omitzero"` + + // Access mode for this path. `deny` blocks reads inside the sandbox; `mask` shows + // sandboxed commands a sentinel-substituted copy (whole-file, or only the spans + // captured by `extract`) and the host proxy swaps sentinel→real on egress to + // `injectHosts`. On macOS and Windows `mask` currently degrades to `deny`. + Mode AnthropicAgentSettingsSandboxCredentialsFilesElemMode `json:"mode"` + + // What to do when `extract` matches nothing in the file — or, with `decode`, when + // no candidate survives verification. `warn` (default) emits a stderr warning and + // leaves the file readable as-is inside the sandbox (fail-open, for credentials + // that may be legitimately absent); `deny` degrades the entry to mode `deny` so + // the file is unreadable (fail-closed) — under `sandbox.filesystem.disabled` it + // is treated as `error`, since read-denies are dropped in that mode; `error` + // aborts at sandbox setup so nothing runs until the config is fixed. Only + // meaningful when mode is `mask` and `extract` or `decode` is set; accepted but + // ignored otherwise. + OnExtractNoMatch *AnthropicAgentSettingsSandboxCredentialsFilesElemOnExtractNoMatch `json:"onExtractNoMatch,omitempty,omitzero"` + + // Path to a credential file or directory. Same resolution as sandbox.filesystem.* + // paths: absolute, ~ expanded, or relative to the settings file root (project + // root for project settings, ~/.claude for user settings). + Path string `json:"path"` +} + +type AnthropicAgentSettingsSandboxCredentialsFilesElemMode string + +const AnthropicAgentSettingsSandboxCredentialsFilesElemModeDeny AnthropicAgentSettingsSandboxCredentialsFilesElemMode = "deny" +const AnthropicAgentSettingsSandboxCredentialsFilesElemModeMask AnthropicAgentSettingsSandboxCredentialsFilesElemMode = "mask" + +type AnthropicAgentSettingsSandboxCredentialsFilesElemOnExtractNoMatch string + +const AnthropicAgentSettingsSandboxCredentialsFilesElemOnExtractNoMatchDeny AnthropicAgentSettingsSandboxCredentialsFilesElemOnExtractNoMatch = "deny" +const AnthropicAgentSettingsSandboxCredentialsFilesElemOnExtractNoMatchError AnthropicAgentSettingsSandboxCredentialsFilesElemOnExtractNoMatch = "error" +const AnthropicAgentSettingsSandboxCredentialsFilesElemOnExtractNoMatchWarn AnthropicAgentSettingsSandboxCredentialsFilesElemOnExtractNoMatch = "warn" + +// Policies for AWS SigV4 request shapes the proxy cannot re-sign (streaming, +// presigned, sigv4a) when they reference a masked credential pair: `deny` +// (default) or `passthrough`. Only honored from user, managed/policy, or CLI +// (`--settings`) settings — project settings (.claude/settings.json and +// .claude/settings.local.json) are ignored. +type AnthropicAgentSettingsSandboxCredentialsSigv4 struct { + // Policy for presigned URLs (X-Amz-Algorithm/X-Amz-Signature in the query, no + // Authorization header): the signature lives in the URL itself. `deny` (default) + // or `passthrough`. + Presigned *AnthropicAgentSettingsSandboxCredentialsSigv4Presigned `json:"presigned,omitempty,omitzero"` + + // Policy for SigV4A (AWS4-ECDSA-P256-SHA256) asymmetric signatures: there is no + // shared-key HMAC to recompute. `deny` (default) or `passthrough`. + Sigv4A *AnthropicAgentSettingsSandboxCredentialsSigv4Sigv4A `json:"sigv4a,omitempty,omitzero"` + + // Policy for aws-chunked streaming uploads (x-amz-content-sha256: STREAMING-*): + // per-chunk signatures chain off the seed signature, so re-signing would require + // rewriting the body. `deny` (default) fails closed with a 403; `passthrough` + // forwards the request unre-signed (the upstream will reject its signature). + Streaming *AnthropicAgentSettingsSandboxCredentialsSigv4Streaming `json:"streaming,omitempty,omitzero"` +} + +type AnthropicAgentSettingsSandboxCredentialsSigv4Presigned string + +const AnthropicAgentSettingsSandboxCredentialsSigv4PresignedDeny AnthropicAgentSettingsSandboxCredentialsSigv4Presigned = "deny" +const AnthropicAgentSettingsSandboxCredentialsSigv4PresignedPassthrough AnthropicAgentSettingsSandboxCredentialsSigv4Presigned = "passthrough" + +type AnthropicAgentSettingsSandboxCredentialsSigv4Sigv4A string + +const AnthropicAgentSettingsSandboxCredentialsSigv4Sigv4ADeny AnthropicAgentSettingsSandboxCredentialsSigv4Sigv4A = "deny" +const AnthropicAgentSettingsSandboxCredentialsSigv4Sigv4APassthrough AnthropicAgentSettingsSandboxCredentialsSigv4Sigv4A = "passthrough" + +type AnthropicAgentSettingsSandboxCredentialsSigv4Streaming string + +const AnthropicAgentSettingsSandboxCredentialsSigv4StreamingDeny AnthropicAgentSettingsSandboxCredentialsSigv4Streaming = "deny" +const AnthropicAgentSettingsSandboxCredentialsSigv4StreamingPassthrough AnthropicAgentSettingsSandboxCredentialsSigv4Streaming = "passthrough" + +// Filesystem configuration. See the linked native reference for semantics and +// availability. +type AnthropicAgentSettingsSandboxFilesystem struct { + // When true (set in managed settings), only allowRead paths from policySettings + // are used. + AllowManagedReadPathsOnly *bool `json:"allowManagedReadPathsOnly,omitempty,omitzero"` + + // Paths to re-allow reading within denyRead regions. Takes precedence over + // denyRead for matching paths. + AllowRead []string `json:"allowRead,omitempty,omitzero"` + + // Additional paths to allow writing within the sandbox. Merged with paths from + // Edit(...) allow permission rules. + AllowWrite []string `json:"allowWrite,omitempty,omitzero"` + + // Additional paths to deny reading within the sandbox. Merged with paths from + // Read(...) deny permission rules. + DenyRead []string `json:"denyRead,omitempty,omitzero"` + + // Additional paths to deny writing within the sandbox. Merged with paths from + // Edit(...) deny permission rules. + DenyWrite []string `json:"denyWrite,omitempty,omitzero"` + + // macOS and Linux/WSL only: skip filesystem isolation entirely while keeping + // network and seccomp isolation. Ignored on native Windows, where the sandboxed + // process runs as a separate user with no inherent rights, so skipping the + // filesystem rules would withhold every access grant rather than loosen them — + // filesystem isolation stays on there. Sandboxed commands get unrestricted + // read/write access to the host filesystem; network egress is still confined to + // network.allowedDomains. Intended for deployments whose goal is egress control + // rather than filesystem containment. Does not change Bash prompting: + // sandbox.autoAllowBashIfSandboxed is independent and still defaults to true, so + // set it to false to keep prompting for sandboxed commands. Drops the read + // protection from filesystem.denyRead and credentials.files deny entries for + // sandboxed commands, since both are enforced by the filesystem layer this turns + // off; credentials.files mask entries (sentinel binds) and credentials.envVars + // deny/mask are unaffected. Only honored from user, managed/policy, or CLI + // (`--settings`) settings — project settings (.claude/settings.json and + // .claude/settings.local.json) are ignored. If managed settings configure + // sandbox.filesystem at all, or list any sandbox.credentials.files deny entry, + // only managed settings can set this: an admin who deployed filesystem + // restrictions must not have them switched off by a user-writable file. + // (sandbox.credentials.envVars and credentials.files mask entries do not pin it — + // env scrubbing and sentinel binds are independent of the filesystem layer and + // survive this setting.) When unset, filesystem isolation stays on. + Disabled *bool `json:"disabled,omitempty,omitzero"` +} + +// Ignore Violations configuration. See the linked native reference for semantics +// and availability. +type AnthropicAgentSettingsSandboxIgnoreViolations map[string][]string + +// Network configuration. See the linked native reference for semantics and +// availability. +type AnthropicAgentSettingsSandboxNetwork struct { + // If true, allow all Unix sockets (disables blocking on both platforms). + AllowAllUnixSockets *bool `json:"allowAllUnixSockets,omitempty,omitzero"` + + // Allow Local Binding configuration. See the linked native reference for + // semantics and availability. + AllowLocalBinding *bool `json:"allowLocalBinding,omitempty,omitzero"` + + // macOS only: Additional XPC/Mach service names to allow looking up. Supports + // trailing-wildcard prefix matching (e.g., "com.apple.coresimulator.*"). Needed + // for tools that communicate via XPC such as the iOS Simulator or Playwright. + AllowMachLookup []string `json:"allowMachLookup,omitempty,omitzero"` + + // When true (and set in managed settings), only allowedDomains and + // WebFetch(domain:...) allow rules from managed settings are respected. User, + // project, local, and flag settings domains are ignored. Denied domains are still + // respected from all sources. + AllowManagedDomainsOnly *bool `json:"allowManagedDomainsOnly,omitempty,omitzero"` + + // macOS only: Unix socket paths to allow. Ignored on Linux (seccomp cannot filter + // by path). + AllowUnixSockets []string `json:"allowUnixSockets,omitempty,omitzero"` + + // Allowed Domains configuration. See the linked native reference for semantics + // and availability. + AllowedDomains []string `json:"allowedDomains,omitempty,omitzero"` + + // Domains that are always blocked, even if matched by allowedDomains. Supports + // the same wildcard syntax as allowedDomains. Merged from all settings sources + // regardless of allowManagedDomainsOnly. + DeniedDomains []string `json:"deniedDomains,omitempty,omitzero"` + + // HTTP Proxy Port configuration. See the linked native reference for semantics + // and availability. + HttpProxyPort *float64 `json:"httpProxyPort,omitempty,omitzero"` + + // Socks Proxy Port configuration. See the linked native reference for semantics + // and availability. + SocksProxyPort *float64 `json:"socksProxyPort,omitempty,omitzero"` + + // When true, the sandbox runtime deterministically denies hosts not in + // allowedDomains instead of prompting. Enforced for sandboxed commands only — + // in-process tools such as WebFetch are not gated by this setting. Only honored + // from user, managed/policy, or CLI (--settings) settings — project settings + // (.claude/settings.json and .claude/settings.local.json) are ignored. + StrictAllowlist *bool `json:"strictAllowlist,omitempty,omitzero"` + + // [EXPERIMENTAL] Enable in-process TLS termination so the per-request filter can + // see HTTPS request bodies. Provide a CA cert+key, or omit both to have + // sandbox-runtime generate an ephemeral one for the session. On native Windows an + // ephemeral CA cannot pass the sandbox trust check, so omitting the paths uses a + // persistent CA managed by the sandbox runtime (set up and trusted via /sandbox + // install); configured paths are passed to the sandbox runtime verbatim, which + // rejects a bad or incomplete pair at sandbox initialization. Only honored from + // user, managed/policy, or CLI (`--settings`) settings — project settings + // (.claude/settings.json and .claude/settings.local.json) are ignored. + TlsTerminate *AnthropicAgentSettingsSandboxNetworkTlsTerminate `json:"tlsTerminate,omitempty,omitzero"` +} + +// [EXPERIMENTAL] Enable in-process TLS termination so the per-request filter can +// see HTTPS request bodies. Provide a CA cert+key, or omit both to have +// sandbox-runtime generate an ephemeral one for the session. On native Windows an +// ephemeral CA cannot pass the sandbox trust check, so omitting the paths uses a +// persistent CA managed by the sandbox runtime (set up and trusted via /sandbox +// install); configured paths are passed to the sandbox runtime verbatim, which +// rejects a bad or incomplete pair at sandbox initialization. Only honored from +// user, managed/policy, or CLI (`--settings`) settings — project settings +// (.claude/settings.json and .claude/settings.local.json) are ignored. +type AnthropicAgentSettingsSandboxNetworkTlsTerminate struct { + // Ca Cert Path configuration. See the linked native reference for semantics and + // availability. + CaCertPath *string `json:"caCertPath,omitempty,omitzero"` + + // Ca Key Path configuration. See the linked native reference for semantics and + // availability. + CaKeyPath *string `json:"caKeyPath,omitempty,omitzero"` +} + +// Custom ripgrep configuration for bundled ripgrep support. Only honored from +// user, managed/policy, or CLI (--settings) settings — project settings +// (.claude/settings.json and .claude/settings.local.json) are ignored. +type AnthropicAgentSettingsSandboxRipgrep struct { + // Args configuration. See the linked native reference for semantics and + // availability. + Args []string `json:"args,omitempty,omitzero"` + + // Command configuration. See the linked native reference for semantics and + // availability. + Command string `json:"command"` +} + +// Per-skill listing overrides keyed by skill name. "name-only" lists the skill +// without its description; "user-invocable-only" hides it from the model but keeps +// /name; "off" hides it from both. Absent = on. +type AnthropicAgentSettingsSkillOverrides map[string]AnthropicAgentSettingsSkillOverridesValue + +type AnthropicAgentSettingsSkillOverridesValue string + +const AnthropicAgentSettingsSkillOverridesValueNameOnly AnthropicAgentSettingsSkillOverridesValue = "name-only" +const AnthropicAgentSettingsSkillOverridesValueOff AnthropicAgentSettingsSkillOverridesValue = "off" +const AnthropicAgentSettingsSkillOverridesValueOn AnthropicAgentSettingsSkillOverridesValue = "on" +const AnthropicAgentSettingsSkillOverridesValueUserInvocableOnly AnthropicAgentSettingsSkillOverridesValue = "user-invocable-only" + +// Underline misspelled words in the prompt input as you type, using an installed +// aspell, hunspell or ispell (off unless "enabled" is true; does nothing if none +// is installed). Read from user, flag and managed settings only (the whole block +// from the highest-precedence of those applies); ignored in project +// .claude/settings.json and .claude/settings.local.json. +type AnthropicAgentSettingsSpellcheck struct { + // Which spell checker to run: "aspell", "hunspell", "ispell", or "auto" (default) + // for the first of those found on PATH + Checker *string `json:"checker,omitempty,omitzero"` + + // Color of misspelled words (they are also underlined): a terminal color name + // such as "red" or "magenta", "#rrggbb", "rgb(r,g,b)", "ansi256(n)" or + // "ansi:". Default: the theme's error color + Color *string `json:"color,omitempty,omitzero"` + + // Turn on spell checking of the prompt input (default: false) + Enabled *bool `json:"enabled,omitempty,omitzero"` + + // Dictionary to use, passed to the checker as-is (aspell --lang, hunspell -d, + // ispell -d), e.g. "en_GB"; names are checker-specific (letters, digits and _ - . + // , only). Default: the checker's own default + Language *string `json:"language,omitempty,omitzero"` + + AdditionalProperties interface{} `mapstructure:",remain"` +} + +// Add your organization's own tips to the spinner tip rotation. tips: strings or +// {id, text, cooldownSessions?, priority?} objects; tipsFile: a JSON file of the +// same; label: prefix shown before your tips; excludeDefault: if true, only show +// your tips (default: false). +type AnthropicAgentSettingsSpinnerTipsOverride struct { + // Exclude Default configuration. See the linked native reference for semantics + // and availability. + ExcludeDefault *bool `json:"excludeDefault,omitempty,omitzero"` + + // Prefix shown before your tips in the spinner (default "Tip") + Label *string `json:"label,omitempty,omitzero"` + + // Tips configuration. See the linked native reference for semantics and + // availability. + Tips []json.RawMessage `json:"tips,omitempty,omitzero"` + + // Absolute or ~/ local path to a JSON file holding an array of tips (same shapes + // as `tips`); honored from user, --settings and on-disk managed settings only. + // Read once per CLI process (restart to pick up edits). + TipsFile *string `json:"tipsFile,omitempty,omitzero"` + + AdditionalProperties interface{} `mapstructure:",remain"` +} + +// Customize spinner verbs. mode: "append" adds verbs to defaults, "replace" uses +// only your verbs. +type AnthropicAgentSettingsSpinnerVerbs struct { + // Mode configuration. See the linked native reference for semantics and + // availability. + Mode AnthropicAgentSettingsSpinnerVerbsMode `json:"mode"` + + // Verbs configuration. See the linked native reference for semantics and + // availability. + Verbs []string `json:"verbs"` +} + +type AnthropicAgentSettingsSpinnerVerbsMode string + +const AnthropicAgentSettingsSpinnerVerbsModeAppend AnthropicAgentSettingsSpinnerVerbsMode = "append" +const AnthropicAgentSettingsSpinnerVerbsModeReplace AnthropicAgentSettingsSpinnerVerbsMode = "replace" + +// Ssh Configs value configuration. See the linked native reference for semantics +// and availability. +type AnthropicAgentSettingsSshConfigsElem struct { + // Unique identifier for this SSH config. Used to match configs across settings + // sources. + Id string `json:"id"` + + // Display name for the SSH connection + Name string `json:"name"` + + // SSH host in format "user\@hostname" or "hostname", or a host alias from + // ~/.ssh/config + SshHost string `json:"sshHost"` + + // Path to SSH identity file (private key) + SshIdentityFile *string `json:"sshIdentityFile,omitempty,omitzero"` + + // SSH port (default: 22) + SshPort *float64 `json:"sshPort,omitempty,omitzero"` + + // Default working directory on the remote host. Supports tilde expansion (e.g. + // ~/projects). If not specified, defaults to the remote user home directory. Can + // be overridden by the [dir] positional argument in `claude ssh [dir]`. + StartDirectory *string `json:"startDirectory,omitempty,omitzero"` +} + +// Custom status line display configuration +type AnthropicAgentSettingsStatusLine struct { + // Command configuration. See the linked native reference for semantics and + // availability. + Command string `json:"command"` + + // Hide the built-in `-- INSERT --` / `-- VISUAL --` indicator below the prompt. + // Use this when your status line script renders `vim.mode` itself. + HideVimModeIndicator *bool `json:"hideVimModeIndicator,omitempty,omitzero"` + + // Padding configuration. See the linked native reference for semantics and + // availability. + Padding *float64 `json:"padding,omitempty,omitzero"` + + // Re-run the status line command every N seconds in addition to event-driven + // updates + RefreshInterval *float64 `json:"refreshInterval,omitempty,omitzero"` + + // Type configuration. See the linked native reference for semantics and + // availability. + Type string `json:"type"` +} + +type AnthropicAgentSettingsSubagentPromptCacheTtl string + +const AnthropicAgentSettingsSubagentPromptCacheTtlA1H AnthropicAgentSettingsSubagentPromptCacheTtl = "1h" +const AnthropicAgentSettingsSubagentPromptCacheTtlA5M AnthropicAgentSettingsSubagentPromptCacheTtl = "5m" + +// Custom per-subagent status line shown in the agent panel; receives row context +// as JSON on stdin +type AnthropicAgentSettingsSubagentStatusLine struct { + // Command configuration. See the linked native reference for semantics and + // availability. + Command string `json:"command"` + + // Type configuration. See the linked native reference for semantics and + // availability. + Type string `json:"type"` +} + +type AnthropicAgentSettingsTeammateMode string + +const AnthropicAgentSettingsTeammateModeAuto AnthropicAgentSettingsTeammateMode = "auto" +const AnthropicAgentSettingsTeammateModeInProcess AnthropicAgentSettingsTeammateMode = "in-process" +const AnthropicAgentSettingsTeammateModeIterm2 AnthropicAgentSettingsTeammateMode = "iterm2" +const AnthropicAgentSettingsTeammateModeTmux AnthropicAgentSettingsTeammateMode = "tmux" + +type AnthropicAgentSettingsTui string + +const AnthropicAgentSettingsTuiDefault AnthropicAgentSettingsTui = "default" +const AnthropicAgentSettingsTuiFullscreen AnthropicAgentSettingsTui = "fullscreen" + +type AnthropicAgentSettingsViewMode string + +const AnthropicAgentSettingsViewModeDefault AnthropicAgentSettingsViewMode = "default" +const AnthropicAgentSettingsViewModeFocus AnthropicAgentSettingsViewMode = "focus" +const AnthropicAgentSettingsViewModeVerbose AnthropicAgentSettingsViewMode = "verbose" + +// Vim INSERT-mode key-sequence remaps, e.g. {"jj": ""}. Each key is exactly +// two printable characters typed in sequence; "" (return to NORMAL mode) is +// the only supported target. Applies when editorMode is "vim". +type AnthropicAgentSettingsVimInsertModeRemaps map[string]interface{} + +// Voice mode settings (hold-to-talk / tap-to-toggle dictation) +type AnthropicAgentSettingsVoice struct { + // Submit the prompt when hold-to-talk is released (hold mode only) + AutoSubmit *bool `json:"autoSubmit,omitempty,omitzero"` + + // Enabled configuration. See the linked native reference for semantics and + // availability. + Enabled *bool `json:"enabled,omitempty,omitzero"` + + // 'hold' (default): hold to talk. 'tap': tap to start, tap to stop+submit. + Mode *AnthropicAgentSettingsVoiceMode `json:"mode,omitempty,omitzero"` +} + +type AnthropicAgentSettingsVoiceMode string + +const AnthropicAgentSettingsVoiceModeHold AnthropicAgentSettingsVoiceMode = "hold" +const AnthropicAgentSettingsVoiceModeTap AnthropicAgentSettingsVoiceMode = "tap" + +type AnthropicAgentSettingsWorkflowSizeGuideline string + +const AnthropicAgentSettingsWorkflowSizeGuidelineLarge AnthropicAgentSettingsWorkflowSizeGuideline = "large" +const AnthropicAgentSettingsWorkflowSizeGuidelineMedium AnthropicAgentSettingsWorkflowSizeGuideline = "medium" +const AnthropicAgentSettingsWorkflowSizeGuidelineSmall AnthropicAgentSettingsWorkflowSizeGuideline = "small" +const AnthropicAgentSettingsWorkflowSizeGuidelineUnrestricted AnthropicAgentSettingsWorkflowSizeGuideline = "unrestricted" + +// Git worktree configuration: the CLI --worktree flag, EnterWorktree and agent +// isolation, plus the location Claude Code Desktop uses for SSH-session worktrees +// on this machine. +type AnthropicAgentSettingsWorktree struct { + // Which ref new worktrees branch from. 'fresh' (default) branches from + // origin/ for a clean tree. 'head' branches from your current + // local HEAD so unpushed commits and feature-branch state are present. Applies to + // --worktree, EnterWorktree, and agent isolation. + BaseRef *AnthropicAgentSettingsWorktreeBaseRef `json:"baseRef,omitempty,omitzero"` + + // Isolation mode for background sessions in this repo. 'worktree' (default) + // blocks Edit/Write in the main checkout until EnterWorktree is called. 'none' + // lets background jobs edit the working copy directly. + BgIsolation *AnthropicAgentSettingsWorktreeBgIsolation `json:"bgIsolation,omitempty,omitzero"` + + // Directory under which Claude Code Desktop creates the worktrees of SSH sessions + // that run on this machine (an absolute path or one starting with ~/), instead of + // /.claude/worktrees. Read by the desktop app from the SSH host user + // settings; a location chosen in the desktop app's SSH connection settings takes + // precedence. The CLI (--worktree, EnterWorktree, agent isolation) does not read + // it yet. + Location *string `json:"location,omitempty,omitzero"` + + // Directories to include when creating worktrees, via git sparse-checkout (cone + // mode). Dramatically faster in large monorepos — only the listed paths are + // written to disk. + SparsePaths []string `json:"sparsePaths,omitempty,omitzero"` + + // Directories to symlink from main repository to worktrees to avoid disk bloat. + // Must be explicitly configured - no directories are symlinked by default. Common + // examples: "node_modules", ".cache", ".bin" + SymlinkDirectories []string `json:"symlinkDirectories,omitempty,omitzero"` +} + +type AnthropicAgentSettingsWorktreeBaseRef string + +const AnthropicAgentSettingsWorktreeBaseRefFresh AnthropicAgentSettingsWorktreeBaseRef = "fresh" +const AnthropicAgentSettingsWorktreeBaseRefHead AnthropicAgentSettingsWorktreeBaseRef = "head" + +type AnthropicAgentSettingsWorktreeBgIsolation string + +const AnthropicAgentSettingsWorktreeBgIsolationNone AnthropicAgentSettingsWorktreeBgIsolation = "none" +const AnthropicAgentSettingsWorktreeBgIsolationWorktree AnthropicAgentSettingsWorktreeBgIsolation = "worktree" diff --git a/pkg/adapters/zz_generated_anthropic_api.go b/pkg/adapters/zz_generated_anthropic_api.go index b49497bc..ad8fda2e 100644 --- a/pkg/adapters/zz_generated_anthropic_api.go +++ b/pkg/adapters/zz_generated_anthropic_api.go @@ -4,10 +4,697 @@ package adapters import "encoding/json" +// The properties Data, MediaType, Type are required. +type AnthropicAPIBase64ImageSourceParam struct { + // Data configuration. See the linked native reference for semantics and + // availability. + Data string `json:"data"` + + // Any of "image/jpeg", "image/png", "image/gif", "image/webp". + // + MediaType AnthropicAPIBase64ImageSourceParamMediaType `json:"media_type"` + + // This field can be elided, and will marshal its zero value as "base64". + // + Type interface{} `json:"type"` +} + +type AnthropicAPIBase64ImageSourceParamMediaType string + +const AnthropicAPIBase64ImageSourceParamMediaTypeImageGif AnthropicAPIBase64ImageSourceParamMediaType = "image/gif" +const AnthropicAPIBase64ImageSourceParamMediaTypeImageJpeg AnthropicAPIBase64ImageSourceParamMediaType = "image/jpeg" +const AnthropicAPIBase64ImageSourceParamMediaTypeImagePng AnthropicAPIBase64ImageSourceParamMediaType = "image/png" +const AnthropicAPIBase64ImageSourceParamMediaTypeImageWebp AnthropicAPIBase64ImageSourceParamMediaType = "image/webp" + +// The properties Data, MediaType, Type are required. +type AnthropicAPIBase64PDFSourceParam struct { + // Data configuration. See the linked native reference for semantics and + // availability. + Data string `json:"data"` + + // This field can be elided, and will marshal its zero value as "application/pdf". + // + MediaType interface{} `json:"media_type"` + + // This field can be elided, and will marshal its zero value as "base64". + // + Type interface{} `json:"type"` +} + +// The properties FileID, Type are required. +type AnthropicAPIBashCodeExecutionOutputBlockParam struct { + // File id configuration. See the linked native reference for semantics and + // availability. + FileId string `json:"file_id"` + + // This field can be elided, and will marshal its zero value as + // "bash_code_execution_output". + // + Type interface{} `json:"type"` +} + +// The properties Content, ReturnCode, Stderr, Stdout, Type are required. +type AnthropicAPIBashCodeExecutionResultBlockParam struct { + // Content configuration. See the linked native reference for semantics and + // availability. + Content []AnthropicAPIBashCodeExecutionOutputBlockParam `json:"content"` + + // Return code configuration. See the linked native reference for semantics and + // availability. + ReturnCode int `json:"return_code"` + + // Stderr configuration. See the linked native reference for semantics and + // availability. + Stderr string `json:"stderr"` + + // Stdout configuration. See the linked native reference for semantics and + // availability. + Stdout string `json:"stdout"` + + // This field can be elided, and will marshal its zero value as + // "bash_code_execution_result". + // + Type interface{} `json:"type"` +} + +// The properties Content, ToolUseID, Type are required. +type AnthropicAPIBashCodeExecutionToolResultBlockParam struct { + // Create a cache control breakpoint at this content block. + // + CacheControl *AnthropicAPICacheControlEphemeralParam `json:"cache_control,omitempty,omitzero"` + + // Content configuration. See the linked native reference for semantics and + // availability. + Content AnthropicAPIBashCodeExecutionToolResultBlockParamContentUnion `json:"content"` + + // Tool use id configuration. See the linked native reference for semantics and + // availability. + ToolUseId string `json:"tool_use_id"` + + // This field can be elided, and will marshal its zero value as + // "bash_code_execution_tool_result". + // + Type interface{} `json:"type"` +} + +// Anthropic APIBash Code Execution Tool Result Block Param Content Union +// configuration. See the linked native reference for semantics and availability. +type AnthropicAPIBashCodeExecutionToolResultBlockParamContentUnion = json.RawMessage + +// The properties ErrorCode, Type are required. +type AnthropicAPIBashCodeExecutionToolResultErrorParam struct { + // Any of "invalid_tool_input", "unavailable", "too_many_requests", + // "execution_time_exceeded", "output_file_too_large". + // + ErrorCode AnthropicAPIBashCodeExecutionToolResultErrorParamErrorCode `json:"error_code"` + + // This field can be elided, and will marshal its zero value as + // "bash_code_execution_tool_result_error". + // + Type interface{} `json:"type"` +} + +type AnthropicAPIBashCodeExecutionToolResultErrorParamErrorCode string + +const AnthropicAPIBashCodeExecutionToolResultErrorParamErrorCodeExecutionTimeExceeded AnthropicAPIBashCodeExecutionToolResultErrorParamErrorCode = "execution_time_exceeded" +const AnthropicAPIBashCodeExecutionToolResultErrorParamErrorCodeInvalidToolInput AnthropicAPIBashCodeExecutionToolResultErrorParamErrorCode = "invalid_tool_input" +const AnthropicAPIBashCodeExecutionToolResultErrorParamErrorCodeOutputFileTooLarge AnthropicAPIBashCodeExecutionToolResultErrorParamErrorCode = "output_file_too_large" +const AnthropicAPIBashCodeExecutionToolResultErrorParamErrorCodeTooManyRequests AnthropicAPIBashCodeExecutionToolResultErrorParamErrorCode = "too_many_requests" +const AnthropicAPIBashCodeExecutionToolResultErrorParamErrorCodeUnavailable AnthropicAPIBashCodeExecutionToolResultErrorParamErrorCode = "unavailable" + +// This struct has a constant value, construct it with +// [NewCacheControlEphemeralParam]. +type AnthropicAPICacheControlEphemeralParam struct { + // The time-to-live for the cache control breakpoint. + // + // This may be one the following values: + // + // - `5m`: 5 minutes + // - `1h`: 1 hour + // + // Defaults to `5m`. + // + // Any of "5m", "1h". + // + Ttl *AnthropicAPICacheControlEphemeralParamTtl `json:"ttl,omitempty,omitzero"` + + // Type configuration. See the linked native reference for semantics and + // availability. + Type interface{} `json:"type"` +} + +type AnthropicAPICacheControlEphemeralParamTtl string + +const AnthropicAPICacheControlEphemeralParamTtlA1H AnthropicAPICacheControlEphemeralParamTtl = "1h" +const AnthropicAPICacheControlEphemeralParamTtlA5M AnthropicAPICacheControlEphemeralParamTtl = "5m" + +// The properties CitedText, DocumentIndex, DocumentTitle, EndCharIndex, +// StartCharIndex, Type are required. +type AnthropicAPICitationCharLocationParam struct { + // Cited text configuration. See the linked native reference for semantics and + // availability. + CitedText string `json:"cited_text"` + + // Document index configuration. See the linked native reference for semantics and + // availability. + DocumentIndex int `json:"document_index"` + + // Document title configuration. See the linked native reference for semantics and + // availability. + DocumentTitle string `json:"document_title"` + + // End char index configuration. See the linked native reference for semantics and + // availability. + EndCharIndex int `json:"end_char_index"` + + // Start char index configuration. See the linked native reference for semantics + // and availability. + StartCharIndex int `json:"start_char_index"` + + // This field can be elided, and will marshal its zero value as "char_location". + // + Type interface{} `json:"type"` +} + +// The properties CitedText, DocumentIndex, DocumentTitle, EndBlockIndex, +// StartBlockIndex, Type are required. +type AnthropicAPICitationContentBlockLocationParam struct { + // Cited text configuration. See the linked native reference for semantics and + // availability. + CitedText string `json:"cited_text"` + + // Document index configuration. See the linked native reference for semantics and + // availability. + DocumentIndex int `json:"document_index"` + + // Document title configuration. See the linked native reference for semantics and + // availability. + DocumentTitle string `json:"document_title"` + + // End block index configuration. See the linked native reference for semantics + // and availability. + EndBlockIndex int `json:"end_block_index"` + + // Start block index configuration. See the linked native reference for semantics + // and availability. + StartBlockIndex int `json:"start_block_index"` + + // This field can be elided, and will marshal its zero value as + // "content_block_location". + // + Type interface{} `json:"type"` +} + +// The properties CitedText, DocumentIndex, DocumentTitle, EndPageNumber, +// StartPageNumber, Type are required. +type AnthropicAPICitationPageLocationParam struct { + // Cited text configuration. See the linked native reference for semantics and + // availability. + CitedText string `json:"cited_text"` + + // Document index configuration. See the linked native reference for semantics and + // availability. + DocumentIndex int `json:"document_index"` + + // Document title configuration. See the linked native reference for semantics and + // availability. + DocumentTitle string `json:"document_title"` + + // End page number configuration. See the linked native reference for semantics + // and availability. + EndPageNumber int `json:"end_page_number"` + + // Start page number configuration. See the linked native reference for semantics + // and availability. + StartPageNumber int `json:"start_page_number"` + + // This field can be elided, and will marshal its zero value as "page_location". + // + Type interface{} `json:"type"` +} + +// The properties CitedText, EndBlockIndex, SearchResultIndex, Source, +// StartBlockIndex, Title, Type are required. +type AnthropicAPICitationSearchResultLocationParam struct { + // Cited text configuration. See the linked native reference for semantics and + // availability. + CitedText string `json:"cited_text"` + + // End block index configuration. See the linked native reference for semantics + // and availability. + EndBlockIndex int `json:"end_block_index"` + + // Search result index configuration. See the linked native reference for + // semantics and availability. + SearchResultIndex int `json:"search_result_index"` + + // Source configuration. See the linked native reference for semantics and + // availability. + Source string `json:"source"` + + // Start block index configuration. See the linked native reference for semantics + // and availability. + StartBlockIndex int `json:"start_block_index"` + + // Title configuration. See the linked native reference for semantics and + // availability. + Title string `json:"title"` + + // This field can be elided, and will marshal its zero value as + // "search_result_location". + // + Type interface{} `json:"type"` +} + +// The properties CitedText, EncryptedIndex, Title, Type, URL are required. +type AnthropicAPICitationWebSearchResultLocationParam struct { + // Cited text configuration. See the linked native reference for semantics and + // availability. + CitedText string `json:"cited_text"` + + // Encrypted index configuration. See the linked native reference for semantics + // and availability. + EncryptedIndex string `json:"encrypted_index"` + + // Title configuration. See the linked native reference for semantics and + // availability. + Title string `json:"title"` + + // This field can be elided, and will marshal its zero value as + // "web_search_result_location". + // + Type interface{} `json:"type"` + + // Url configuration. See the linked native reference for semantics and + // availability. + Url string `json:"url"` +} + +// Anthropic APICitations Config Param configuration. See the linked native +// reference for semantics and availability. +type AnthropicAPICitationsConfigParam struct { + // Enabled configuration. See the linked native reference for semantics and + // availability. + Enabled *bool `json:"enabled,omitempty,omitzero"` +} + +// The properties FileID, Type are required. +type AnthropicAPICodeExecutionOutputBlockParam struct { + // File id configuration. See the linked native reference for semantics and + // availability. + FileId string `json:"file_id"` + + // This field can be elided, and will marshal its zero value as + // "code_execution_output". + // + Type interface{} `json:"type"` +} + +// The properties Content, ReturnCode, Stderr, Stdout, Type are required. +type AnthropicAPICodeExecutionResultBlockParam struct { + // Content configuration. See the linked native reference for semantics and + // availability. + Content []AnthropicAPICodeExecutionOutputBlockParam `json:"content"` + + // Return code configuration. See the linked native reference for semantics and + // availability. + ReturnCode int `json:"return_code"` + + // Stderr configuration. See the linked native reference for semantics and + // availability. + Stderr string `json:"stderr"` + + // Stdout configuration. See the linked native reference for semantics and + // availability. + Stdout string `json:"stdout"` + + // This field can be elided, and will marshal its zero value as + // "code_execution_result". + // + Type interface{} `json:"type"` +} + +// The properties Name, Type are required. +type AnthropicAPICodeExecutionTool20250522Param struct { + // Any of "direct", "code_execution_20250825", "code_execution_20260120". + // + AllowedCallers []string `json:"allowed_callers,omitempty,omitzero"` + + // Create a cache control breakpoint at this content block. + // + CacheControl *AnthropicAPICacheControlEphemeralParam `json:"cache_control,omitempty,omitzero"` + + // If true, tool will not be included in initial system prompt. Only loaded when + // returned via tool_reference from tool search. + // + DeferLoading *bool `json:"defer_loading,omitempty,omitzero"` + + // Name of the tool. + // + // This is how the tool will be called by the model and in `tool_use` blocks. + // + // This field can be elided, and will marshal its zero value as "code_execution". + // + Name interface{} `json:"name"` + + // When true, guarantees schema validation on tool names and inputs + // + Strict *bool `json:"strict,omitempty,omitzero"` + + // This field can be elided, and will marshal its zero value as + // "code_execution_20250522". + // + Type interface{} `json:"type"` +} + +// The properties Name, Type are required. +type AnthropicAPICodeExecutionTool20250825Param struct { + // Any of "direct", "code_execution_20250825", "code_execution_20260120". + // + AllowedCallers []string `json:"allowed_callers,omitempty,omitzero"` + + // Create a cache control breakpoint at this content block. + // + CacheControl *AnthropicAPICacheControlEphemeralParam `json:"cache_control,omitempty,omitzero"` + + // If true, tool will not be included in initial system prompt. Only loaded when + // returned via tool_reference from tool search. + // + DeferLoading *bool `json:"defer_loading,omitempty,omitzero"` + + // Name of the tool. + // + // This is how the tool will be called by the model and in `tool_use` blocks. + // + // This field can be elided, and will marshal its zero value as "code_execution". + // + Name interface{} `json:"name"` + + // When true, guarantees schema validation on tool names and inputs + // + Strict *bool `json:"strict,omitempty,omitzero"` + + // This field can be elided, and will marshal its zero value as + // "code_execution_20250825". + // + Type interface{} `json:"type"` +} + +// Code execution tool with REPL state persistence (daemon mode + gVisor +// checkpoint). +// +// The properties Name, Type are required. +type AnthropicAPICodeExecutionTool20260120Param struct { + // Any of "direct", "code_execution_20250825", "code_execution_20260120". + // + AllowedCallers []string `json:"allowed_callers,omitempty,omitzero"` + + // Create a cache control breakpoint at this content block. + // + CacheControl *AnthropicAPICacheControlEphemeralParam `json:"cache_control,omitempty,omitzero"` + + // If true, tool will not be included in initial system prompt. Only loaded when + // returned via tool_reference from tool search. + // + DeferLoading *bool `json:"defer_loading,omitempty,omitzero"` + + // Name of the tool. + // + // This is how the tool will be called by the model and in `tool_use` blocks. + // + // This field can be elided, and will marshal its zero value as "code_execution". + // + Name interface{} `json:"name"` + + // When true, guarantees schema validation on tool names and inputs + // + Strict *bool `json:"strict,omitempty,omitzero"` + + // This field can be elided, and will marshal its zero value as + // "code_execution_20260120". + // + Type interface{} `json:"type"` +} + +// The properties Content, ToolUseID, Type are required. +type AnthropicAPICodeExecutionToolResultBlockParam struct { + // Create a cache control breakpoint at this content block. + // + CacheControl *AnthropicAPICacheControlEphemeralParam `json:"cache_control,omitempty,omitzero"` + + // Code execution result with encrypted stdout for PFC + web_search results. + // + Content AnthropicAPICodeExecutionToolResultBlockParamContentUnion `json:"content"` + + // Tool use id configuration. See the linked native reference for semantics and + // availability. + ToolUseId string `json:"tool_use_id"` + + // This field can be elided, and will marshal its zero value as + // "code_execution_tool_result". + // + Type interface{} `json:"type"` +} + +// Anthropic APICode Execution Tool Result Block Param Content Union configuration. +// See the linked native reference for semantics and availability. +type AnthropicAPICodeExecutionToolResultBlockParamContentUnion = json.RawMessage + +// The properties ErrorCode, Type are required. +type AnthropicAPICodeExecutionToolResultErrorParam struct { + // Any of "invalid_tool_input", "unavailable", "too_many_requests", + // "execution_time_exceeded". + // + ErrorCode AnthropicAPICodeExecutionToolResultErrorParamErrorCode `json:"error_code"` + + // This field can be elided, and will marshal its zero value as + // "code_execution_tool_result_error". + // + Type interface{} `json:"type"` +} + +type AnthropicAPICodeExecutionToolResultErrorParamErrorCode string + +const AnthropicAPICodeExecutionToolResultErrorParamErrorCodeExecutionTimeExceeded AnthropicAPICodeExecutionToolResultErrorParamErrorCode = "execution_time_exceeded" +const AnthropicAPICodeExecutionToolResultErrorParamErrorCodeInvalidToolInput AnthropicAPICodeExecutionToolResultErrorParamErrorCode = "invalid_tool_input" +const AnthropicAPICodeExecutionToolResultErrorParamErrorCodeTooManyRequests AnthropicAPICodeExecutionToolResultErrorParamErrorCode = "too_many_requests" +const AnthropicAPICodeExecutionToolResultErrorParamErrorCodeUnavailable AnthropicAPICodeExecutionToolResultErrorParamErrorCode = "unavailable" + +// A content block that represents a file to be uploaded to the container Files +// uploaded via this block will be available in the container's input directory. +// +// The properties FileID, Type are required. +type AnthropicAPIContainerUploadBlockParam struct { + // Create a cache control breakpoint at this content block. + // + CacheControl *AnthropicAPICacheControlEphemeralParam `json:"cache_control,omitempty,omitzero"` + + // File id configuration. See the linked native reference for semantics and + // availability. + FileId string `json:"file_id"` + + // This field can be elided, and will marshal its zero value as + // "container_upload". + // + Type interface{} `json:"type"` +} + +// Anthropic APIContent Block Param Union configuration. See the linked native +// reference for semantics and availability. +type AnthropicAPIContentBlockParamUnion = json.RawMessage + +// Anthropic APIContent Block Source Content Item Union Param configuration. See +// the linked native reference for semantics and availability. +type AnthropicAPIContentBlockSourceContentItemUnionParam = json.RawMessage + +// Anthropic APIContent Block Source Content Union Param configuration. See the +// linked native reference for semantics and availability. +type AnthropicAPIContentBlockSourceContentUnionParam = json.RawMessage + +// The properties Content, Type are required. +type AnthropicAPIContentBlockSourceParam struct { + // Content configuration. See the linked native reference for semantics and + // availability. + Content AnthropicAPIContentBlockSourceContentUnionParam `json:"content"` + + // This field can be elided, and will marshal its zero value as "content". + // + Type interface{} `json:"type"` +} + +// Tool invocation directly from the model. +// +// This struct has a constant value, construct it with [NewDirectCallerParam]. +type AnthropicAPIDirectCallerParam struct { + // Type configuration. See the linked native reference for semantics and + // availability. + Type interface{} `json:"type"` +} + +// The properties Source, Type are required. +type AnthropicAPIDocumentBlockParam struct { + // Create a cache control breakpoint at this content block. + // + CacheControl *AnthropicAPICacheControlEphemeralParam `json:"cache_control,omitempty,omitzero"` + + // Citations configuration. See the linked native reference for semantics and + // availability. + Citations *AnthropicAPICitationsConfigParam `json:"citations,omitempty,omitzero"` + + // Context configuration. See the linked native reference for semantics and + // availability. + Context *string `json:"context,omitempty,omitzero"` + + // Source configuration. See the linked native reference for semantics and + // availability. + Source AnthropicAPIDocumentBlockParamSourceUnion `json:"source"` + + // Title configuration. See the linked native reference for semantics and + // availability. + Title *string `json:"title,omitempty,omitzero"` + + // This field can be elided, and will marshal its zero value as "document". + // + Type interface{} `json:"type"` +} + +// Anthropic APIDocument Block Param Source Union configuration. See the linked +// native reference for semantics and availability. +type AnthropicAPIDocumentBlockParamSourceUnion = json.RawMessage + +// Code execution result with encrypted stdout for PFC + web_search results. +// +// The properties Content, EncryptedStdout, ReturnCode, Stderr, Type are required. +type AnthropicAPIEncryptedCodeExecutionResultBlockParam struct { + // Content configuration. See the linked native reference for semantics and + // availability. + Content []AnthropicAPICodeExecutionOutputBlockParam `json:"content"` + + // Encrypted stdout configuration. See the linked native reference for semantics + // and availability. + EncryptedStdout string `json:"encrypted_stdout"` + + // Return code configuration. See the linked native reference for semantics and + // availability. + ReturnCode int `json:"return_code"` + + // Stderr configuration. See the linked native reference for semantics and + // availability. + Stderr string `json:"stderr"` + + // This field can be elided, and will marshal its zero value as + // "encrypted_code_execution_result". + // + Type interface{} `json:"type"` +} + +// The properties Source, Type are required. +type AnthropicAPIImageBlockParam struct { + // Create a cache control breakpoint at this content block. + // + CacheControl *AnthropicAPICacheControlEphemeralParam `json:"cache_control,omitempty,omitzero"` + + // Source configuration. See the linked native reference for semantics and + // availability. + Source AnthropicAPIImageBlockParamSourceUnion `json:"source"` + + // This field can be elided, and will marshal its zero value as "image". + // + Type interface{} `json:"type"` +} + +// Anthropic APIImage Block Param Source Union configuration. See the linked native +// reference for semantics and availability. +type AnthropicAPIImageBlockParamSourceUnion = json.RawMessage + +// The properties Schema, Type are required. +type AnthropicAPIJSONOutputFormatParam struct { + // The JSON schema of the format + // + Schema AnthropicAPIJSONOutputFormatParamSchema `json:"schema"` + + // This field can be elided, and will marshal its zero value as "json_schema". + // + Type interface{} `json:"type"` +} + +// The JSON schema of the format +type AnthropicAPIJSONOutputFormatParamSchema map[string]interface{} + +// The properties Name, Type are required. +type AnthropicAPIMemoryTool20250818Param struct { + // Any of "direct", "code_execution_20250825", "code_execution_20260120". + // + AllowedCallers []string `json:"allowed_callers,omitempty,omitzero"` + + // Create a cache control breakpoint at this content block. + // + CacheControl *AnthropicAPICacheControlEphemeralParam `json:"cache_control,omitempty,omitzero"` + + // If true, tool will not be included in initial system prompt. Only loaded when + // returned via tool_reference from tool search. + // + DeferLoading *bool `json:"defer_loading,omitempty,omitzero"` + + // Input examples configuration. See the linked native reference for semantics and + // availability. + InputExamples []AnthropicAPIMemoryTool20250818ParamInputExamplesElem `json:"input_examples,omitempty,omitzero"` + + // Name of the tool. + // + // This is how the tool will be called by the model and in `tool_use` blocks. + // + // This field can be elided, and will marshal its zero value as "memory". + // + Name interface{} `json:"name"` + + // When true, guarantees schema validation on tool names and inputs + // + Strict *bool `json:"strict,omitempty,omitzero"` + + // This field can be elided, and will marshal its zero value as "memory_20250818". + // + Type interface{} `json:"type"` +} + +// Input examples value configuration. See the linked native reference for +// semantics and availability. +type AnthropicAPIMemoryTool20250818ParamInputExamplesElem map[string]interface{} + +// The properties Content, Role are required. +type AnthropicAPIMessageParam struct { + // Content configuration. See the linked native reference for semantics and + // availability. + Content []AnthropicAPIContentBlockParamUnion `json:"content"` + + // Any of "user", "assistant". + // + Role AnthropicAPIMessageParamRole `json:"role"` +} + +type AnthropicAPIMessageParamRole string + +const AnthropicAPIMessageParamRoleAssistant AnthropicAPIMessageParamRole = "assistant" +const AnthropicAPIMessageParamRoleUser AnthropicAPIMessageParamRole = "user" + +// Anthropic APIMetadata Param configuration. See the linked native reference for +// semantics and availability. +type AnthropicAPIMetadataParam struct { + // An external identifier for the user who is associated with the request. + // + // This should be a uuid, hash value, or other opaque identifier. Anthropic may + // use + // this id to help detect abuse. Do not include any identifying information such + // as + // name, email address, or phone number. + // + UserId *string `json:"user_id,omitempty,omitzero"` +} + // Native Anthropic Messages API request options used by Captain's API runtime. type AnthropicAPIOptions struct { // Top-level prompt-cache marker applied to the final cacheable block. - CacheControl *json.RawMessage `json:"cache_control,omitempty,omitzero"` + CacheControl *AnthropicAPICacheControlEphemeralParam `json:"cache_control,omitempty,omitzero"` // Container identifier reused across Messages API requests. Container *string `json:"container,omitempty,omitzero"` @@ -19,16 +706,16 @@ type AnthropicAPIOptions struct { MaxTokens int `json:"max_tokens"` // Alternating user and assistant messages sent to the Messages API. - Messages json.RawMessage `json:"messages"` + Messages []AnthropicAPIMessageParam `json:"messages"` // Request metadata, including the optional user identifier. - Metadata *json.RawMessage `json:"metadata,omitempty,omitzero"` + Metadata *AnthropicAPIMetadataParam `json:"metadata,omitempty,omitzero"` // Anthropic model identifier used to complete the request. Model string `json:"model"` // Structured-output format and adaptive-thinking effort configuration. - OutputConfig *json.RawMessage `json:"output_config,omitempty,omitzero"` + OutputConfig *AnthropicAPIOutputConfigParam `json:"output_config,omitempty,omitzero"` // Capacity tier used to serve the request. ServiceTier *AnthropicAPIOptionsServiceTier `json:"service_tier,omitempty,omitzero"` @@ -40,19 +727,19 @@ type AnthropicAPIOptions struct { Stream *bool `json:"stream,omitempty,omitzero"` // System instruction blocks supplied outside the message list. - System *json.RawMessage `json:"system,omitempty,omitzero"` + System []AnthropicAPITextBlockParam `json:"system,omitempty,omitzero"` // Sampling temperature between zero and one. Temperature *float64 `json:"temperature,omitempty,omitzero"` // Extended-thinking configuration for reasoning-capable models. - Thinking *json.RawMessage `json:"thinking,omitempty,omitzero"` + Thinking *AnthropicAPIThinkingConfigParamUnion `json:"thinking,omitempty,omitzero"` // Policy controlling whether and which native tool Claude should call. - ToolChoice *json.RawMessage `json:"tool_choice,omitempty,omitzero"` + ToolChoice *AnthropicAPIToolChoiceUnionParam `json:"tool_choice,omitempty,omitzero"` // Native Anthropic tool definitions derived from Captain caller tools. - Tools *json.RawMessage `json:"tools,omitempty,omitzero"` + Tools []AnthropicAPIToolUnionParam `json:"tools,omitempty,omitzero"` // Number of highest-probability tokens retained during sampling. TopK *int `json:"top_k,omitempty,omitzero"` @@ -65,3 +752,1303 @@ type AnthropicAPIOptionsServiceTier string const AnthropicAPIOptionsServiceTierAuto AnthropicAPIOptionsServiceTier = "auto" const AnthropicAPIOptionsServiceTierStandardOnly AnthropicAPIOptionsServiceTier = "standard_only" + +// Anthropic APIOutput Config Param configuration. See the linked native reference +// for semantics and availability. +type AnthropicAPIOutputConfigParam struct { + // All possible effort levels. + // + // Any of "low", "medium", "high", "max". + // + Effort *AnthropicAPIOutputConfigParamEffort `json:"effort,omitempty,omitzero"` + + // A schema to specify Claude's output format in responses. See + // [structured + // outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs) + // + Format *AnthropicAPIJSONOutputFormatParam `json:"format,omitempty,omitzero"` +} + +type AnthropicAPIOutputConfigParamEffort string + +const AnthropicAPIOutputConfigParamEffortHigh AnthropicAPIOutputConfigParamEffort = "high" +const AnthropicAPIOutputConfigParamEffortLow AnthropicAPIOutputConfigParamEffort = "low" +const AnthropicAPIOutputConfigParamEffortMax AnthropicAPIOutputConfigParamEffort = "max" +const AnthropicAPIOutputConfigParamEffortMedium AnthropicAPIOutputConfigParamEffort = "medium" + +// The properties Data, MediaType, Type are required. +type AnthropicAPIPlainTextSourceParam struct { + // Data configuration. See the linked native reference for semantics and + // availability. + Data string `json:"data"` + + // This field can be elided, and will marshal its zero value as "text/plain". + // + MediaType interface{} `json:"media_type"` + + // This field can be elided, and will marshal its zero value as "text". + // + Type interface{} `json:"type"` +} + +// The properties Data, Type are required. +type AnthropicAPIRedactedThinkingBlockParam struct { + // Data configuration. See the linked native reference for semantics and + // availability. + Data string `json:"data"` + + // This field can be elided, and will marshal its zero value as + // "redacted_thinking". + // + Type interface{} `json:"type"` +} + +// The properties Content, Source, Title, Type are required. +type AnthropicAPISearchResultBlockParam struct { + // Create a cache control breakpoint at this content block. + // + CacheControl *AnthropicAPICacheControlEphemeralParam `json:"cache_control,omitempty,omitzero"` + + // Citations configuration. See the linked native reference for semantics and + // availability. + Citations *AnthropicAPICitationsConfigParam `json:"citations,omitempty,omitzero"` + + // Content configuration. See the linked native reference for semantics and + // availability. + Content []AnthropicAPITextBlockParam `json:"content"` + + // Source configuration. See the linked native reference for semantics and + // availability. + Source string `json:"source"` + + // Title configuration. See the linked native reference for semantics and + // availability. + Title string `json:"title"` + + // This field can be elided, and will marshal its zero value as "search_result". + // + Type interface{} `json:"type"` +} + +// The properties ToolID, Type are required. +type AnthropicAPIServerToolCaller20260120Param struct { + // Tool id configuration. See the linked native reference for semantics and + // availability. + ToolId string `json:"tool_id"` + + // This field can be elided, and will marshal its zero value as + // "code_execution_20260120". + // + Type interface{} `json:"type"` +} + +// Tool invocation generated by a server-side tool. +// +// The properties ToolID, Type are required. +type AnthropicAPIServerToolCallerParam struct { + // Tool id configuration. See the linked native reference for semantics and + // availability. + ToolId string `json:"tool_id"` + + // This field can be elided, and will marshal its zero value as + // "code_execution_20250825". + // + Type interface{} `json:"type"` +} + +// The properties ID, Input, Name, Type are required. +type AnthropicAPIServerToolUseBlockParam struct { + // Create a cache control breakpoint at this content block. + // + CacheControl *AnthropicAPICacheControlEphemeralParam `json:"cache_control,omitempty,omitzero"` + + // Tool invocation directly from the model. + // + Caller *AnthropicAPIServerToolUseBlockParamCallerUnion `json:"caller,omitempty,omitzero"` + + // Id configuration. See the linked native reference for semantics and + // availability. + Id string `json:"id"` + + // Input configuration. See the linked native reference for semantics and + // availability. + Input interface{} `json:"input"` + + // Any of "web_search", "web_fetch", "code_execution", "bash_code_execution", + // "text_editor_code_execution", "tool_search_tool_regex", + // "tool_search_tool_bm25". + // + Name AnthropicAPIServerToolUseBlockParamName `json:"name"` + + // This field can be elided, and will marshal its zero value as "server_tool_use". + // + Type interface{} `json:"type"` +} + +// Anthropic APIServer Tool Use Block Param Caller Union configuration. See the +// linked native reference for semantics and availability. +type AnthropicAPIServerToolUseBlockParamCallerUnion = json.RawMessage + +type AnthropicAPIServerToolUseBlockParamName string + +const AnthropicAPIServerToolUseBlockParamNameBashCodeExecution AnthropicAPIServerToolUseBlockParamName = "bash_code_execution" +const AnthropicAPIServerToolUseBlockParamNameCodeExecution AnthropicAPIServerToolUseBlockParamName = "code_execution" +const AnthropicAPIServerToolUseBlockParamNameTextEditorCodeExecution AnthropicAPIServerToolUseBlockParamName = "text_editor_code_execution" +const AnthropicAPIServerToolUseBlockParamNameToolSearchToolBm25 AnthropicAPIServerToolUseBlockParamName = "tool_search_tool_bm25" +const AnthropicAPIServerToolUseBlockParamNameToolSearchToolRegex AnthropicAPIServerToolUseBlockParamName = "tool_search_tool_regex" +const AnthropicAPIServerToolUseBlockParamNameWebFetch AnthropicAPIServerToolUseBlockParamName = "web_fetch" +const AnthropicAPIServerToolUseBlockParamNameWebSearch AnthropicAPIServerToolUseBlockParamName = "web_search" + +// The properties Text, Type are required. +type AnthropicAPITextBlockParam struct { + // Create a cache control breakpoint at this content block. + // + CacheControl *AnthropicAPICacheControlEphemeralParam `json:"cache_control,omitempty,omitzero"` + + // Citations configuration. See the linked native reference for semantics and + // availability. + Citations []AnthropicAPITextCitationParamUnion `json:"citations,omitempty,omitzero"` + + // Text configuration. See the linked native reference for semantics and + // availability. + Text string `json:"text"` + + // This field can be elided, and will marshal its zero value as "text". + // + Type interface{} `json:"type"` +} + +// Anthropic APIText Citation Param Union configuration. See the linked native +// reference for semantics and availability. +type AnthropicAPITextCitationParamUnion = json.RawMessage + +// The properties IsFileUpdate, Type are required. +type AnthropicAPITextEditorCodeExecutionCreateResultBlockParam struct { + // Is file update configuration. See the linked native reference for semantics and + // availability. + IsFileUpdate bool `json:"is_file_update"` + + // This field can be elided, and will marshal its zero value as + // "text_editor_code_execution_create_result". + // + Type interface{} `json:"type"` +} + +// The property Type is required. +type AnthropicAPITextEditorCodeExecutionStrReplaceResultBlockParam struct { + // Lines configuration. See the linked native reference for semantics and + // availability. + Lines []string `json:"lines,omitempty,omitzero"` + + // New lines configuration. See the linked native reference for semantics and + // availability. + NewLines *int `json:"new_lines,omitempty,omitzero"` + + // New start configuration. See the linked native reference for semantics and + // availability. + NewStart *int `json:"new_start,omitempty,omitzero"` + + // Old lines configuration. See the linked native reference for semantics and + // availability. + OldLines *int `json:"old_lines,omitempty,omitzero"` + + // Old start configuration. See the linked native reference for semantics and + // availability. + OldStart *int `json:"old_start,omitempty,omitzero"` + + // This field can be elided, and will marshal its zero value as + // "text_editor_code_execution_str_replace_result". + // + Type interface{} `json:"type"` +} + +// The properties Content, ToolUseID, Type are required. +type AnthropicAPITextEditorCodeExecutionToolResultBlockParam struct { + // Create a cache control breakpoint at this content block. + // + CacheControl *AnthropicAPICacheControlEphemeralParam `json:"cache_control,omitempty,omitzero"` + + // Content configuration. See the linked native reference for semantics and + // availability. + Content AnthropicAPITextEditorCodeExecutionToolResultBlockParamContentUnion `json:"content"` + + // Tool use id configuration. See the linked native reference for semantics and + // availability. + ToolUseId string `json:"tool_use_id"` + + // This field can be elided, and will marshal its zero value as + // "text_editor_code_execution_tool_result". + // + Type interface{} `json:"type"` +} + +// Anthropic APIText Editor Code Execution Tool Result Block Param Content Union +// configuration. See the linked native reference for semantics and availability. +type AnthropicAPITextEditorCodeExecutionToolResultBlockParamContentUnion = json.RawMessage + +// The properties ErrorCode, Type are required. +type AnthropicAPITextEditorCodeExecutionToolResultErrorParam struct { + // Any of "invalid_tool_input", "unavailable", "too_many_requests", + // "execution_time_exceeded", "file_not_found". + // + ErrorCode AnthropicAPITextEditorCodeExecutionToolResultErrorParamErrorCode `json:"error_code"` + + // Error message configuration. See the linked native reference for semantics and + // availability. + ErrorMessage *string `json:"error_message,omitempty,omitzero"` + + // This field can be elided, and will marshal its zero value as + // "text_editor_code_execution_tool_result_error". + // + Type interface{} `json:"type"` +} + +type AnthropicAPITextEditorCodeExecutionToolResultErrorParamErrorCode string + +const AnthropicAPITextEditorCodeExecutionToolResultErrorParamErrorCodeExecutionTimeExceeded AnthropicAPITextEditorCodeExecutionToolResultErrorParamErrorCode = "execution_time_exceeded" +const AnthropicAPITextEditorCodeExecutionToolResultErrorParamErrorCodeFileNotFound AnthropicAPITextEditorCodeExecutionToolResultErrorParamErrorCode = "file_not_found" +const AnthropicAPITextEditorCodeExecutionToolResultErrorParamErrorCodeInvalidToolInput AnthropicAPITextEditorCodeExecutionToolResultErrorParamErrorCode = "invalid_tool_input" +const AnthropicAPITextEditorCodeExecutionToolResultErrorParamErrorCodeTooManyRequests AnthropicAPITextEditorCodeExecutionToolResultErrorParamErrorCode = "too_many_requests" +const AnthropicAPITextEditorCodeExecutionToolResultErrorParamErrorCodeUnavailable AnthropicAPITextEditorCodeExecutionToolResultErrorParamErrorCode = "unavailable" + +// The properties Content, FileType, Type are required. +type AnthropicAPITextEditorCodeExecutionViewResultBlockParam struct { + // Content configuration. See the linked native reference for semantics and + // availability. + Content string `json:"content"` + + // Any of "text", "image", "pdf". + // + FileType AnthropicAPITextEditorCodeExecutionViewResultBlockParamFileType `json:"file_type"` + + // Num lines configuration. See the linked native reference for semantics and + // availability. + NumLines *int `json:"num_lines,omitempty,omitzero"` + + // Start line configuration. See the linked native reference for semantics and + // availability. + StartLine *int `json:"start_line,omitempty,omitzero"` + + // Total lines configuration. See the linked native reference for semantics and + // availability. + TotalLines *int `json:"total_lines,omitempty,omitzero"` + + // This field can be elided, and will marshal its zero value as + // "text_editor_code_execution_view_result". + // + Type interface{} `json:"type"` +} + +type AnthropicAPITextEditorCodeExecutionViewResultBlockParamFileType string + +const AnthropicAPITextEditorCodeExecutionViewResultBlockParamFileTypeImage AnthropicAPITextEditorCodeExecutionViewResultBlockParamFileType = "image" +const AnthropicAPITextEditorCodeExecutionViewResultBlockParamFileTypePdf AnthropicAPITextEditorCodeExecutionViewResultBlockParamFileType = "pdf" +const AnthropicAPITextEditorCodeExecutionViewResultBlockParamFileTypeText AnthropicAPITextEditorCodeExecutionViewResultBlockParamFileType = "text" + +// The properties Signature, Thinking, Type are required. +type AnthropicAPIThinkingBlockParam struct { + // Signature configuration. See the linked native reference for semantics and + // availability. + Signature string `json:"signature"` + + // Thinking configuration. See the linked native reference for semantics and + // availability. + Thinking string `json:"thinking"` + + // This field can be elided, and will marshal its zero value as "thinking". + // + Type interface{} `json:"type"` +} + +// This struct has a constant value, construct it with +// [NewThinkingConfigAdaptiveParam]. +type AnthropicAPIThinkingConfigAdaptiveParam struct { + // Type configuration. See the linked native reference for semantics and + // availability. + Type interface{} `json:"type"` +} + +// This struct has a constant value, construct it with +// [NewThinkingConfigDisabledParam]. +type AnthropicAPIThinkingConfigDisabledParam struct { + // Type configuration. See the linked native reference for semantics and + // availability. + Type interface{} `json:"type"` +} + +// The properties BudgetTokens, Type are required. +type AnthropicAPIThinkingConfigEnabledParam struct { + // Determines how many tokens Claude can use for its internal reasoning process. + // Larger budgets can enable more thorough analysis for complex problems, + // improving + // response quality. + // + // Must be ≥1024 and less than `max_tokens`. + // + // See + // [extended + // thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) + // for details. + // + BudgetTokens int `json:"budget_tokens"` + + // This field can be elided, and will marshal its zero value as "enabled". + // + Type interface{} `json:"type"` +} + +// Anthropic APIThinking Config Param Union configuration. See the linked native +// reference for semantics and availability. +type AnthropicAPIThinkingConfigParamUnion = json.RawMessage + +// The properties Name, Type are required. +type AnthropicAPIToolBash20250124Param struct { + // Any of "direct", "code_execution_20250825", "code_execution_20260120". + // + AllowedCallers []string `json:"allowed_callers,omitempty,omitzero"` + + // Create a cache control breakpoint at this content block. + // + CacheControl *AnthropicAPICacheControlEphemeralParam `json:"cache_control,omitempty,omitzero"` + + // If true, tool will not be included in initial system prompt. Only loaded when + // returned via tool_reference from tool search. + // + DeferLoading *bool `json:"defer_loading,omitempty,omitzero"` + + // Input examples configuration. See the linked native reference for semantics and + // availability. + InputExamples []AnthropicAPIToolBash20250124ParamInputExamplesElem `json:"input_examples,omitempty,omitzero"` + + // Name of the tool. + // + // This is how the tool will be called by the model and in `tool_use` blocks. + // + // This field can be elided, and will marshal its zero value as "bash". + // + Name interface{} `json:"name"` + + // When true, guarantees schema validation on tool names and inputs + // + Strict *bool `json:"strict,omitempty,omitzero"` + + // This field can be elided, and will marshal its zero value as "bash_20250124". + // + Type interface{} `json:"type"` +} + +// Input examples value configuration. See the linked native reference for +// semantics and availability. +type AnthropicAPIToolBash20250124ParamInputExamplesElem map[string]interface{} + +// The model will use any available tools. +// +// The property Type is required. +type AnthropicAPIToolChoiceAnyParam struct { + // Whether to disable parallel tool use. + // + // Defaults to `false`. If set to `true`, the model will output exactly one tool + // use. + // + DisableParallelToolUse *bool `json:"disable_parallel_tool_use,omitempty,omitzero"` + + // This field can be elided, and will marshal its zero value as "any". + // + Type interface{} `json:"type"` +} + +// The model will automatically decide whether to use tools. +// +// The property Type is required. +type AnthropicAPIToolChoiceAutoParam struct { + // Whether to disable parallel tool use. + // + // Defaults to `false`. If set to `true`, the model will output at most one tool + // use. + // + DisableParallelToolUse *bool `json:"disable_parallel_tool_use,omitempty,omitzero"` + + // This field can be elided, and will marshal its zero value as "auto". + // + Type interface{} `json:"type"` +} + +// The model will not be allowed to use tools. +// +// This struct has a constant value, construct it with [NewToolChoiceNoneParam]. +type AnthropicAPIToolChoiceNoneParam struct { + // Type configuration. See the linked native reference for semantics and + // availability. + Type interface{} `json:"type"` +} + +// The model will use the specified tool with `tool_choice.name`. +// +// The properties Name, Type are required. +type AnthropicAPIToolChoiceToolParam struct { + // Whether to disable parallel tool use. + // + // Defaults to `false`. If set to `true`, the model will output exactly one tool + // use. + // + DisableParallelToolUse *bool `json:"disable_parallel_tool_use,omitempty,omitzero"` + + // The name of the tool to use. + // + Name string `json:"name"` + + // This field can be elided, and will marshal its zero value as "tool". + // + Type interface{} `json:"type"` +} + +// Anthropic APITool Choice Union Param configuration. See the linked native +// reference for semantics and availability. +type AnthropicAPIToolChoiceUnionParam = json.RawMessage + +// [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input. +// +// This defines the shape of the `input` that your tool accepts and that the model +// will produce. +// +// The property Type is required. +type AnthropicAPIToolInputSchemaParam struct { + // Properties configuration. See the linked native reference for semantics and + // availability. + Properties interface{} `json:"properties,omitempty,omitzero"` + + // Required configuration. See the linked native reference for semantics and + // availability. + Required []string `json:"required"` + + // This field can be elided, and will marshal its zero value as "object". + // + Type interface{} `json:"type"` +} + +// The properties InputSchema, Name are required. +type AnthropicAPIToolParam struct { + // Any of "direct", "code_execution_20250825", "code_execution_20260120". + // + AllowedCallers []string `json:"allowed_callers,omitempty,omitzero"` + + // Create a cache control breakpoint at this content block. + // + CacheControl *AnthropicAPICacheControlEphemeralParam `json:"cache_control,omitempty,omitzero"` + + // If true, tool will not be included in initial system prompt. Only loaded when + // returned via tool_reference from tool search. + // + DeferLoading *bool `json:"defer_loading,omitempty,omitzero"` + + // Description of what this tool does. + // + // Tool descriptions should be as detailed as possible. The more information that + // the model has about what the tool is and how to use it, the better it will + // perform. You can use natural language descriptions to reinforce important + // aspects of the tool input JSON schema. + // + Description *string `json:"description,omitempty,omitzero"` + + // Enable eager input streaming for this tool. When true, tool input parameters + // will be streamed incrementally as they are generated, and types will be + // inferred + // on-the-fly rather than buffering the full JSON output. When false, streaming is + // disabled for this tool even if the fine-grained-tool-streaming beta is active. + // When null (default), uses the default behavior based on beta headers. + // + EagerInputStreaming *bool `json:"eager_input_streaming,omitempty,omitzero"` + + // Input examples configuration. See the linked native reference for semantics and + // availability. + InputExamples []AnthropicAPIToolParamInputExamplesElem `json:"input_examples,omitempty,omitzero"` + + // [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input. + // + // This defines the shape of the `input` that your tool accepts and that the model + // will produce. + // + InputSchema AnthropicAPIToolInputSchemaParam `json:"input_schema"` + + // Name of the tool. + // + // This is how the tool will be called by the model and in `tool_use` blocks. + // + Name string `json:"name"` + + // When true, guarantees schema validation on tool names and inputs + // + Strict *bool `json:"strict,omitempty,omitzero"` + + // Any of "custom". + // + Type *AnthropicAPIToolParamType `json:"type,omitempty,omitzero"` +} + +// Input examples value configuration. See the linked native reference for +// semantics and availability. +type AnthropicAPIToolParamInputExamplesElem map[string]interface{} + +type AnthropicAPIToolParamType string + +const AnthropicAPIToolParamTypeCustom AnthropicAPIToolParamType = "custom" + +// Tool reference block that can be included in tool_result content. +// +// The properties ToolName, Type are required. +type AnthropicAPIToolReferenceBlockParam struct { + // Create a cache control breakpoint at this content block. + // + CacheControl *AnthropicAPICacheControlEphemeralParam `json:"cache_control,omitempty,omitzero"` + + // Tool name configuration. See the linked native reference for semantics and + // availability. + ToolName string `json:"tool_name"` + + // This field can be elided, and will marshal its zero value as "tool_reference". + // + Type interface{} `json:"type"` +} + +// The properties ToolUseID, Type are required. +type AnthropicAPIToolResultBlockParam struct { + // Create a cache control breakpoint at this content block. + // + CacheControl *AnthropicAPICacheControlEphemeralParam `json:"cache_control,omitempty,omitzero"` + + // Content configuration. See the linked native reference for semantics and + // availability. + Content []AnthropicAPIToolResultBlockParamContentUnion `json:"content,omitempty,omitzero"` + + // Is error configuration. See the linked native reference for semantics and + // availability. + IsError *bool `json:"is_error,omitempty,omitzero"` + + // Tool use id configuration. See the linked native reference for semantics and + // availability. + ToolUseId string `json:"tool_use_id"` + + // This field can be elided, and will marshal its zero value as "tool_result". + // + Type interface{} `json:"type"` +} + +// Anthropic APITool Result Block Param Content Union configuration. See the linked +// native reference for semantics and availability. +type AnthropicAPIToolResultBlockParamContentUnion = json.RawMessage + +// The properties Name, Type are required. +type AnthropicAPIToolSearchToolBm2520251119Param struct { + // Any of "direct", "code_execution_20250825", "code_execution_20260120". + // + AllowedCallers []string `json:"allowed_callers,omitempty,omitzero"` + + // Create a cache control breakpoint at this content block. + // + CacheControl *AnthropicAPICacheControlEphemeralParam `json:"cache_control,omitempty,omitzero"` + + // If true, tool will not be included in initial system prompt. Only loaded when + // returned via tool_reference from tool search. + // + DeferLoading *bool `json:"defer_loading,omitempty,omitzero"` + + // Name of the tool. + // + // This is how the tool will be called by the model and in `tool_use` blocks. + // + // This field can be elided, and will marshal its zero value as + // "tool_search_tool_bm25". + // + Name interface{} `json:"name"` + + // When true, guarantees schema validation on tool names and inputs + // + Strict *bool `json:"strict,omitempty,omitzero"` + + // Any of "tool_search_tool_bm25_20251119", "tool_search_tool_bm25". + // + Type AnthropicAPIToolSearchToolBm2520251119ParamType `json:"type"` +} + +type AnthropicAPIToolSearchToolBm2520251119ParamType string + +const AnthropicAPIToolSearchToolBm2520251119ParamTypeToolSearchToolBm25 AnthropicAPIToolSearchToolBm2520251119ParamType = "tool_search_tool_bm25" +const AnthropicAPIToolSearchToolBm2520251119ParamTypeToolSearchToolBm2520251119 AnthropicAPIToolSearchToolBm2520251119ParamType = "tool_search_tool_bm25_20251119" + +// The properties Name, Type are required. +type AnthropicAPIToolSearchToolRegex20251119Param struct { + // Any of "direct", "code_execution_20250825", "code_execution_20260120". + // + AllowedCallers []string `json:"allowed_callers,omitempty,omitzero"` + + // Create a cache control breakpoint at this content block. + // + CacheControl *AnthropicAPICacheControlEphemeralParam `json:"cache_control,omitempty,omitzero"` + + // If true, tool will not be included in initial system prompt. Only loaded when + // returned via tool_reference from tool search. + // + DeferLoading *bool `json:"defer_loading,omitempty,omitzero"` + + // Name of the tool. + // + // This is how the tool will be called by the model and in `tool_use` blocks. + // + // This field can be elided, and will marshal its zero value as + // "tool_search_tool_regex". + // + Name interface{} `json:"name"` + + // When true, guarantees schema validation on tool names and inputs + // + Strict *bool `json:"strict,omitempty,omitzero"` + + // Any of "tool_search_tool_regex_20251119", "tool_search_tool_regex". + // + Type AnthropicAPIToolSearchToolRegex20251119ParamType `json:"type"` +} + +type AnthropicAPIToolSearchToolRegex20251119ParamType string + +const AnthropicAPIToolSearchToolRegex20251119ParamTypeToolSearchToolRegex AnthropicAPIToolSearchToolRegex20251119ParamType = "tool_search_tool_regex" +const AnthropicAPIToolSearchToolRegex20251119ParamTypeToolSearchToolRegex20251119 AnthropicAPIToolSearchToolRegex20251119ParamType = "tool_search_tool_regex_20251119" + +// The properties Content, ToolUseID, Type are required. +type AnthropicAPIToolSearchToolResultBlockParam struct { + // Create a cache control breakpoint at this content block. + // + CacheControl *AnthropicAPICacheControlEphemeralParam `json:"cache_control,omitempty,omitzero"` + + // Content configuration. See the linked native reference for semantics and + // availability. + Content AnthropicAPIToolSearchToolResultBlockParamContentUnion `json:"content"` + + // Tool use id configuration. See the linked native reference for semantics and + // availability. + ToolUseId string `json:"tool_use_id"` + + // This field can be elided, and will marshal its zero value as + // "tool_search_tool_result". + // + Type interface{} `json:"type"` +} + +// Anthropic APITool Search Tool Result Block Param Content Union configuration. +// See the linked native reference for semantics and availability. +type AnthropicAPIToolSearchToolResultBlockParamContentUnion = json.RawMessage + +// The properties ErrorCode, Type are required. +type AnthropicAPIToolSearchToolResultErrorParam struct { + // Any of "invalid_tool_input", "unavailable", "too_many_requests", + // "execution_time_exceeded". + // + ErrorCode AnthropicAPIToolSearchToolResultErrorParamErrorCode `json:"error_code"` + + // This field can be elided, and will marshal its zero value as + // "tool_search_tool_result_error". + // + Type interface{} `json:"type"` +} + +type AnthropicAPIToolSearchToolResultErrorParamErrorCode string + +const AnthropicAPIToolSearchToolResultErrorParamErrorCodeExecutionTimeExceeded AnthropicAPIToolSearchToolResultErrorParamErrorCode = "execution_time_exceeded" +const AnthropicAPIToolSearchToolResultErrorParamErrorCodeInvalidToolInput AnthropicAPIToolSearchToolResultErrorParamErrorCode = "invalid_tool_input" +const AnthropicAPIToolSearchToolResultErrorParamErrorCodeTooManyRequests AnthropicAPIToolSearchToolResultErrorParamErrorCode = "too_many_requests" +const AnthropicAPIToolSearchToolResultErrorParamErrorCodeUnavailable AnthropicAPIToolSearchToolResultErrorParamErrorCode = "unavailable" + +// The properties ToolReferences, Type are required. +type AnthropicAPIToolSearchToolSearchResultBlockParam struct { + // Tool references configuration. See the linked native reference for semantics + // and availability. + ToolReferences []AnthropicAPIToolReferenceBlockParam `json:"tool_references"` + + // This field can be elided, and will marshal its zero value as + // "tool_search_tool_search_result". + // + Type interface{} `json:"type"` +} + +// The properties Name, Type are required. +type AnthropicAPIToolTextEditor20250124Param struct { + // Any of "direct", "code_execution_20250825", "code_execution_20260120". + // + AllowedCallers []string `json:"allowed_callers,omitempty,omitzero"` + + // Create a cache control breakpoint at this content block. + // + CacheControl *AnthropicAPICacheControlEphemeralParam `json:"cache_control,omitempty,omitzero"` + + // If true, tool will not be included in initial system prompt. Only loaded when + // returned via tool_reference from tool search. + // + DeferLoading *bool `json:"defer_loading,omitempty,omitzero"` + + // Input examples configuration. See the linked native reference for semantics and + // availability. + InputExamples []AnthropicAPIToolTextEditor20250124ParamInputExamplesElem `json:"input_examples,omitempty,omitzero"` + + // Name of the tool. + // + // This is how the tool will be called by the model and in `tool_use` blocks. + // + // This field can be elided, and will marshal its zero value as + // "str_replace_editor". + // + Name interface{} `json:"name"` + + // When true, guarantees schema validation on tool names and inputs + // + Strict *bool `json:"strict,omitempty,omitzero"` + + // This field can be elided, and will marshal its zero value as + // "text_editor_20250124". + // + Type interface{} `json:"type"` +} + +// Input examples value configuration. See the linked native reference for +// semantics and availability. +type AnthropicAPIToolTextEditor20250124ParamInputExamplesElem map[string]interface{} + +// The properties Name, Type are required. +type AnthropicAPIToolTextEditor20250429Param struct { + // Any of "direct", "code_execution_20250825", "code_execution_20260120". + // + AllowedCallers []string `json:"allowed_callers,omitempty,omitzero"` + + // Create a cache control breakpoint at this content block. + // + CacheControl *AnthropicAPICacheControlEphemeralParam `json:"cache_control,omitempty,omitzero"` + + // If true, tool will not be included in initial system prompt. Only loaded when + // returned via tool_reference from tool search. + // + DeferLoading *bool `json:"defer_loading,omitempty,omitzero"` + + // Input examples configuration. See the linked native reference for semantics and + // availability. + InputExamples []AnthropicAPIToolTextEditor20250429ParamInputExamplesElem `json:"input_examples,omitempty,omitzero"` + + // Name of the tool. + // + // This is how the tool will be called by the model and in `tool_use` blocks. + // + // This field can be elided, and will marshal its zero value as + // "str_replace_based_edit_tool". + // + Name interface{} `json:"name"` + + // When true, guarantees schema validation on tool names and inputs + // + Strict *bool `json:"strict,omitempty,omitzero"` + + // This field can be elided, and will marshal its zero value as + // "text_editor_20250429". + // + Type interface{} `json:"type"` +} + +// Input examples value configuration. See the linked native reference for +// semantics and availability. +type AnthropicAPIToolTextEditor20250429ParamInputExamplesElem map[string]interface{} + +// The properties Name, Type are required. +type AnthropicAPIToolTextEditor20250728Param struct { + // Any of "direct", "code_execution_20250825", "code_execution_20260120". + // + AllowedCallers []string `json:"allowed_callers,omitempty,omitzero"` + + // Create a cache control breakpoint at this content block. + // + CacheControl *AnthropicAPICacheControlEphemeralParam `json:"cache_control,omitempty,omitzero"` + + // If true, tool will not be included in initial system prompt. Only loaded when + // returned via tool_reference from tool search. + // + DeferLoading *bool `json:"defer_loading,omitempty,omitzero"` + + // Input examples configuration. See the linked native reference for semantics and + // availability. + InputExamples []AnthropicAPIToolTextEditor20250728ParamInputExamplesElem `json:"input_examples,omitempty,omitzero"` + + // Maximum number of characters to display when viewing a file. If not specified, + // defaults to displaying the full file. + // + MaxCharacters *int `json:"max_characters,omitempty,omitzero"` + + // Name of the tool. + // + // This is how the tool will be called by the model and in `tool_use` blocks. + // + // This field can be elided, and will marshal its zero value as + // "str_replace_based_edit_tool". + // + Name interface{} `json:"name"` + + // When true, guarantees schema validation on tool names and inputs + // + Strict *bool `json:"strict,omitempty,omitzero"` + + // This field can be elided, and will marshal its zero value as + // "text_editor_20250728". + // + Type interface{} `json:"type"` +} + +// Input examples value configuration. See the linked native reference for +// semantics and availability. +type AnthropicAPIToolTextEditor20250728ParamInputExamplesElem map[string]interface{} + +// Anthropic APITool Union Param configuration. See the linked native reference for +// semantics and availability. +type AnthropicAPIToolUnionParam = json.RawMessage + +// The properties ID, Input, Name, Type are required. +type AnthropicAPIToolUseBlockParam struct { + // Create a cache control breakpoint at this content block. + // + CacheControl *AnthropicAPICacheControlEphemeralParam `json:"cache_control,omitempty,omitzero"` + + // Tool invocation directly from the model. + // + Caller *AnthropicAPIToolUseBlockParamCallerUnion `json:"caller,omitempty,omitzero"` + + // Id configuration. See the linked native reference for semantics and + // availability. + Id string `json:"id"` + + // Input configuration. See the linked native reference for semantics and + // availability. + Input interface{} `json:"input"` + + // Name configuration. See the linked native reference for semantics and + // availability. + Name string `json:"name"` + + // This field can be elided, and will marshal its zero value as "tool_use". + // + Type interface{} `json:"type"` +} + +// Anthropic APITool Use Block Param Caller Union configuration. See the linked +// native reference for semantics and availability. +type AnthropicAPIToolUseBlockParamCallerUnion = json.RawMessage + +// The properties Type, URL are required. +type AnthropicAPIURLImageSourceParam struct { + // This field can be elided, and will marshal its zero value as "url". + // + Type interface{} `json:"type"` + + // Url configuration. See the linked native reference for semantics and + // availability. + Url string `json:"url"` +} + +// The properties Type, URL are required. +type AnthropicAPIURLPDFSourceParam struct { + // This field can be elided, and will marshal its zero value as "url". + // + Type interface{} `json:"type"` + + // Url configuration. See the linked native reference for semantics and + // availability. + Url string `json:"url"` +} + +// The property Type is required. +type AnthropicAPIUserLocationParam struct { + // The city of the user. + // + City *string `json:"city,omitempty,omitzero"` + + // The two letter + // [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the + // user. + // + Country *string `json:"country,omitempty,omitzero"` + + // The region of the user. + // + Region *string `json:"region,omitempty,omitzero"` + + // The [IANA timezone](https://nodatime.org/TimeZones) of the user. + // + Timezone *string `json:"timezone,omitempty,omitzero"` + + // This field can be elided, and will marshal its zero value as "approximate". + // + Type interface{} `json:"type"` +} + +// The properties Content, Type, URL are required. +type AnthropicAPIWebFetchBlockParam struct { + // Content configuration. See the linked native reference for semantics and + // availability. + Content AnthropicAPIDocumentBlockParam `json:"content"` + + // ISO 8601 timestamp when the content was retrieved + // + RetrievedAt *string `json:"retrieved_at,omitempty,omitzero"` + + // This field can be elided, and will marshal its zero value as + // "web_fetch_result". + // + Type interface{} `json:"type"` + + // Fetched content URL + // + Url string `json:"url"` +} + +// The properties Name, Type are required. +type AnthropicAPIWebFetchTool20250910Param struct { + // Any of "direct", "code_execution_20250825", "code_execution_20260120". + // + AllowedCallers []string `json:"allowed_callers,omitempty,omitzero"` + + // List of domains to allow fetching from + // + AllowedDomains []string `json:"allowed_domains,omitempty,omitzero"` + + // List of domains to block fetching from + // + BlockedDomains []string `json:"blocked_domains,omitempty,omitzero"` + + // Create a cache control breakpoint at this content block. + // + CacheControl *AnthropicAPICacheControlEphemeralParam `json:"cache_control,omitempty,omitzero"` + + // Citations configuration for fetched documents. Citations are disabled by + // default. + // + Citations *AnthropicAPICitationsConfigParam `json:"citations,omitempty,omitzero"` + + // If true, tool will not be included in initial system prompt. Only loaded when + // returned via tool_reference from tool search. + // + DeferLoading *bool `json:"defer_loading,omitempty,omitzero"` + + // Maximum number of tokens used by including web page text content in the + // context. + // The limit is approximate and does not apply to binary content such as PDFs. + // + MaxContentTokens *int `json:"max_content_tokens,omitempty,omitzero"` + + // Maximum number of times the tool can be used in the API request. + // + MaxUses *int `json:"max_uses,omitempty,omitzero"` + + // Name of the tool. + // + // This is how the tool will be called by the model and in `tool_use` blocks. + // + // This field can be elided, and will marshal its zero value as "web_fetch". + // + Name interface{} `json:"name"` + + // When true, guarantees schema validation on tool names and inputs + // + Strict *bool `json:"strict,omitempty,omitzero"` + + // This field can be elided, and will marshal its zero value as + // "web_fetch_20250910". + // + Type interface{} `json:"type"` +} + +// The properties Name, Type are required. +type AnthropicAPIWebFetchTool20260209Param struct { + // Any of "direct", "code_execution_20250825", "code_execution_20260120". + // + AllowedCallers []string `json:"allowed_callers,omitempty,omitzero"` + + // List of domains to allow fetching from + // + AllowedDomains []string `json:"allowed_domains,omitempty,omitzero"` + + // List of domains to block fetching from + // + BlockedDomains []string `json:"blocked_domains,omitempty,omitzero"` + + // Create a cache control breakpoint at this content block. + // + CacheControl *AnthropicAPICacheControlEphemeralParam `json:"cache_control,omitempty,omitzero"` + + // Citations configuration for fetched documents. Citations are disabled by + // default. + // + Citations *AnthropicAPICitationsConfigParam `json:"citations,omitempty,omitzero"` + + // If true, tool will not be included in initial system prompt. Only loaded when + // returned via tool_reference from tool search. + // + DeferLoading *bool `json:"defer_loading,omitempty,omitzero"` + + // Maximum number of tokens used by including web page text content in the + // context. + // The limit is approximate and does not apply to binary content such as PDFs. + // + MaxContentTokens *int `json:"max_content_tokens,omitempty,omitzero"` + + // Maximum number of times the tool can be used in the API request. + // + MaxUses *int `json:"max_uses,omitempty,omitzero"` + + // Name of the tool. + // + // This is how the tool will be called by the model and in `tool_use` blocks. + // + // This field can be elided, and will marshal its zero value as "web_fetch". + // + Name interface{} `json:"name"` + + // When true, guarantees schema validation on tool names and inputs + // + Strict *bool `json:"strict,omitempty,omitzero"` + + // This field can be elided, and will marshal its zero value as + // "web_fetch_20260209". + // + Type interface{} `json:"type"` +} + +// The properties Content, ToolUseID, Type are required. +type AnthropicAPIWebFetchToolResultBlockParam struct { + // Create a cache control breakpoint at this content block. + // + CacheControl *AnthropicAPICacheControlEphemeralParam `json:"cache_control,omitempty,omitzero"` + + // Tool invocation directly from the model. + // + Caller *AnthropicAPIWebFetchToolResultBlockParamCallerUnion `json:"caller,omitempty,omitzero"` + + // Content configuration. See the linked native reference for semantics and + // availability. + Content AnthropicAPIWebFetchToolResultBlockParamContentUnion `json:"content"` + + // Tool use id configuration. See the linked native reference for semantics and + // availability. + ToolUseId string `json:"tool_use_id"` + + // This field can be elided, and will marshal its zero value as + // "web_fetch_tool_result". + // + Type interface{} `json:"type"` +} + +// Anthropic APIWeb Fetch Tool Result Block Param Caller Union configuration. See +// the linked native reference for semantics and availability. +type AnthropicAPIWebFetchToolResultBlockParamCallerUnion = json.RawMessage + +// Anthropic APIWeb Fetch Tool Result Block Param Content Union configuration. See +// the linked native reference for semantics and availability. +type AnthropicAPIWebFetchToolResultBlockParamContentUnion = json.RawMessage + +// The properties ErrorCode, Type are required. +type AnthropicAPIWebFetchToolResultErrorBlockParam struct { + // Any of "invalid_tool_input", "url_too_long", "url_not_allowed", + // "url_not_accessible", "unsupported_content_type", "too_many_requests", + // "max_uses_exceeded", "unavailable". + // + ErrorCode AnthropicAPIWebFetchToolResultErrorBlockParamErrorCode `json:"error_code"` + + // This field can be elided, and will marshal its zero value as + // "web_fetch_tool_result_error". + // + Type interface{} `json:"type"` +} + +type AnthropicAPIWebFetchToolResultErrorBlockParamErrorCode string + +const AnthropicAPIWebFetchToolResultErrorBlockParamErrorCodeInvalidToolInput AnthropicAPIWebFetchToolResultErrorBlockParamErrorCode = "invalid_tool_input" +const AnthropicAPIWebFetchToolResultErrorBlockParamErrorCodeMaxUsesExceeded AnthropicAPIWebFetchToolResultErrorBlockParamErrorCode = "max_uses_exceeded" +const AnthropicAPIWebFetchToolResultErrorBlockParamErrorCodeTooManyRequests AnthropicAPIWebFetchToolResultErrorBlockParamErrorCode = "too_many_requests" +const AnthropicAPIWebFetchToolResultErrorBlockParamErrorCodeUnavailable AnthropicAPIWebFetchToolResultErrorBlockParamErrorCode = "unavailable" +const AnthropicAPIWebFetchToolResultErrorBlockParamErrorCodeUnsupportedContentType AnthropicAPIWebFetchToolResultErrorBlockParamErrorCode = "unsupported_content_type" +const AnthropicAPIWebFetchToolResultErrorBlockParamErrorCodeUrlNotAccessible AnthropicAPIWebFetchToolResultErrorBlockParamErrorCode = "url_not_accessible" +const AnthropicAPIWebFetchToolResultErrorBlockParamErrorCodeUrlNotAllowed AnthropicAPIWebFetchToolResultErrorBlockParamErrorCode = "url_not_allowed" +const AnthropicAPIWebFetchToolResultErrorBlockParamErrorCodeUrlTooLong AnthropicAPIWebFetchToolResultErrorBlockParamErrorCode = "url_too_long" + +// The properties EncryptedContent, Title, Type, URL are required. +type AnthropicAPIWebSearchResultBlockParam struct { + // Encrypted content configuration. See the linked native reference for semantics + // and availability. + EncryptedContent string `json:"encrypted_content"` + + // Page age configuration. See the linked native reference for semantics and + // availability. + PageAge *string `json:"page_age,omitempty,omitzero"` + + // Title configuration. See the linked native reference for semantics and + // availability. + Title string `json:"title"` + + // This field can be elided, and will marshal its zero value as + // "web_search_result". + // + Type interface{} `json:"type"` + + // Url configuration. See the linked native reference for semantics and + // availability. + Url string `json:"url"` +} + +// The properties Name, Type are required. +type AnthropicAPIWebSearchTool20250305Param struct { + // Any of "direct", "code_execution_20250825", "code_execution_20260120". + // + AllowedCallers []string `json:"allowed_callers,omitempty,omitzero"` + + // If provided, only these domains will be included in results. Cannot be used + // alongside `blocked_domains`. + // + AllowedDomains []string `json:"allowed_domains,omitempty,omitzero"` + + // If provided, these domains will never appear in results. Cannot be used + // alongside `allowed_domains`. + // + BlockedDomains []string `json:"blocked_domains,omitempty,omitzero"` + + // Create a cache control breakpoint at this content block. + // + CacheControl *AnthropicAPICacheControlEphemeralParam `json:"cache_control,omitempty,omitzero"` + + // If true, tool will not be included in initial system prompt. Only loaded when + // returned via tool_reference from tool search. + // + DeferLoading *bool `json:"defer_loading,omitempty,omitzero"` + + // Maximum number of times the tool can be used in the API request. + // + MaxUses *int `json:"max_uses,omitempty,omitzero"` + + // Name of the tool. + // + // This is how the tool will be called by the model and in `tool_use` blocks. + // + // This field can be elided, and will marshal its zero value as "web_search". + // + Name interface{} `json:"name"` + + // When true, guarantees schema validation on tool names and inputs + // + Strict *bool `json:"strict,omitempty,omitzero"` + + // This field can be elided, and will marshal its zero value as + // "web_search_20250305". + // + Type interface{} `json:"type"` + + // Parameters for the user's location. Used to provide more relevant search + // results. + // + UserLocation *AnthropicAPIUserLocationParam `json:"user_location,omitempty,omitzero"` +} + +// The properties Name, Type are required. +type AnthropicAPIWebSearchTool20260209Param struct { + // Any of "direct", "code_execution_20250825", "code_execution_20260120". + // + AllowedCallers []string `json:"allowed_callers,omitempty,omitzero"` + + // If provided, only these domains will be included in results. Cannot be used + // alongside `blocked_domains`. + // + AllowedDomains []string `json:"allowed_domains,omitempty,omitzero"` + + // If provided, these domains will never appear in results. Cannot be used + // alongside `allowed_domains`. + // + BlockedDomains []string `json:"blocked_domains,omitempty,omitzero"` + + // Create a cache control breakpoint at this content block. + // + CacheControl *AnthropicAPICacheControlEphemeralParam `json:"cache_control,omitempty,omitzero"` + + // If true, tool will not be included in initial system prompt. Only loaded when + // returned via tool_reference from tool search. + // + DeferLoading *bool `json:"defer_loading,omitempty,omitzero"` + + // Maximum number of times the tool can be used in the API request. + // + MaxUses *int `json:"max_uses,omitempty,omitzero"` + + // Name of the tool. + // + // This is how the tool will be called by the model and in `tool_use` blocks. + // + // This field can be elided, and will marshal its zero value as "web_search". + // + Name interface{} `json:"name"` + + // When true, guarantees schema validation on tool names and inputs + // + Strict *bool `json:"strict,omitempty,omitzero"` + + // This field can be elided, and will marshal its zero value as + // "web_search_20260209". + // + Type interface{} `json:"type"` + + // Parameters for the user's location. Used to provide more relevant search + // results. + // + UserLocation *AnthropicAPIUserLocationParam `json:"user_location,omitempty,omitzero"` +} + +// The properties ErrorCode, Type are required. +type AnthropicAPIWebSearchToolRequestErrorParam struct { + // Any of "invalid_tool_input", "unavailable", "max_uses_exceeded", + // "too_many_requests", "query_too_long", "request_too_large". + // + ErrorCode AnthropicAPIWebSearchToolRequestErrorParamErrorCode `json:"error_code"` + + // This field can be elided, and will marshal its zero value as + // "web_search_tool_result_error". + // + Type interface{} `json:"type"` +} + +type AnthropicAPIWebSearchToolRequestErrorParamErrorCode string + +const AnthropicAPIWebSearchToolRequestErrorParamErrorCodeInvalidToolInput AnthropicAPIWebSearchToolRequestErrorParamErrorCode = "invalid_tool_input" +const AnthropicAPIWebSearchToolRequestErrorParamErrorCodeMaxUsesExceeded AnthropicAPIWebSearchToolRequestErrorParamErrorCode = "max_uses_exceeded" +const AnthropicAPIWebSearchToolRequestErrorParamErrorCodeQueryTooLong AnthropicAPIWebSearchToolRequestErrorParamErrorCode = "query_too_long" +const AnthropicAPIWebSearchToolRequestErrorParamErrorCodeRequestTooLarge AnthropicAPIWebSearchToolRequestErrorParamErrorCode = "request_too_large" +const AnthropicAPIWebSearchToolRequestErrorParamErrorCodeTooManyRequests AnthropicAPIWebSearchToolRequestErrorParamErrorCode = "too_many_requests" +const AnthropicAPIWebSearchToolRequestErrorParamErrorCodeUnavailable AnthropicAPIWebSearchToolRequestErrorParamErrorCode = "unavailable" + +// The properties Content, ToolUseID, Type are required. +type AnthropicAPIWebSearchToolResultBlockParam struct { + // Create a cache control breakpoint at this content block. + // + CacheControl *AnthropicAPICacheControlEphemeralParam `json:"cache_control,omitempty,omitzero"` + + // Tool invocation directly from the model. + // + Caller *AnthropicAPIWebSearchToolResultBlockParamCallerUnion `json:"caller,omitempty,omitzero"` + + // Content configuration. See the linked native reference for semantics and + // availability. + Content AnthropicAPIWebSearchToolResultBlockParamContentUnion `json:"content"` + + // Tool use id configuration. See the linked native reference for semantics and + // availability. + ToolUseId string `json:"tool_use_id"` + + // This field can be elided, and will marshal its zero value as + // "web_search_tool_result". + // + Type interface{} `json:"type"` +} + +// Anthropic APIWeb Search Tool Result Block Param Caller Union configuration. See +// the linked native reference for semantics and availability. +type AnthropicAPIWebSearchToolResultBlockParamCallerUnion = json.RawMessage + +// Anthropic APIWeb Search Tool Result Block Param Content Union configuration. See +// the linked native reference for semantics and availability. +type AnthropicAPIWebSearchToolResultBlockParamContentUnion = json.RawMessage diff --git a/pkg/adapters/zz_generated_anthropic_cli.go b/pkg/adapters/zz_generated_anthropic_cli.go index 969aa97e..f5b69f50 100644 --- a/pkg/adapters/zz_generated_anthropic_cli.go +++ b/pkg/adapters/zz_generated_anthropic_cli.go @@ -60,6 +60,9 @@ type AnthropicCLIOptions struct { // Path receiving Claude Code diagnostic logs. DebugFile *string `json:"debugFile,omitempty,omitzero"` + // Open a continued or resumed session in the Claude Desktop application. + Desktop *bool `json:"desktop,omitempty,omitzero"` + // Whether skills and slash commands are disabled. DisableSlashCommands *bool `json:"disableSlashCommands,omitempty,omitzero"` diff --git a/pkg/adapters/zz_generated_deepseek_api.go b/pkg/adapters/zz_generated_deepseek_api.go index f534bf97..07521359 100644 --- a/pkg/adapters/zz_generated_deepseek_api.go +++ b/pkg/adapters/zz_generated_deepseek_api.go @@ -7,38 +7,98 @@ import "encoding/json" // Native DeepSeek Chat Completions request options used by Captain's // OpenAI-compatible API runtime. type DeepSeekAPIOptions struct { + // Audio configuration. See the linked native reference for semantics and + // availability. + Audio *DeepseekAPIChatCompletionAudioParam `json:"audio,omitempty,omitzero"` + // Deprecated penalty based on how frequently a token has appeared. FrequencyPenalty *float64 `json:"frequency_penalty,omitempty,omitzero"` + // Function call configuration. See the linked native reference for semantics and + // availability. + FunctionCall *DeepseekAPIChatCompletionNewParamsFunctionCallUnion `json:"function_call,omitempty,omitzero"` + + // Functions configuration. See the linked native reference for semantics and + // availability. + Functions []DeepseekAPIChatCompletionNewParamsFunction `json:"functions,omitempty,omitzero"` + + // Logit bias configuration. See the linked native reference for semantics and + // availability. + LogitBias DeepSeekAPIOptionsLogitBias `json:"logit_bias,omitempty,omitzero"` + // Whether token log probabilities are included in the response. Logprobs *bool `json:"logprobs,omitempty,omitzero"` + // Max completion tokens configuration. See the linked native reference for + // semantics and availability. + MaxCompletionTokens *int `json:"max_completion_tokens,omitempty,omitzero"` + // Maximum number of tokens generated in the completion. MaxTokens *int `json:"max_tokens,omitempty,omitzero"` // Conversation messages and tool results sent to DeepSeek. - Messages json.RawMessage `json:"messages"` + Messages []DeepseekAPIChatCompletionMessageParamUnion `json:"messages"` + + // Metadata configuration. See the linked native reference for semantics and + // availability. + Metadata DeepSeekAPIOptionsMetadata `json:"metadata,omitempty,omitzero"` + + // Modalities configuration. See the linked native reference for semantics and + // availability. + Modalities []string `json:"modalities,omitempty,omitzero"` // DeepSeek chat or reasoner model identifier. Model DeepSeekAPIOptionsModel `json:"model"` + // N configuration. See the linked native reference for semantics and + // availability. + N *int `json:"n,omitempty,omitzero"` + + // Parallel tool calls configuration. See the linked native reference for + // semantics and availability. + ParallelToolCalls *bool `json:"parallel_tool_calls,omitempty,omitzero"` + + // Prediction configuration. See the linked native reference for semantics and + // availability. + Prediction *DeepseekAPIChatCompletionPredictionContentParam `json:"prediction,omitempty,omitzero"` + // Deprecated penalty based on whether a token has appeared. PresencePenalty *float64 `json:"presence_penalty,omitempty,omitzero"` + // Prompt cache key configuration. See the linked native reference for semantics + // and availability. + PromptCacheKey *string `json:"prompt_cache_key,omitempty,omitzero"` + // Relative reasoning effort requested from supported DeepSeek models. ReasoningEffort *DeepSeekAPIOptionsReasoningEffort `json:"reasoning_effort,omitempty,omitzero"` // Plain-text or JSON-object response format. - ResponseFormat *json.RawMessage `json:"response_format,omitempty,omitzero"` + ResponseFormat *DeepseekAPIChatCompletionNewParamsResponseFormatUnion `json:"response_format,omitempty,omitzero"` + + // Safety identifier configuration. See the linked native reference for semantics + // and availability. + SafetyIdentifier *string `json:"safety_identifier,omitempty,omitzero"` + + // Seed configuration. See the linked native reference for semantics and + // availability. + Seed *int `json:"seed,omitempty,omitzero"` + + // Service tier configuration. See the linked native reference for semantics and + // availability. + ServiceTier *DeepSeekAPIOptionsServiceTier `json:"service_tier,omitempty,omitzero"` // One or more text sequences that stop token generation. - Stop *json.RawMessage `json:"stop,omitempty,omitzero"` + Stop *DeepseekAPIChatCompletionNewParamsStopUnion `json:"stop,omitempty,omitzero"` + + // Store configuration. See the linked native reference for semantics and + // availability. + Store *bool `json:"store,omitempty,omitzero"` // Whether the completion is returned as server-sent streaming events. Stream *bool `json:"stream,omitempty,omitzero"` // Additional behavior such as including a final usage chunk in the stream. - StreamOptions *json.RawMessage `json:"stream_options,omitempty,omitzero"` + StreamOptions *DeepseekAPIChatCompletionStreamOptionsParam `json:"stream_options,omitempty,omitzero"` // Sampling temperature between zero and two. Temperature *float64 `json:"temperature,omitempty,omitzero"` @@ -47,10 +107,10 @@ type DeepSeekAPIOptions struct { Thinking *json.RawMessage `json:"thinking,omitempty,omitzero"` // Policy selecting whether and which function tool the model may call. - ToolChoice *json.RawMessage `json:"tool_choice,omitempty,omitzero"` + ToolChoice *DeepseekAPIChatCompletionToolChoiceOptionUnionParam `json:"tool_choice,omitempty,omitzero"` // Function tool definitions derived from Captain caller tools. - Tools *json.RawMessage `json:"tools,omitempty,omitzero"` + Tools []DeepseekAPIChatCompletionToolParam `json:"tools,omitempty,omitzero"` // Number of likely tokens returned with log probabilities at each position. TopLogprobs *int `json:"top_logprobs,omitempty,omitzero"` @@ -58,10 +118,26 @@ type DeepSeekAPIOptions struct { // Cumulative probability mass retained during nucleus sampling. TopP *float64 `json:"top_p,omitempty,omitzero"` + // User configuration. See the linked native reference for semantics and + // availability. + User *string `json:"user,omitempty,omitzero"` + // Stable end-user identifier used by DeepSeek for abuse detection. UserId *string `json:"user_id,omitempty,omitzero"` + + // Web search options configuration. See the linked native reference for semantics + // and availability. + WebSearchOptions *DeepseekAPIChatCompletionNewParamsWebSearchOptions `json:"web_search_options,omitempty,omitzero"` } +// Logit bias configuration. See the linked native reference for semantics and +// availability. +type DeepSeekAPIOptionsLogitBias map[string]int + +// Metadata configuration. See the linked native reference for semantics and +// availability. +type DeepSeekAPIOptionsMetadata map[string]string + type DeepSeekAPIOptionsModel string const DeepSeekAPIOptionsModelDeepseekChat DeepSeekAPIOptionsModel = "deepseek-chat" @@ -71,6 +147,707 @@ type DeepSeekAPIOptionsReasoningEffort string const DeepSeekAPIOptionsReasoningEffortHigh DeepSeekAPIOptionsReasoningEffort = "high" const DeepSeekAPIOptionsReasoningEffortLow DeepSeekAPIOptionsReasoningEffort = "low" -const DeepSeekAPIOptionsReasoningEffortMax DeepSeekAPIOptionsReasoningEffort = "max" const DeepSeekAPIOptionsReasoningEffortMedium DeepSeekAPIOptionsReasoningEffort = "medium" -const DeepSeekAPIOptionsReasoningEffortXhigh DeepSeekAPIOptionsReasoningEffort = "xhigh" + +type DeepSeekAPIOptionsServiceTier string + +const DeepSeekAPIOptionsServiceTierAuto DeepSeekAPIOptionsServiceTier = "auto" +const DeepSeekAPIOptionsServiceTierDefault DeepSeekAPIOptionsServiceTier = "default" +const DeepSeekAPIOptionsServiceTierFlex DeepSeekAPIOptionsServiceTier = "flex" +const DeepSeekAPIOptionsServiceTierPriority DeepSeekAPIOptionsServiceTier = "priority" +const DeepSeekAPIOptionsServiceTierScale DeepSeekAPIOptionsServiceTier = "scale" + +// Messages sent by the model in response to user messages. +// +// The property Role is required. +type DeepseekAPIChatCompletionAssistantMessageParam struct { + // Data about a previous audio response from the model. + // [Learn more](https://platform.openai.com/docs/guides/audio). + // + Audio *DeepseekAPIChatCompletionAssistantMessageParamAudio `json:"audio,omitempty,omitzero"` + + // The contents of the assistant message. Required unless `tool_calls` or + // `function_call` is specified. + // + Content *DeepseekAPIChatCompletionAssistantMessageParamContentUnion `json:"content,omitempty,omitzero"` + + // Deprecated and replaced by `tool_calls`. The name and arguments of a function + // that should be called, as generated by the model. + // + // Deprecated: deprecated + // + FunctionCall *DeepseekAPIChatCompletionAssistantMessageParamFunctionCall `json:"function_call,omitempty,omitzero"` + + // An optional name for the participant. Provides the model information to + // differentiate between participants of the same role. + // + Name *string `json:"name,omitempty,omitzero"` + + // The refusal message by the assistant. + // + Refusal *string `json:"refusal,omitempty,omitzero"` + + // The role of the messages author, in this case `assistant`. + // + // This field can be elided, and will marshal its zero value as "assistant". + // + Role interface{} `json:"role"` + + // The tool calls generated by the model, such as function calls. + // + ToolCalls []DeepseekAPIChatCompletionMessageToolCallParam `json:"tool_calls,omitempty,omitzero"` +} + +// Data about a previous audio response from the model. +// [Learn more](https://platform.openai.com/docs/guides/audio). +// +// The property ID is required. +type DeepseekAPIChatCompletionAssistantMessageParamAudio struct { + // Unique identifier for a previous audio response from the model. + // + Id string `json:"id"` +} + +// DeepSeek APIChat Completion Assistant Message Param Content Array Of Content +// Part Union configuration. See the linked native reference for semantics and +// availability. +type DeepseekAPIChatCompletionAssistantMessageParamContentArrayOfContentPartUnion = json.RawMessage + +// DeepSeek APIChat Completion Assistant Message Param Content Union configuration. +// See the linked native reference for semantics and availability. +type DeepseekAPIChatCompletionAssistantMessageParamContentUnion = json.RawMessage + +// Deprecated and replaced by `tool_calls`. The name and arguments of a function +// that should be called, as generated by the model. +// +// Deprecated: deprecated +// +// The properties Arguments, Name are required. +type DeepseekAPIChatCompletionAssistantMessageParamFunctionCall struct { + // The arguments to call the function with, as generated by the model in JSON + // format. Note that the model does not always generate valid JSON, and may + // hallucinate parameters not defined by your function schema. Validate the + // arguments in your code before calling your function. + // + Arguments string `json:"arguments"` + + // The name of the function to call. + // + Name string `json:"name"` +} + +// Parameters for audio output. Required when audio output is requested with +// `modalities: ["audio"]`. +// [Learn more](https://platform.openai.com/docs/guides/audio). +// +// The properties Format, Voice are required. +type DeepseekAPIChatCompletionAudioParam struct { + // Specifies the output audio format. Must be one of `wav`, `mp3`, `flac`, `opus`, + // or `pcm16`. + // + // Any of "wav", "aac", "mp3", "flac", "opus", "pcm16". + // + Format DeepseekAPIChatCompletionAudioParamFormat `json:"format"` + + // The voice the model uses to respond. Supported voices are `alloy`, `ash`, + // `ballad`, `coral`, `echo`, `fable`, `nova`, `onyx`, `sage`, and `shimmer`. + // + Voice DeepseekAPIChatCompletionAudioParamVoice `json:"voice"` +} + +type DeepseekAPIChatCompletionAudioParamFormat string + +const DeepseekAPIChatCompletionAudioParamFormatAac DeepseekAPIChatCompletionAudioParamFormat = "aac" +const DeepseekAPIChatCompletionAudioParamFormatFlac DeepseekAPIChatCompletionAudioParamFormat = "flac" +const DeepseekAPIChatCompletionAudioParamFormatMp3 DeepseekAPIChatCompletionAudioParamFormat = "mp3" +const DeepseekAPIChatCompletionAudioParamFormatOpus DeepseekAPIChatCompletionAudioParamFormat = "opus" +const DeepseekAPIChatCompletionAudioParamFormatPcm16 DeepseekAPIChatCompletionAudioParamFormat = "pcm16" +const DeepseekAPIChatCompletionAudioParamFormatWav DeepseekAPIChatCompletionAudioParamFormat = "wav" + +type DeepseekAPIChatCompletionAudioParamVoice string + +const DeepseekAPIChatCompletionAudioParamVoiceAlloy DeepseekAPIChatCompletionAudioParamVoice = "alloy" +const DeepseekAPIChatCompletionAudioParamVoiceAsh DeepseekAPIChatCompletionAudioParamVoice = "ash" +const DeepseekAPIChatCompletionAudioParamVoiceBallad DeepseekAPIChatCompletionAudioParamVoice = "ballad" +const DeepseekAPIChatCompletionAudioParamVoiceCoral DeepseekAPIChatCompletionAudioParamVoice = "coral" +const DeepseekAPIChatCompletionAudioParamVoiceEcho DeepseekAPIChatCompletionAudioParamVoice = "echo" +const DeepseekAPIChatCompletionAudioParamVoiceSage DeepseekAPIChatCompletionAudioParamVoice = "sage" +const DeepseekAPIChatCompletionAudioParamVoiceShimmer DeepseekAPIChatCompletionAudioParamVoice = "shimmer" +const DeepseekAPIChatCompletionAudioParamVoiceVerse DeepseekAPIChatCompletionAudioParamVoice = "verse" + +// DeepSeek APIChat Completion Content Part File File Param configuration. See the +// linked native reference for semantics and availability. +type DeepseekAPIChatCompletionContentPartFileFileParam struct { + // The base64 encoded file data, used when passing the file to the model as a + // string. + // + FileData *string `json:"file_data,omitempty,omitzero"` + + // The ID of an uploaded file to use as input. + // + FileId *string `json:"file_id,omitempty,omitzero"` + + // The name of the file, used when passing the file to the model as a string. + // + Filename *string `json:"filename,omitempty,omitzero"` +} + +// Learn about [file inputs](https://platform.openai.com/docs/guides/text) for text +// generation. +// +// The properties File, Type are required. +type DeepseekAPIChatCompletionContentPartFileParam struct { + // File configuration. See the linked native reference for semantics and + // availability. + File DeepseekAPIChatCompletionContentPartFileFileParam `json:"file"` + + // The type of the content part. Always `file`. + // + // This field can be elided, and will marshal its zero value as "file". + // + Type interface{} `json:"type"` +} + +// The property URL is required. +type DeepseekAPIChatCompletionContentPartImageImageURLParam struct { + // Specifies the detail level of the image. Learn more in the + // [Vision + // guide](https://platform.openai.com/docs/guides/vision#low-or-high-fidelity-image-understanding). + // + // Any of "auto", "low", "high". + // + Detail *string `json:"detail,omitempty,omitzero"` + + // Either a URL of the image or the base64 encoded image data. + // + Url string `json:"url"` +} + +// Learn about [image inputs](https://platform.openai.com/docs/guides/vision). +// +// The properties ImageURL, Type are required. +type DeepseekAPIChatCompletionContentPartImageParam struct { + // Image url configuration. See the linked native reference for semantics and + // availability. + ImageUrl DeepseekAPIChatCompletionContentPartImageImageURLParam `json:"image_url"` + + // The type of the content part. + // + // This field can be elided, and will marshal its zero value as "image_url". + // + Type interface{} `json:"type"` +} + +// The properties Data, Format are required. +type DeepseekAPIChatCompletionContentPartInputAudioInputAudioParam struct { + // Base64 encoded audio data. + // + Data string `json:"data"` + + // The format of the encoded audio data. Currently supports "wav" and "mp3". + // + // Any of "wav", "mp3". + // + Format string `json:"format"` +} + +// Learn about [audio inputs](https://platform.openai.com/docs/guides/audio). +// +// The properties InputAudio, Type are required. +type DeepseekAPIChatCompletionContentPartInputAudioParam struct { + // Input audio configuration. See the linked native reference for semantics and + // availability. + InputAudio DeepseekAPIChatCompletionContentPartInputAudioInputAudioParam `json:"input_audio"` + + // The type of the content part. Always `input_audio`. + // + // This field can be elided, and will marshal its zero value as "input_audio". + // + Type interface{} `json:"type"` +} + +// The properties Refusal, Type are required. +type DeepseekAPIChatCompletionContentPartRefusalParam struct { + // The refusal message generated by the model. + // + Refusal string `json:"refusal"` + + // The type of the content part. + // + // This field can be elided, and will marshal its zero value as "refusal". + // + Type interface{} `json:"type"` +} + +// Learn about +// [text inputs](https://platform.openai.com/docs/guides/text-generation). +// +// The properties Text, Type are required. +type DeepseekAPIChatCompletionContentPartTextParam struct { + // The text content. + // + Text string `json:"text"` + + // The type of the content part. + // + // This field can be elided, and will marshal its zero value as "text". + // + Type interface{} `json:"type"` +} + +// DeepSeek APIChat Completion Content Part Union Param configuration. See the +// linked native reference for semantics and availability. +type DeepseekAPIChatCompletionContentPartUnionParam = json.RawMessage + +// Developer-provided instructions that the model should follow, regardless of +// messages sent by the user. With o1 models and newer, `developer` messages +// replace the previous `system` messages. +// +// The properties Content, Role are required. +type DeepseekAPIChatCompletionDeveloperMessageParam struct { + // The contents of the developer message. + // + Content DeepseekAPIChatCompletionDeveloperMessageParamContentUnion `json:"content"` + + // An optional name for the participant. Provides the model information to + // differentiate between participants of the same role. + // + Name *string `json:"name,omitempty,omitzero"` + + // The role of the messages author, in this case `developer`. + // + // This field can be elided, and will marshal its zero value as "developer". + // + Role interface{} `json:"role"` +} + +// DeepSeek APIChat Completion Developer Message Param Content Union configuration. +// See the linked native reference for semantics and availability. +type DeepseekAPIChatCompletionDeveloperMessageParamContentUnion = json.RawMessage + +// Specifying a particular function via `{"name": "my_function"}` forces the model +// to call that function. +// +// The property Name is required. +type DeepseekAPIChatCompletionFunctionCallOptionParam struct { + // The name of the function to call. + // + Name string `json:"name"` +} + +// Deprecated: deprecated +// +// The properties Content, Name, Role are required. +type DeepseekAPIChatCompletionFunctionMessageParam struct { + // The contents of the function message. + // + Content string `json:"content"` + + // The name of the function to call. + // + Name string `json:"name"` + + // The role of the messages author, in this case `function`. + // + // This field can be elided, and will marshal its zero value as "function". + // + Role interface{} `json:"role"` +} + +// DeepSeek APIChat Completion Message Param Union configuration. See the linked +// native reference for semantics and availability. +type DeepseekAPIChatCompletionMessageParamUnion = json.RawMessage + +// The function that the model called. +// +// The properties Arguments, Name are required. +type DeepseekAPIChatCompletionMessageToolCallFunctionParam struct { + // The arguments to call the function with, as generated by the model in JSON + // format. Note that the model does not always generate valid JSON, and may + // hallucinate parameters not defined by your function schema. Validate the + // arguments in your code before calling your function. + // + Arguments string `json:"arguments"` + + // The name of the function to call. + // + Name string `json:"name"` +} + +// The properties ID, Function, Type are required. +type DeepseekAPIChatCompletionMessageToolCallParam struct { + // The function that the model called. + // + Function DeepseekAPIChatCompletionMessageToolCallFunctionParam `json:"function"` + + // The ID of the tool call. + // + Id string `json:"id"` + + // The type of the tool. Currently, only `function` is supported. + // + // This field can be elided, and will marshal its zero value as "function". + // + Type interface{} `json:"type"` +} + +// The property Name is required. +type DeepseekAPIChatCompletionNamedToolChoiceFunctionParam struct { + // The name of the function to call. + // + Name string `json:"name"` +} + +// Specifies a tool the model should use. Use to force the model to call a specific +// function. +// +// The properties Function, Type are required. +type DeepseekAPIChatCompletionNamedToolChoiceParam struct { + // Function configuration. See the linked native reference for semantics and + // availability. + Function DeepseekAPIChatCompletionNamedToolChoiceFunctionParam `json:"function"` + + // The type of the tool. Currently, only `function` is supported. + // + // This field can be elided, and will marshal its zero value as "function". + // + Type interface{} `json:"type"` +} + +// Deprecated: deprecated +// +// The property Name is required. +type DeepseekAPIChatCompletionNewParamsFunction struct { + // A description of what the function does, used by the model to choose when and + // how to call the function. + // + Description *string `json:"description,omitempty,omitzero"` + + // The name of the function to be called. Must be a-z, A-Z, 0-9, or contain + // underscores and dashes, with a maximum length of 64. + // + Name string `json:"name"` + + // The parameters the functions accepts, described as a JSON Schema object. See + // the + // [guide](https://platform.openai.com/docs/guides/function-calling) for examples, + // and the + // [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for + // documentation about the format. + // + // Omitting `parameters` defines a function with an empty parameter list. + // + Parameters DeepseekAPIChatCompletionNewParamsFunctionParameters `json:"parameters,omitempty,omitzero"` +} + +// DeepSeek APIChat Completion New Params Function Call Union configuration. See +// the linked native reference for semantics and availability. +type DeepseekAPIChatCompletionNewParamsFunctionCallUnion = json.RawMessage + +// The parameters the functions accepts, described as a JSON Schema object. See the +// [guide](https://platform.openai.com/docs/guides/function-calling) for examples, +// and the +// [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for +// documentation about the format. +// +// Omitting `parameters` defines a function with an empty parameter list. +type DeepseekAPIChatCompletionNewParamsFunctionParameters map[string]interface{} + +// DeepSeek APIChat Completion New Params Response Format Union configuration. See +// the linked native reference for semantics and availability. +type DeepseekAPIChatCompletionNewParamsResponseFormatUnion = json.RawMessage + +// DeepSeek APIChat Completion New Params Stop Union configuration. See the linked +// native reference for semantics and availability. +type DeepseekAPIChatCompletionNewParamsStopUnion = json.RawMessage + +// This tool searches the web for relevant results to use in a response. Learn more +// about the +// [web search +// tool](https://platform.openai.com/docs/guides/tools-web-search?api-mode=chat). +type DeepseekAPIChatCompletionNewParamsWebSearchOptions struct { + // High level guidance for the amount of context window space to use for the + // search. One of `low`, `medium`, or `high`. `medium` is the default. + // + // Any of "low", "medium", "high". + // + SearchContextSize *string `json:"search_context_size,omitempty,omitzero"` + + // Approximate location parameters for the search. + // + UserLocation *DeepseekAPIChatCompletionNewParamsWebSearchOptionsUserLocation `json:"user_location,omitempty,omitzero"` +} + +// Approximate location parameters for the search. +// +// The properties Approximate, Type are required. +type DeepseekAPIChatCompletionNewParamsWebSearchOptionsUserLocation struct { + // Approximate location parameters for the search. + // + Approximate DeepseekAPIChatCompletionNewParamsWebSearchOptionsUserLocationApproximate `json:"approximate"` + + // The type of location approximation. Always `approximate`. + // + // This field can be elided, and will marshal its zero value as "approximate". + // + Type interface{} `json:"type"` +} + +// Approximate location parameters for the search. +type DeepseekAPIChatCompletionNewParamsWebSearchOptionsUserLocationApproximate struct { + // Free text input for the city of the user, e.g. `San Francisco`. + // + City *string `json:"city,omitempty,omitzero"` + + // The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of + // the user, e.g. `US`. + // + Country *string `json:"country,omitempty,omitzero"` + + // Free text input for the region of the user, e.g. `California`. + // + Region *string `json:"region,omitempty,omitzero"` + + // The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the + // user, e.g. `America/Los_Angeles`. + // + Timezone *string `json:"timezone,omitempty,omitzero"` +} + +// DeepSeek APIChat Completion Prediction Content Content Union Param +// configuration. See the linked native reference for semantics and availability. +type DeepseekAPIChatCompletionPredictionContentContentUnionParam = json.RawMessage + +// Static predicted output content, such as the content of a text file that is +// being regenerated. +// +// The properties Content, Type are required. +type DeepseekAPIChatCompletionPredictionContentParam struct { + // The content that should be matched when generating a model response. If + // generated tokens would match this content, the entire model response can be + // returned much more quickly. + // + Content DeepseekAPIChatCompletionPredictionContentContentUnionParam `json:"content"` + + // The type of the predicted content you want to provide. This type is currently + // always `content`. + // + // This field can be elided, and will marshal its zero value as "content". + // + Type interface{} `json:"type"` +} + +// Options for streaming response. Only set this when you set `stream: true`. +type DeepseekAPIChatCompletionStreamOptionsParam struct { + // If set, an additional chunk will be streamed before the `data: [DONE]` message. + // The `usage` field on this chunk shows the token usage statistics for the entire + // request, and the `choices` field will always be an empty array. + // + // All other chunks will also include a `usage` field, but with a null value. + // **NOTE:** If the stream is interrupted, you may not receive the final usage + // chunk which contains the total token usage for the request. + // + IncludeUsage *bool `json:"include_usage,omitempty,omitzero"` +} + +// Developer-provided instructions that the model should follow, regardless of +// messages sent by the user. With o1 models and newer, use `developer` messages +// for this purpose instead. +// +// The properties Content, Role are required. +type DeepseekAPIChatCompletionSystemMessageParam struct { + // The contents of the system message. + // + Content DeepseekAPIChatCompletionSystemMessageParamContentUnion `json:"content"` + + // An optional name for the participant. Provides the model information to + // differentiate between participants of the same role. + // + Name *string `json:"name,omitempty,omitzero"` + + // The role of the messages author, in this case `system`. + // + // This field can be elided, and will marshal its zero value as "system". + // + Role interface{} `json:"role"` +} + +// DeepSeek APIChat Completion System Message Param Content Union configuration. +// See the linked native reference for semantics and availability. +type DeepseekAPIChatCompletionSystemMessageParamContentUnion = json.RawMessage + +// DeepSeek APIChat Completion Tool Choice Option Union Param configuration. See +// the linked native reference for semantics and availability. +type DeepseekAPIChatCompletionToolChoiceOptionUnionParam = json.RawMessage + +// The properties Content, Role, ToolCallID are required. +type DeepseekAPIChatCompletionToolMessageParam struct { + // The contents of the tool message. + // + Content DeepseekAPIChatCompletionToolMessageParamContentUnion `json:"content"` + + // The role of the messages author, in this case `tool`. + // + // This field can be elided, and will marshal its zero value as "tool". + // + Role interface{} `json:"role"` + + // Tool call that this message is responding to. + // + ToolCallId string `json:"tool_call_id"` +} + +// DeepSeek APIChat Completion Tool Message Param Content Union configuration. See +// the linked native reference for semantics and availability. +type DeepseekAPIChatCompletionToolMessageParamContentUnion = json.RawMessage + +// The properties Function, Type are required. +type DeepseekAPIChatCompletionToolParam struct { + // Function configuration. See the linked native reference for semantics and + // availability. + Function DeepseekAPIFunctionDefinitionParam `json:"function"` + + // The type of the tool. Currently, only `function` is supported. + // + // This field can be elided, and will marshal its zero value as "function". + // + Type interface{} `json:"type"` +} + +// Messages sent by an end user, containing prompts or additional context +// information. +// +// The properties Content, Role are required. +type DeepseekAPIChatCompletionUserMessageParam struct { + // The contents of the user message. + // + Content DeepseekAPIChatCompletionUserMessageParamContentUnion `json:"content"` + + // An optional name for the participant. Provides the model information to + // differentiate between participants of the same role. + // + Name *string `json:"name,omitempty,omitzero"` + + // The role of the messages author, in this case `user`. + // + // This field can be elided, and will marshal its zero value as "user". + // + Role interface{} `json:"role"` +} + +// DeepSeek APIChat Completion User Message Param Content Union configuration. See +// the linked native reference for semantics and availability. +type DeepseekAPIChatCompletionUserMessageParamContentUnion = json.RawMessage + +// The property Name is required. +type DeepseekAPIFunctionDefinitionParam struct { + // A description of what the function does, used by the model to choose when and + // how to call the function. + // + Description *string `json:"description,omitempty,omitzero"` + + // The name of the function to be called. Must be a-z, A-Z, 0-9, or contain + // underscores and dashes, with a maximum length of 64. + // + Name string `json:"name"` + + // The parameters the functions accepts, described as a JSON Schema object. See + // the + // [guide](https://platform.openai.com/docs/guides/function-calling) for examples, + // and the + // [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for + // documentation about the format. + // + // Omitting `parameters` defines a function with an empty parameter list. + // + Parameters DeepseekAPIFunctionDefinitionParamParameters `json:"parameters,omitempty,omitzero"` + + // Whether to enable strict schema adherence when generating the function call. If + // set to true, the model will follow the exact schema defined in the `parameters` + // field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn + // more about Structured Outputs in the + // [function calling + // guide](https://platform.openai.com/docs/guides/function-calling). + // + Strict *bool `json:"strict,omitempty,omitzero"` +} + +// The parameters the functions accepts, described as a JSON Schema object. See the +// [guide](https://platform.openai.com/docs/guides/function-calling) for examples, +// and the +// [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for +// documentation about the format. +// +// Omitting `parameters` defines a function with an empty parameter list. +type DeepseekAPIFunctionDefinitionParamParameters map[string]interface{} + +// JSON object response format. An older method of generating JSON responses. Using +// `json_schema` is recommended for models that support it. Note that the model +// will not generate JSON without a system or user message instructing it to do so. +// +// This struct has a constant value, construct it with +// [NewResponseFormatJSONObjectParam]. +type DeepseekAPIResponseFormatJSONObjectParam struct { + // The type of response format being defined. Always `json_object`. + // + Type interface{} `json:"type"` +} + +// Structured Outputs configuration options, including a JSON Schema. +// +// The property Name is required. +type DeepseekAPIResponseFormatJSONSchemaJSONSchemaParam struct { + // A description of what the response format is for, used by the model to + // determine + // how to respond in the format. + // + Description *string `json:"description,omitempty,omitzero"` + + // The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores + // and dashes, with a maximum length of 64. + // + Name string `json:"name"` + + // The schema for the response format, described as a JSON Schema object. Learn + // how + // to build JSON schemas [here](https://json-schema.org/). + // + Schema interface{} `json:"schema,omitempty,omitzero"` + + // Whether to enable strict schema adherence when generating the output. If set to + // true, the model will always follow the exact schema defined in the `schema` + // field. Only a subset of JSON Schema is supported when `strict` is `true`. To + // learn more, read the + // [Structured Outputs + // guide](https://platform.openai.com/docs/guides/structured-outputs). + // + Strict *bool `json:"strict,omitempty,omitzero"` +} + +// JSON Schema response format. Used to generate structured JSON responses. Learn +// more about +// [Structured +// Outputs](https://platform.openai.com/docs/guides/structured-outputs). +// +// The properties JSONSchema, Type are required. +type DeepseekAPIResponseFormatJSONSchemaParam struct { + // Structured Outputs configuration options, including a JSON Schema. + // + JsonSchema DeepseekAPIResponseFormatJSONSchemaJSONSchemaParam `json:"json_schema"` + + // The type of response format being defined. Always `json_schema`. + // + // This field can be elided, and will marshal its zero value as "json_schema". + // + Type interface{} `json:"type"` +} + +// Default response format. Used to generate text responses. +// +// This struct has a constant value, construct it with +// [NewResponseFormatTextParam]. +type DeepseekAPIResponseFormatTextParam struct { + // The type of response format being defined. Always `text`. + // + Type interface{} `json:"type"` +} diff --git a/pkg/adapters/zz_generated_google_api.go b/pkg/adapters/zz_generated_google_api.go index 671f5d6a..2c65483e 100644 --- a/pkg/adapters/zz_generated_google_api.go +++ b/pkg/adapters/zz_generated_google_api.go @@ -3,6 +3,1067 @@ package adapters import "encoding/json" +import "time" + +// The generic reusable API auth config. Deprecated. Please use AuthConfig +// (google/cloud/aiplatform/master/auth.proto) +// instead. This data type is not supported in Gemini API. +type GoogleAPIAPIAuth struct { + // The API secret. + // + ApiKeyConfig *GoogleAPIAPIAuthAPIKeyConfig `json:"apiKeyConfig,omitempty,omitzero"` +} + +// The API secret. This data type is not supported in Gemini API. +type GoogleAPIAPIAuthAPIKeyConfig struct { + // Required. The SecretManager secret version resource name storing API key. e.g. + // projects/{project}/secrets/{secret}/versions/{version} + // + ApiKeySecretVersion *string `json:"apiKeySecretVersion,omitempty,omitzero"` + + // The API key string. Either this or `api_key_secret_version` must be set. + // + ApiKeyString *string `json:"apiKeyString,omitempty,omitzero"` +} + +// Config for authentication with API key. This data type is not supported in +// Gemini +// API. +type GoogleAPIAPIKeyConfig struct { + // Optional. The name of the SecretManager secret version resource storing the API + // key. + // Format: `projects/{project}/secrets/{secrete}/versions/{version}` - If both + // `api_key_secret` + // and `api_key_string` are specified, this field takes precedence over + // `api_key_string`. + // - If specified, the `secretmanager.versions.access` permission should be + // granted + // to Vertex AI Extension Service Agent + // (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) + // on the specified resource. + // + ApiKeySecret *string `json:"apiKeySecret,omitempty,omitzero"` + + // Optional. The API key to be used in the request directly. + // + ApiKeyString *string `json:"apiKeyString,omitempty,omitzero"` + + // Optional. The location of the API key. + // + HttpElementLocation *GoogleAPIAPIKeyConfigHttpElementLocation `json:"httpElementLocation,omitempty,omitzero"` + + // Optional. The parameter name of the API key. E.g. If the API request is + // "https://example.com/act?api_key=", + // "api_key" would be the parameter name. + // + Name *string `json:"name,omitempty,omitzero"` +} + +type GoogleAPIAPIKeyConfigHttpElementLocation string + +const GoogleAPIAPIKeyConfigHttpElementLocationHTTPINBODY GoogleAPIAPIKeyConfigHttpElementLocation = "HTTP_IN_BODY" +const GoogleAPIAPIKeyConfigHttpElementLocationHTTPINCOOKIE GoogleAPIAPIKeyConfigHttpElementLocation = "HTTP_IN_COOKIE" +const GoogleAPIAPIKeyConfigHttpElementLocationHTTPINHEADER GoogleAPIAPIKeyConfigHttpElementLocation = "HTTP_IN_HEADER" +const GoogleAPIAPIKeyConfigHttpElementLocationHTTPINPATH GoogleAPIAPIKeyConfigHttpElementLocation = "HTTP_IN_PATH" +const GoogleAPIAPIKeyConfigHttpElementLocationHTTPINQUERY GoogleAPIAPIKeyConfigHttpElementLocation = "HTTP_IN_QUERY" +const GoogleAPIAPIKeyConfigHttpElementLocationHTTPINUNSPECIFIED GoogleAPIAPIKeyConfigHttpElementLocation = "HTTP_IN_UNSPECIFIED" + +// The authentication config to access the API. +type GoogleAPIAuthConfig struct { + // Optional. The authentication config to access the API. Only API key is + // supported. + // This field is not supported in Gemini API. + // + ApiKey *string `json:"apiKey,omitempty,omitzero"` + + // Config for API key auth. + // + ApiKeyConfig *GoogleAPIAPIKeyConfig `json:"apiKeyConfig,omitempty,omitzero"` + + // Type of auth scheme. + // + AuthType *GoogleAPIAuthConfigAuthType `json:"authType,omitempty,omitzero"` + + // Config for Google Service Account auth. + // + GoogleServiceAccountConfig *GoogleAPIAuthConfigGoogleServiceAccountConfig `json:"googleServiceAccountConfig,omitempty,omitzero"` + + // Config for HTTP Basic auth. + // + HttpBasicAuthConfig *GoogleAPIAuthConfigHTTPBasicAuthConfig `json:"httpBasicAuthConfig,omitempty,omitzero"` + + // Config for user oauth. + // + OauthConfig *GoogleAPIAuthConfigOauthConfig `json:"oauthConfig,omitempty,omitzero"` + + // Config for user OIDC auth. + // + OidcConfig *GoogleAPIAuthConfigOidcConfig `json:"oidcConfig,omitempty,omitzero"` +} + +type GoogleAPIAuthConfigAuthType string + +const GoogleAPIAuthConfigAuthTypeAPIKEYAUTH GoogleAPIAuthConfigAuthType = "API_KEY_AUTH" +const GoogleAPIAuthConfigAuthTypeAUTHTYPEUNSPECIFIED GoogleAPIAuthConfigAuthType = "AUTH_TYPE_UNSPECIFIED" +const GoogleAPIAuthConfigAuthTypeGOOGLESERVICEACCOUNTAUTH GoogleAPIAuthConfigAuthType = "GOOGLE_SERVICE_ACCOUNT_AUTH" +const GoogleAPIAuthConfigAuthTypeHTTPBASICAUTH GoogleAPIAuthConfigAuthType = "HTTP_BASIC_AUTH" +const GoogleAPIAuthConfigAuthTypeNOAUTH GoogleAPIAuthConfigAuthType = "NO_AUTH" +const GoogleAPIAuthConfigAuthTypeOAUTH GoogleAPIAuthConfigAuthType = "OAUTH" +const GoogleAPIAuthConfigAuthTypeOIDCAUTH GoogleAPIAuthConfigAuthType = "OIDC_AUTH" + +// Config for Google Service Account Authentication. This data type is not +// supported +// in Gemini API. +type GoogleAPIAuthConfigGoogleServiceAccountConfig struct { + // Optional. The service account that the extension execution service runs as. - + // If + // the service account is specified, the `iam.serviceAccounts.getAccessToken` + // permission + // should be granted to Vertex AI Extension Service Agent + // (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) + // on the specified service account. - If not specified, the Vertex AI Extension + // Service + // Agent will be used to execute the Extension. + // + ServiceAccount *string `json:"serviceAccount,omitempty,omitzero"` +} + +// Config for HTTP Basic Authentication. This data type is not supported in Gemini +// API. +type GoogleAPIAuthConfigHTTPBasicAuthConfig struct { + // Required. The name of the SecretManager secret version resource storing the + // base64 + // encoded credentials. Format: + // `projects/{project}/secrets/{secrete}/versions/{version}` + // - If specified, the `secretmanager.versions.access` permission should be + // granted + // to Vertex AI Extension Service Agent + // (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) + // on the specified resource. + // + CredentialSecret *string `json:"credentialSecret,omitempty,omitzero"` +} + +// Config for user oauth. This data type is not supported in Gemini API. +type GoogleAPIAuthConfigOauthConfig struct { + // Access token for extension endpoint. Only used to propagate token from + // [[ExecuteExtensionRequest.runtime_auth_config]] + // at request time. + // + AccessToken *string `json:"accessToken,omitempty,omitzero"` + + // The service account used to generate access tokens for executing the Extension. + // - + // If the service account is specified, the `iam.serviceAccounts.getAccessToken` + // permission + // should be granted to Vertex AI Extension Service Agent + // (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) + // on the provided service account. + // + ServiceAccount *string `json:"serviceAccount,omitempty,omitzero"` +} + +// Config for user OIDC auth. This data type is not supported in Gemini API. +type GoogleAPIAuthConfigOidcConfig struct { + // OpenID Connect formatted ID token for extension endpoint. Only used to + // propagate + // token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time. + // + IdToken *string `json:"idToken,omitempty,omitzero"` + + // The service account used to generate an OpenID Connect (OIDC)-compatible JWT + // token + // signed by the Google OIDC Provider (accounts.google.com) for extension endpoint + // (https://cloud.google.com/iam/docs/create-short-lived-credentials-direct#sa-credentials-oidc). + // - The audience for the token will be set to the URL in the server URL defined + // in + // the OpenAPI spec. - If the service account is provided, the service account + // should + // grant `iam.serviceAccounts.getOpenIDToken` permission to Vertex AI Extension + // Service + // Agent + // (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents). + // + ServiceAccount *string `json:"serviceAccount,omitempty,omitzero"` +} + +// A content blob. A Blob contains data of a specific media type. It is used to +// represent +// images, audio, and video. +type GoogleAPIBlob struct { + // Required. The raw bytes of the data. + // + Data *string `json:"data,omitempty,omitzero"` + + // Optional. The display name of the blob. Used to provide a label or filename to + // distinguish + // blobs. This field is only returned in `PromptMessage` for prompt management. It + // is + // used in the Gemini calls only when server-side tools (`code_execution`, + // `google_search`, + // and `url_context`) are enabled. This field is not supported in Gemini API. + // + DisplayName *string `json:"displayName,omitempty,omitzero"` + + // Required. The IANA standard MIME type of the source data. + // + MimeType *string `json:"mimeType,omitempty,omitzero"` +} + +// Result of executing the `ExecutableCode`. +// Generated only when the `CodeExecution` tool is used. +type GoogleAPICodeExecutionResult struct { + // Optional. The identifier of the `ExecutableCode` part this result is for. Only + // populated + // if the corresponding `ExecutableCode` has an id. + // + Id *string `json:"id,omitempty,omitzero"` + + // Required. Outcome of the code execution. + // + Outcome *GoogleAPICodeExecutionResultOutcome `json:"outcome,omitempty,omitzero"` + + // Optional. Contains stdout when code execution is successful, stderr or other + // description + // otherwise. + // + Output *string `json:"output,omitempty,omitzero"` +} + +type GoogleAPICodeExecutionResultOutcome string + +const GoogleAPICodeExecutionResultOutcomeOUTCOMEDEADLINEEXCEEDED GoogleAPICodeExecutionResultOutcome = "OUTCOME_DEADLINE_EXCEEDED" +const GoogleAPICodeExecutionResultOutcomeOUTCOMEFAILED GoogleAPICodeExecutionResultOutcome = "OUTCOME_FAILED" +const GoogleAPICodeExecutionResultOutcomeOUTCOMEOK GoogleAPICodeExecutionResultOutcome = "OUTCOME_OK" +const GoogleAPICodeExecutionResultOutcomeOUTCOMEUNSPECIFIED GoogleAPICodeExecutionResultOutcome = "OUTCOME_UNSPECIFIED" + +// Tool to support computer use. +type GoogleAPIComputerUse struct { + // Optional. Required. The environment being operated. + // + Environment *GoogleAPIComputerUseEnvironment `json:"environment,omitempty,omitzero"` + + // Optional. By default, predefined functions are included in the final model + // call. + // Some of them can be explicitly excluded from being automatically included. + // This can serve two purposes: + // 1. Using a more restricted / different action space. + // 2. Improving the definitions / instructions of predefined functions. + // + ExcludedPredefinedFunctions []string `json:"excludedPredefinedFunctions,omitempty,omitzero"` +} + +type GoogleAPIComputerUseEnvironment string + +const GoogleAPIComputerUseEnvironmentENVIRONMENTBROWSER GoogleAPIComputerUseEnvironment = "ENVIRONMENT_BROWSER" +const GoogleAPIComputerUseEnvironmentENVIRONMENTUNSPECIFIED GoogleAPIComputerUseEnvironment = "ENVIRONMENT_UNSPECIFIED" + +// Contains the multi-part content of a message. +type GoogleAPIContent struct { + // Optional. List of parts that constitute a single message. Each part may have + // a different IANA MIME type. + // + Parts []GoogleAPIPart `json:"parts,omitempty,omitzero"` + + // Optional. The producer of the content. Must be either 'user' or 'model'. If not + // set, + // the service will default to 'user'. + // + Role *string `json:"role,omitempty,omitzero"` +} + +// Describes the options to customize dynamic retrieval. +type GoogleAPIDynamicRetrievalConfig struct { + // Optional. The threshold to be used in dynamic retrieval. If empty, a system + // default + // value is used. + // + DynamicThreshold *float64 `json:"dynamicThreshold,omitempty,omitzero"` + + // The mode of the predictor to be used in dynamic retrieval. + // + Mode *GoogleAPIDynamicRetrievalConfigMode `json:"mode,omitempty,omitzero"` +} + +type GoogleAPIDynamicRetrievalConfigMode string + +const GoogleAPIDynamicRetrievalConfigModeMODEDYNAMIC GoogleAPIDynamicRetrievalConfigMode = "MODE_DYNAMIC" +const GoogleAPIDynamicRetrievalConfigModeMODEUNSPECIFIED GoogleAPIDynamicRetrievalConfigMode = "MODE_UNSPECIFIED" + +// Tool to search public web data, powered by Vertex AI Search and Sec4 compliance. +// This data type is not supported in Gemini API. +type GoogleAPIEnterpriseWebSearch struct { + // Optional. Sites with confidence level chosen & above this value will be blocked + // from + // the search results. + // + BlockingConfidence *GoogleAPIEnterpriseWebSearchBlockingConfidence `json:"blockingConfidence,omitempty,omitzero"` + + // Optional. List of domains to be excluded from the search results. The default + // limit + // is 2000 domains. + // + ExcludeDomains []string `json:"excludeDomains,omitempty,omitzero"` +} + +type GoogleAPIEnterpriseWebSearchBlockingConfidence string + +const GoogleAPIEnterpriseWebSearchBlockingConfidenceBLOCKHIGHANDABOVE GoogleAPIEnterpriseWebSearchBlockingConfidence = "BLOCK_HIGH_AND_ABOVE" +const GoogleAPIEnterpriseWebSearchBlockingConfidenceBLOCKHIGHERANDABOVE GoogleAPIEnterpriseWebSearchBlockingConfidence = "BLOCK_HIGHER_AND_ABOVE" +const GoogleAPIEnterpriseWebSearchBlockingConfidenceBLOCKLOWANDABOVE GoogleAPIEnterpriseWebSearchBlockingConfidence = "BLOCK_LOW_AND_ABOVE" +const GoogleAPIEnterpriseWebSearchBlockingConfidenceBLOCKMEDIUMANDABOVE GoogleAPIEnterpriseWebSearchBlockingConfidence = "BLOCK_MEDIUM_AND_ABOVE" +const GoogleAPIEnterpriseWebSearchBlockingConfidenceBLOCKONLYEXTREMELYHIGH GoogleAPIEnterpriseWebSearchBlockingConfidence = "BLOCK_ONLY_EXTREMELY_HIGH" +const GoogleAPIEnterpriseWebSearchBlockingConfidenceBLOCKVERYHIGHANDABOVE GoogleAPIEnterpriseWebSearchBlockingConfidence = "BLOCK_VERY_HIGH_AND_ABOVE" +const GoogleAPIEnterpriseWebSearchBlockingConfidencePHISHBLOCKTHRESHOLDUNSPECIFIED GoogleAPIEnterpriseWebSearchBlockingConfidence = "PHISH_BLOCK_THRESHOLD_UNSPECIFIED" + +// Model-generated code executed server-side, results returned to the model. +// Only generated when using the `CodeExecution` tool, in which the code will +// be automatically executed, and a corresponding `CodeExecutionResult` will +// also be generated. +type GoogleAPIExecutableCode struct { + // Required. The code to be executed. + // + Code *string `json:"code,omitempty,omitzero"` + + // Optional. Unique identifier of the `ExecutableCode` part. The server returns + // the + // `CodeExecutionResult` with the matching `id`. + // + Id *string `json:"id,omitempty,omitzero"` + + // Required. Programming language of the `code`. + // + Language *GoogleAPIExecutableCodeLanguage `json:"language,omitempty,omitzero"` +} + +type GoogleAPIExecutableCodeLanguage string + +const GoogleAPIExecutableCodeLanguageLANGUAGEUNSPECIFIED GoogleAPIExecutableCodeLanguage = "LANGUAGE_UNSPECIFIED" +const GoogleAPIExecutableCodeLanguagePYTHON GoogleAPIExecutableCodeLanguage = "PYTHON" + +// Retrieve from data source powered by external API for grounding. The external +// API +// is not owned by Google, but need to follow the pre-defined API spec. This data +// type +// is not supported in Gemini API. +type GoogleAPIExternalAPI struct { + // The authentication config to access the API. Deprecated. Please use auth_config + // instead. + // + ApiAuth *GoogleAPIAPIAuth `json:"apiAuth,omitempty,omitzero"` + + // The API spec that the external API implements. + // + ApiSpec *GoogleAPIExternalAPIApiSpec `json:"apiSpec,omitempty,omitzero"` + + // The authentication config to access the API. + // + AuthConfig *GoogleAPIAuthConfig `json:"authConfig,omitempty,omitzero"` + + // Parameters for the elastic search API. + // + ElasticSearchParams *GoogleAPIExternalAPIElasticSearchParams `json:"elasticSearchParams,omitempty,omitzero"` + + // The endpoint of the external API. The system will call the API at this endpoint + // to + // retrieve the data for grounding. Example: https://acme.com:443/search + // + Endpoint *string `json:"endpoint,omitempty,omitzero"` + + // Parameters for the simple search API. + // + SimpleSearchParams *GoogleAPIExternalAPISimpleSearchParams `json:"simpleSearchParams,omitempty,omitzero"` +} + +type GoogleAPIExternalAPIApiSpec string + +const GoogleAPIExternalAPIApiSpecAPISPECUNSPECIFIED GoogleAPIExternalAPIApiSpec = "API_SPEC_UNSPECIFIED" +const GoogleAPIExternalAPIApiSpecELASTICSEARCH GoogleAPIExternalAPIApiSpec = "ELASTIC_SEARCH" +const GoogleAPIExternalAPIApiSpecSIMPLESEARCH GoogleAPIExternalAPIApiSpec = "SIMPLE_SEARCH" + +// The search parameters to use for the ELASTIC_SEARCH spec. This data type is not +// supported +// in Gemini API. +type GoogleAPIExternalAPIElasticSearchParams struct { + // The ElasticSearch index to use. + // + Index *string `json:"index,omitempty,omitzero"` + + // Optional. Number of hits (chunks) to request. When specified, it is passed to + // Elasticsearch + // as the `num_hits` param. + // + NumHits *int `json:"numHits,omitempty,omitzero"` + + // The ElasticSearch search template to use. + // + SearchTemplate *string `json:"searchTemplate,omitempty,omitzero"` +} + +// The search parameters to use for SIMPLE_SEARCH spec. This data type is not +// supported +// in Gemini API. +type GoogleAPIExternalAPISimpleSearchParams map[string]interface{} + +// URI-based data. A FileData message contains a URI pointing to data of a specific +// media type. It is used to represent images, audio, and video stored in Google +// Cloud +// Storage. +type GoogleAPIFileData struct { + // Optional. The display name of the file. Used to provide a label or filename to + // distinguish + // files. This field is only returned in `PromptMessage` for prompt management. It + // is + // used in the Gemini calls only when server side tools (`code_execution`, + // `google_search`, + // and `url_context`) are enabled. This field is not supported in Gemini API. + // + DisplayName *string `json:"displayName,omitempty,omitzero"` + + // Required. The URI of the file in Google Cloud Storage. + // + FileUri *string `json:"fileUri,omitempty,omitzero"` + + // Required. The IANA standard MIME type of the source data. + // + MimeType *string `json:"mimeType,omitempty,omitzero"` +} + +// The FileSearch tool that retrieves knowledge from Semantic Retrieval corpora. +// Files +// are imported to Semantic Retrieval corpora using the ImportFile API. This data +// type +// is not supported in Vertex AI. +type GoogleAPIFileSearch struct { + // Required. The names of the file_search_stores to retrieve from. Example: + // `fileSearchStores/my-file-search-store-123` + // + FileSearchStoreNames []string `json:"fileSearchStoreNames,omitempty,omitzero"` + + // Optional. Metadata filter to apply to the semantic retrieval documents and + // chunks. + // + MetadataFilter *string `json:"metadataFilter,omitempty,omitzero"` + + // Optional. The number of semantic retrieval chunks to retrieve. + // + TopK *int `json:"topK,omitempty,omitzero"` +} + +// A function call. +type GoogleAPIFunctionCall struct { + // Optional. The function parameters and values in JSON object format. See + // [FunctionDeclaration.parameters] + // for parameter details. + // + Args GoogleAPIFunctionCallArgs `json:"args,omitempty,omitzero"` + + // Optional. The unique ID of the function call. If populated, the client to + // execute + // the + // `function_call` and return the response with the matching `id`. + // + Id *string `json:"id,omitempty,omitzero"` + + // Optional. Required. The name of the function to call. Matches + // [FunctionDeclaration.Name]. + // + Name *string `json:"name,omitempty,omitzero"` + + // Optional. The partial argument value of the function call. If provided, + // represents + // the arguments/fields that are streamed incrementally. This field is not + // supported + // in Gemini API. + // + PartialArgs []GoogleAPIPartialArg `json:"partialArgs,omitempty,omitzero"` + + // Optional. Whether this is the last part of the FunctionCall. If true, another + // partial + // message for the current FunctionCall is expected to follow. This field is not + // supported + // in Gemini API. + // + WillContinue *bool `json:"willContinue,omitempty,omitzero"` +} + +// Optional. The function parameters and values in JSON object format. See +// [FunctionDeclaration.parameters] +// for parameter details. +type GoogleAPIFunctionCallArgs map[string]interface{} + +// Function calling config. +type GoogleAPIFunctionCallingConfig struct { + // Optional. Function names to call. Only set when the Mode is ANY. Function names + // should + // match [FunctionDeclaration.Name]. With mode set to ANY, model will predict a + // function + // call from the set of function names provided. + // + AllowedFunctionNames []string `json:"allowedFunctionNames,omitempty,omitzero"` + + // Optional. Function calling mode. + // + Mode *GoogleAPIFunctionCallingConfigMode `json:"mode,omitempty,omitzero"` + + // Optional. When set to true, arguments of a single function call will be + // streamed + // out in multiple parts/contents/responses. Partial parameter results will be + // returned + // in the [FunctionCall.partial_args] field. This field is not supported in Gemini + // API. + // + StreamFunctionCallArguments *bool `json:"streamFunctionCallArguments,omitempty,omitzero"` +} + +type GoogleAPIFunctionCallingConfigMode string + +const GoogleAPIFunctionCallingConfigModeANY GoogleAPIFunctionCallingConfigMode = "ANY" +const GoogleAPIFunctionCallingConfigModeAUTO GoogleAPIFunctionCallingConfigMode = "AUTO" +const GoogleAPIFunctionCallingConfigModeMODEUNSPECIFIED GoogleAPIFunctionCallingConfigMode = "MODE_UNSPECIFIED" +const GoogleAPIFunctionCallingConfigModeNONE GoogleAPIFunctionCallingConfigMode = "NONE" +const GoogleAPIFunctionCallingConfigModeVALIDATED GoogleAPIFunctionCallingConfigMode = "VALIDATED" + +// Structured representation of a function declaration as defined by the [OpenAPI +// 3.0 +// specification](https://spec.openapis.org/oas/v3.0.3). Included in this +// declaration +// are the function name, description, parameters and response type. This +// FunctionDeclaration +// is a representation of a block of code that can be used as a `Tool` by the model +// and executed by the client. +type GoogleAPIFunctionDeclaration struct { + // Optional. Specifies the function Behavior. Currently only non-blocking + // functions + // are supported. If not specified, the system keeps the current function call + // behavior. + // This field is currently only supported by the BidiGenerateContent method. + // + Behavior *GoogleAPIFunctionDeclarationBehavior `json:"behavior,omitempty,omitzero"` + + // Optional. Description and purpose of the function. Model uses it to decide how + // and + // whether to call the function. + // + Description *string `json:"description,omitempty,omitzero"` + + // Required. The name of the function to call. Must start with a letter or an + // underscore. + // Must be a-z, A-Z, 0-9, or contain underscores, dots, colons and dashes, with a + // maximum + // length of 64. + // + Name *string `json:"name,omitempty,omitzero"` + + // Optional. Describes the parameters to this function in JSON Schema Object + // format. + // Reflects the Open API 3.03 Parameter Object. string Key: the name of the + // parameter. + // Parameter names are case sensitive. Schema Value: the Schema defining the type + // used + // for the parameter. For function with no parameters, this can be left unset. + // Parameter + // names must start with a letter or an underscore and must only contain chars + // a-z, + // A-Z, 0-9, or underscores with a maximum length of 64. Example with 1 required + // and + // 1 optional parameter: type: OBJECT properties: param1: type: STRING param2: + // type: + // INTEGER required: - param1 + // + Parameters *GoogleAPISchema `json:"parameters,omitempty,omitzero"` + + // Optional. Describes the parameters to the function in JSON Schema format. The + // schema + // must describe an object where the properties are the parameters to the + // function. + // For example: ``` { "type": "object", "properties": { "name": { "type": "string" + // }, + // "age": { "type": "integer" } }, "additionalProperties": false, "required": + // ["name", + // "age"], "propertyOrdering": ["name", "age"] } ``` This field is mutually + // exclusive + // with `parameters`. + // + ParametersJsonSchema interface{} `json:"parametersJsonSchema,omitempty,omitzero"` + + // Optional. Describes the output from this function in JSON Schema format. + // Reflects + // the Open API 3.03 Response Object. The Schema defines the type used for the + // response + // value of the function. + // + Response *GoogleAPISchema `json:"response,omitempty,omitzero"` + + // Optional. Describes the output from this function in JSON Schema format. The + // value + // specified by the schema is the response value of the function. This field is + // mutually + // exclusive with `response`. + // + ResponseJsonSchema interface{} `json:"responseJsonSchema,omitempty,omitzero"` +} + +type GoogleAPIFunctionDeclarationBehavior string + +const GoogleAPIFunctionDeclarationBehaviorBLOCKING GoogleAPIFunctionDeclarationBehavior = "BLOCKING" +const GoogleAPIFunctionDeclarationBehaviorNONBLOCKING GoogleAPIFunctionDeclarationBehavior = "NON_BLOCKING" +const GoogleAPIFunctionDeclarationBehaviorUNSPECIFIED GoogleAPIFunctionDeclarationBehavior = "UNSPECIFIED" + +// A function response. +type GoogleAPIFunctionResponse struct { + // Optional. The ID of the function call this response is for. Populated by the + // client + // to match the corresponding function call `id`. + // + Id *string `json:"id,omitempty,omitzero"` + + // Required. The name of the function to call. Matches [FunctionDeclaration.name] + // and + // [FunctionCall.name]. + // + Name *string `json:"name,omitempty,omitzero"` + + // Optional. List of parts that constitute a function response. Each part may + // have a different IANA MIME type. + // + Parts []GoogleAPIFunctionResponsePart `json:"parts,omitempty,omitzero"` + + // Required. The function response in JSON object format. Use "output" key to + // specify + // function output and "error" key to specify error details (if any). If "output" + // and + // "error" keys are not specified, then whole "response" is treated as function + // output. + // + Response GoogleAPIFunctionResponseResponse `json:"response,omitempty,omitzero"` + + // Optional. Specifies how the response should be scheduled in the conversation. + // Only + // applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to + // WHEN_IDLE. + // + Scheduling *GoogleAPIFunctionResponseScheduling `json:"scheduling,omitempty,omitzero"` + + // Optional. Signals that function call continues, and more responses will be + // returned, + // turning the function call into a generator. Is only applicable to NON_BLOCKING + // function + // calls (see FunctionDeclaration.behavior for details), ignored otherwise. If + // false, + // the default, future responses will not be considered. Is only applicable to + // NON_BLOCKING + // function calls, is ignored otherwise. If set to false, future responses will + // not + // be considered. It is allowed to return empty `response` with + // `will_continue=False` + // to signal that the function call is finished. + // + WillContinue *bool `json:"willContinue,omitempty,omitzero"` +} + +// Raw media bytes for function response. +// Text should not be sent as raw bytes, use the FunctionResponse.response +// field. +type GoogleAPIFunctionResponseBlob struct { + // Required. Inline media bytes. + // + Data *string `json:"data,omitempty,omitzero"` + + // Optional. Display name of the blob. + // Used to provide a label or filename to distinguish blobs. + // + DisplayName *string `json:"displayName,omitempty,omitzero"` + + // Required. The IANA standard MIME type of the source data. + // + MimeType *string `json:"mimeType,omitempty,omitzero"` +} + +// URI based data for function response. +type GoogleAPIFunctionResponseFileData struct { + // Optional. Display name of the file. + // Used to provide a label or filename to distinguish files. + // + DisplayName *string `json:"displayName,omitempty,omitzero"` + + // Required. URI. + // + FileUri *string `json:"fileUri,omitempty,omitzero"` + + // Required. The IANA standard MIME type of the source data. + // + MimeType *string `json:"mimeType,omitempty,omitzero"` +} + +// A datatype containing media that is part of a `FunctionResponse` message. +// A `FunctionResponsePart` consists of data which has an associated datatype. A +// `FunctionResponsePart` can only contain one of the accepted types in +// `FunctionResponsePart.data`. +// A `FunctionResponsePart` must have a fixed IANA MIME type identifying the +// type and subtype of the media if the `inline_data` field is filled with raw +// bytes. +type GoogleAPIFunctionResponsePart struct { + // Optional. URI based data. + // + FileData *GoogleAPIFunctionResponseFileData `json:"fileData,omitempty,omitzero"` + + // Optional. Inline media bytes. + // + InlineData *GoogleAPIFunctionResponseBlob `json:"inlineData,omitempty,omitzero"` +} + +// Required. The function response in JSON object format. Use "output" key to +// specify +// function output and "error" key to specify error details (if any). If "output" +// and +// "error" keys are not specified, then whole "response" is treated as function +// output. +type GoogleAPIFunctionResponseResponse map[string]interface{} + +type GoogleAPIFunctionResponseScheduling string + +const GoogleAPIFunctionResponseSchedulingINTERRUPT GoogleAPIFunctionResponseScheduling = "INTERRUPT" +const GoogleAPIFunctionResponseSchedulingSCHEDULINGUNSPECIFIED GoogleAPIFunctionResponseScheduling = "SCHEDULING_UNSPECIFIED" +const GoogleAPIFunctionResponseSchedulingSILENT GoogleAPIFunctionResponseScheduling = "SILENT" +const GoogleAPIFunctionResponseSchedulingWHENIDLE GoogleAPIFunctionResponseScheduling = "WHEN_IDLE" + +// The configuration for routing the request to a specific model. This can be used +// to +// control which model is used for the generation, either automatically or by +// specifying +// a model name. This data type is not supported in Gemini API. +type GoogleAPIGenerationConfigRoutingConfig struct { + // In this mode, the model is selected automatically based on the content of the + // request. + // + AutoMode *GoogleAPIGenerationConfigRoutingConfigAutoRoutingMode `json:"autoMode,omitempty,omitzero"` + + // In this mode, the model is specified manually. + // + ManualMode *GoogleAPIGenerationConfigRoutingConfigManualRoutingMode `json:"manualMode,omitempty,omitzero"` +} + +// The configuration for automated routing. When automated routing is specified, +// the +// routing will be determined by the pretrained routing model and customer provided +// model routing preference. This data type is not supported in Gemini API. +type GoogleAPIGenerationConfigRoutingConfigAutoRoutingMode struct { + // The model routing preference. + // + ModelRoutingPreference *string `json:"modelRoutingPreference,omitempty,omitzero"` +} + +// The configuration for manual routing. When manual routing is specified, the +// model +// will be selected based on the model name provided. This data type is not +// supported +// in Gemini API. +type GoogleAPIGenerationConfigRoutingConfigManualRoutingMode struct { + // The name of the model to use. Only public LLM models are accepted. + // + ModelName *string `json:"modelName,omitempty,omitzero"` +} + +// Tool to retrieve knowledge from Google Maps. +type GoogleAPIGoogleMaps struct { + // Optional. The authentication config to access the API. Only API key is + // supported. + // This field is not supported in Gemini API. + // + AuthConfig *GoogleAPIAuthConfig `json:"authConfig,omitempty,omitzero"` + + // Optional. Whether to return a widget context token in the GroundingMetadata of + // the + // response. Developers can use the widget context token to render a Google Maps + // widget + // with geospatial context related to the places that the model references in the + // response. + // + EnableWidget *bool `json:"enableWidget,omitempty,omitzero"` +} + +// GoogleSearch tool type. Tool to support Google Search in Model. Powered by +// Google. +type GoogleAPIGoogleSearch struct { + // Optional. Sites with confidence level chosen & above this value will be blocked + // from + // the search results. This field is not supported in Gemini API. + // + BlockingConfidence *GoogleAPIGoogleSearchBlockingConfidence `json:"blockingConfidence,omitempty,omitzero"` + + // Optional. List of domains to be excluded from the search results. The default + // limit + // is 2000 domains. Example: ["amazon.com", "facebook.com"]. This field is not + // supported + // in Gemini API. + // + ExcludeDomains []string `json:"excludeDomains,omitempty,omitzero"` + + // Optional. The set of search types to enable. If not set, web search is enabled + // by + // default. + // + SearchTypes *GoogleAPISearchTypes `json:"searchTypes,omitempty,omitzero"` + + // Optional. Filter search results to a specific time range. If customers set a + // start + // time, they must set an end time (and vice versa). This field is not supported + // in + // Vertex AI. + // + TimeRangeFilter *GoogleAPIInterval `json:"timeRangeFilter,omitempty,omitzero"` +} + +type GoogleAPIGoogleSearchBlockingConfidence string + +const GoogleAPIGoogleSearchBlockingConfidenceBLOCKHIGHANDABOVE GoogleAPIGoogleSearchBlockingConfidence = "BLOCK_HIGH_AND_ABOVE" +const GoogleAPIGoogleSearchBlockingConfidenceBLOCKHIGHERANDABOVE GoogleAPIGoogleSearchBlockingConfidence = "BLOCK_HIGHER_AND_ABOVE" +const GoogleAPIGoogleSearchBlockingConfidenceBLOCKLOWANDABOVE GoogleAPIGoogleSearchBlockingConfidence = "BLOCK_LOW_AND_ABOVE" +const GoogleAPIGoogleSearchBlockingConfidenceBLOCKMEDIUMANDABOVE GoogleAPIGoogleSearchBlockingConfidence = "BLOCK_MEDIUM_AND_ABOVE" +const GoogleAPIGoogleSearchBlockingConfidenceBLOCKONLYEXTREMELYHIGH GoogleAPIGoogleSearchBlockingConfidence = "BLOCK_ONLY_EXTREMELY_HIGH" +const GoogleAPIGoogleSearchBlockingConfidenceBLOCKVERYHIGHANDABOVE GoogleAPIGoogleSearchBlockingConfidence = "BLOCK_VERY_HIGH_AND_ABOVE" +const GoogleAPIGoogleSearchBlockingConfidencePHISHBLOCKTHRESHOLDUNSPECIFIED GoogleAPIGoogleSearchBlockingConfidence = "PHISH_BLOCK_THRESHOLD_UNSPECIFIED" + +// Tool to retrieve public web data for grounding, powered by Google. +type GoogleAPIGoogleSearchRetrieval struct { + // Specifies the dynamic retrieval configuration for the given source. + // + DynamicRetrievalConfig *GoogleAPIDynamicRetrievalConfig `json:"dynamicRetrievalConfig,omitempty,omitzero"` +} + +// HTTP options to be used in each of the requests. +type GoogleAPIHTTPOptions struct { + // Optional. APIVersion specifies the version of the API to use. If empty, + // defaults + // to "v1beta" for Gemini API and "v1beta1" for Gemini Enterprise Agent Platform. + // + ApiVersion *string `json:"apiVersion,omitempty,omitzero"` + + // Optional. BaseURL specifies the base URL for the API endpoint. If empty, + // defaults + // to "https://generativelanguage.googleapis.com/" for the Gemini API backend, and + // location-specific + // Gemini Enterprise Agent Platform endpoint (e.g., + // "https://us-central1-aiplatform.googleapis.com/ + // + BaseUrl *string `json:"baseUrl,omitempty,omitzero"` + + // Optional. BaseURL specifies the base URL for the API endpoint. If empty, + // defaults + // to "https://generativelanguage.googleapis.com/" for the Gemini API backend, and + // location-specific + // Gemini Enterprise Agent Platform endpoint (e.g., + // "https://us-central1-aiplatform.googleapis.com/ + // + BaseUrlResourceScope *GoogleAPIHTTPOptionsBaseUrlResourceScope `json:"baseUrlResourceScope,omitempty,omitzero"` + + // Optional. Extra parameters to add to the request body. + // The structure must match the backend API's request structure. + // - Gemini Enterprise Agent Platform backend API docs: + // https://cloud.google.com/vertex-ai/docs/reference/rest + // - GeminiAPI backend API docs: https://ai.google.dev/api/rest + // + ExtraBody GoogleAPIHTTPOptionsExtraBody `json:"extraBody,omitempty,omitzero"` + + // Optional. Additional HTTP headers to be sent with the request. + // + Headers GoogleAPIHTTPOptionsHeaders `json:"headers,omitempty,omitzero"` + + // Optional. Timeout for the request in milliseconds. + // + Timeout *int `json:"timeout,omitempty,omitzero"` +} + +type GoogleAPIHTTPOptionsBaseUrlResourceScope string + +const GoogleAPIHTTPOptionsBaseUrlResourceScopeCOLLECTION GoogleAPIHTTPOptionsBaseUrlResourceScope = "COLLECTION" + +// Optional. Extra parameters to add to the request body. +// The structure must match the backend API's request structure. +// - Gemini Enterprise Agent Platform backend API docs: +// +// https://cloud.google.com/vertex-ai/docs/reference/rest +// - GeminiAPI backend API docs: https://ai.google.dev/api/rest +type GoogleAPIHTTPOptionsExtraBody map[string]interface{} + +// Optional. Additional HTTP headers to be sent with the request. +type GoogleAPIHTTPOptionsHeaders map[string][]string + +// The image generation configuration to be used in GenerateContentConfig. +type GoogleAPIImageConfig struct { + // Optional. Aspect ratio of the generated images. Supported values are + // "1:1", "2:3", "3:2", "3:4", "4:3", "9:16", "16:9", and "21:9". + // + AspectRatio *string `json:"aspectRatio,omitempty,omitzero"` + + // Optional. The image output format for generated images. This field is not + // supported + // in Gemini API. + // + ImageOutputOptions *GoogleAPIImageConfigImageOutputOptions `json:"imageOutputOptions,omitempty,omitzero"` + + // Optional. Specifies the size of generated images. Supported + // values are `1K`, `2K`, `4K`. If not specified, the model will use default + // value `1K`. + // + ImageSize *string `json:"imageSize,omitempty,omitzero"` + + // Optional. Compression quality of the generated image (for + // ``image/jpeg`` only). This field is not supported in Gemini API. + // + OutputCompressionQuality *int `json:"outputCompressionQuality,omitempty,omitzero"` + + // Optional. MIME type of the generated image. This field is not + // supported in Gemini API. + // + OutputMimeType *string `json:"outputMimeType,omitempty,omitzero"` + + // Optional. Controls the generation of people. Supported values are: + // ALLOW_ALL, ALLOW_ADULT, ALLOW_NONE. + // + PersonGeneration *string `json:"personGeneration,omitempty,omitzero"` + + // Optional. Controls whether prominent people (celebrities) generation is + // allowed. + // If used with personGeneration, personGeneration enum would take precedence. For + // instance, + // if ALLOW_NONE is set, all person generation would be blocked. If this field is + // unspecified, + // the default behavior is to allow prominent people. This field is not supported + // in + // Gemini API. + // + ProminentPeople *GoogleAPIImageConfigProminentPeople `json:"prominentPeople,omitempty,omitzero"` +} + +// The image output format for generated images. This data type is not supported in +// Gemini API. +type GoogleAPIImageConfigImageOutputOptions struct { + // Optional. The compression quality of the output image. + // + CompressionQuality *int `json:"compressionQuality,omitempty,omitzero"` + + // Optional. The image format that the output should be saved as. + // + MimeType *string `json:"mimeType,omitempty,omitzero"` +} + +type GoogleAPIImageConfigProminentPeople string + +const GoogleAPIImageConfigProminentPeopleALLOWPROMINENTPEOPLE GoogleAPIImageConfigProminentPeople = "ALLOW_PROMINENT_PEOPLE" +const GoogleAPIImageConfigProminentPeopleBLOCKPROMINENTPEOPLE GoogleAPIImageConfigProminentPeople = "BLOCK_PROMINENT_PEOPLE" +const GoogleAPIImageConfigProminentPeoplePROMINENTPEOPLEUNSPECIFIED GoogleAPIImageConfigProminentPeople = "PROMINENT_PEOPLE_UNSPECIFIED" + +// Image search for grounding and related configurations. +type GoogleAPIImageSearch map[string]interface{} + +// Represents a time interval, encoded as a Timestamp start (inclusive) and a +// Timestamp +// end (exclusive). The start must be less than or equal to the end. When the start +// equals the end, the interval is empty (matches no time). When both start and end +// are unspecified, the interval matches any time. +type GoogleAPIInterval struct { + // Optional. Exclusive end of the interval. If specified, a Timestamp matching + // this + // interval will have to be before the end. + // + EndTime *time.Time `json:"endTime,omitempty,omitzero"` + + // Optional. Inclusive start of the interval. If specified, a Timestamp matching + // this + // interval will have to be the same or after the start. + // + StartTime *time.Time `json:"startTime,omitempty,omitzero"` +} + +// An object that represents a latitude/longitude pair. +// This is expressed as a pair of doubles to represent degrees latitude and +// degrees longitude. Unless specified otherwise, this object must conform to the +// +// WGS84 standard. Values must be within normalized ranges. +type GoogleAPILatLng struct { + // Optional. The latitude in degrees. It must be in the range [-90.0, +90.0]. + // + Latitude *float64 `json:"latitude,omitempty,omitzero"` + + // Optional. The longitude in degrees. It must be in the range [-180.0, +180.0] + // + Longitude *float64 `json:"longitude,omitempty,omitzero"` +} + +// A MCPServer is a server that can be called by the model to perform actions. It +// is +// a server that implements the MCP protocol. Next ID: 5. This data type is not +// supported +// in Vertex AI. +type GoogleAPIMCPServer struct { + // The name of the MCPServer. + // + Name *string `json:"name,omitempty,omitzero"` + + // A transport that can stream HTTP requests and responses. + // + StreamableHttpTransport *GoogleAPIStreamableHTTPTransport `json:"streamableHttpTransport,omitempty,omitzero"` +} + +// Configuration for Model Armor. Model Armor is a Google Cloud service that +// provides +// safety and security filtering for prompts and responses. It helps protect your +// AI +// applications from risks such as harmful content, sensitive data leakage, and +// prompt +// injection attacks. This data type is not supported in Gemini API. +type GoogleAPIModelArmorConfig struct { + // Optional. The resource name of the Model Armor template to use for prompt + // screening. + // A Model Armor template is a set of customized filters and thresholds that + // define + // how Model Armor screens content. If specified, Model Armor will use this + // template + // to check the user's prompt for safety and security risks before it is sent to + // the + // model. The name must be in the format + // `projects/{project}/locations/{location}/templates/{template}`. + // + PromptTemplateName *string `json:"promptTemplateName,omitempty,omitzero"` + + // Optional. The resource name of the Model Armor template to use for response + // screening. + // A Model Armor template is a set of customized filters and thresholds that + // define + // how Model Armor screens content. If specified, Model Armor will use this + // template + // to check the model's response for safety and security risks before it is + // returned + // to the user. The name must be in the format + // `projects/{project}/locations/{location}/templates/{template}`. + // + ResponseTemplateName *string `json:"responseTemplateName,omitempty,omitzero"` +} + +// Config for model selection. +type GoogleAPIModelSelectionConfig struct { + // Optional. Options for feature selection preference. + // + FeatureSelectionPreference *GoogleAPIModelSelectionConfigFeatureSelectionPreference `json:"featureSelectionPreference,omitempty,omitzero"` +} + +type GoogleAPIModelSelectionConfigFeatureSelectionPreference string + +const GoogleAPIModelSelectionConfigFeatureSelectionPreferenceBALANCED GoogleAPIModelSelectionConfigFeatureSelectionPreference = "BALANCED" +const GoogleAPIModelSelectionConfigFeatureSelectionPreferenceFEATURESELECTIONPREFERENCEUNSPECIFIED GoogleAPIModelSelectionConfigFeatureSelectionPreference = "FEATURE_SELECTION_PREFERENCE_UNSPECIFIED" +const GoogleAPIModelSelectionConfigFeatureSelectionPreferencePRIORITIZECOST GoogleAPIModelSelectionConfigFeatureSelectionPreference = "PRIORITIZE_COST" +const GoogleAPIModelSelectionConfigFeatureSelectionPreferencePRIORITIZEQUALITY GoogleAPIModelSelectionConfigFeatureSelectionPreference = "PRIORITIZE_QUALITY" + +// Configuration for a multi-speaker text-to-speech request. +type GoogleAPIMultiSpeakerVoiceConfig struct { + // Required. A list of configurations for the voices of the speakers. Exactly two + // speaker + // voice configurations must be provided. + // + SpeakerVoiceConfigs []GoogleAPISpeakerVoiceConfig `json:"speakerVoiceConfigs,omitempty,omitzero"` +} // Native Google Gen AI GenerateContent arguments and configuration used by // Captain's API runtime. @@ -27,13 +1088,13 @@ type GoogleAPIOptions struct { FrequencyPenalty *float64 `json:"frequencyPenalty,omitempty,omitzero"` // Per-request HTTP transport and API version settings. - HttpOptions *json.RawMessage `json:"httpOptions,omitempty,omitzero"` + HttpOptions *GoogleAPIHTTPOptions `json:"httpOptions,omitempty,omitzero"` // Generation options for image response modalities. - ImageConfig *json.RawMessage `json:"imageConfig,omitempty,omitzero"` + ImageConfig *GoogleAPIImageConfig `json:"imageConfig,omitempty,omitzero"` // String key-value labels attached to the request for billing and reporting. - Labels Labels `json:"labels,omitempty,omitzero"` + Labels GoogleAPIOptionsLabels `json:"labels,omitempty,omitzero"` // Number of top token log probabilities returned per decoding step. Logprobs *int `json:"logprobs,omitempty,omitzero"` @@ -42,22 +1103,22 @@ type GoogleAPIOptions struct { MaxOutputTokens *int `json:"maxOutputTokens,omitempty,omitzero"` // Resolution requested when the model processes media inputs. - MediaResolution *string `json:"mediaResolution,omitempty,omitzero"` + MediaResolution *GoogleAPIOptionsMediaResolution `json:"mediaResolution,omitempty,omitzero"` // Google model identifier passed to GenerateContent. Model string `json:"model"` // Model Armor template and filtering behavior applied to the request. - ModelArmorConfig *json.RawMessage `json:"modelArmorConfig,omitempty,omitzero"` + ModelArmorConfig *GoogleAPIModelArmorConfig `json:"modelArmorConfig,omitempty,omitzero"` // Constraints used by automatic model selection. - ModelSelectionConfig *json.RawMessage `json:"modelSelectionConfig,omitempty,omitzero"` + ModelSelectionConfig *GoogleAPIModelSelectionConfig `json:"modelSelectionConfig,omitempty,omitzero"` // Penalty applied when a token has appeared in the generated text. PresencePenalty *float64 `json:"presencePenalty,omitempty,omitzero"` // Raw JSON Schema constraining generated JSON output. - ResponseJsonSchema *json.RawMessage `json:"responseJsonSchema,omitempty,omitzero"` + ResponseJsonSchema interface{} `json:"responseJsonSchema,omitempty,omitzero"` // Whether token log probabilities are included in the response. ResponseLogprobs *bool `json:"responseLogprobs,omitempty,omitzero"` @@ -69,22 +1130,22 @@ type GoogleAPIOptions struct { ResponseModalities []string `json:"responseModalities,omitempty,omitzero"` // Google schema constraining a structured response. - ResponseSchema *json.RawMessage `json:"responseSchema,omitempty,omitzero"` + ResponseSchema *GoogleAPISchema `json:"responseSchema,omitempty,omitzero"` // Model routing behavior for supported Google endpoints. - RoutingConfig *json.RawMessage `json:"routingConfig,omitempty,omitzero"` + RoutingConfig *GoogleAPIGenerationConfigRoutingConfig `json:"routingConfig,omitempty,omitzero"` // Per-category content safety thresholds applied to the request. - SafetySettings *json.RawMessage `json:"safetySettings,omitempty,omitzero"` + SafetySettings []GoogleAPISafetySetting `json:"safetySettings,omitempty,omitzero"` // Fixed sampling seed used for best-effort deterministic generation. Seed *int `json:"seed,omitempty,omitzero"` // Google processing tier used for the request. - ServiceTier *string `json:"serviceTier,omitempty,omitzero"` + ServiceTier *GoogleAPIOptionsServiceTier `json:"serviceTier,omitempty,omitzero"` // Voice and language settings used for generated speech. - SpeechConfig *json.RawMessage `json:"speechConfig,omitempty,omitzero"` + SpeechConfig *GoogleAPISpeechConfig `json:"speechConfig,omitempty,omitzero"` // Text sequences that stop generation when encountered. StopSequences []string `json:"stopSequences,omitempty,omitzero"` @@ -93,19 +1154,19 @@ type GoogleAPIOptions struct { Stream *bool `json:"stream,omitempty,omitzero"` // System instruction content supplied separately from the conversation. - SystemInstruction *json.RawMessage `json:"systemInstruction,omitempty,omitzero"` + SystemInstruction *GoogleAPIContent `json:"systemInstruction,omitempty,omitzero"` // Sampling temperature used for response generation. Temperature *float64 `json:"temperature,omitempty,omitzero"` // Thinking budget and inclusion settings for reasoning-capable Gemini models. - ThinkingConfig *json.RawMessage `json:"thinkingConfig,omitempty,omitzero"` + ThinkingConfig *GoogleAPIThinkingConfig `json:"thinkingConfig,omitempty,omitzero"` // Native policy controlling Google function-calling behavior. - ToolConfig *json.RawMessage `json:"toolConfig,omitempty,omitzero"` + ToolConfig *GoogleAPIToolConfig `json:"toolConfig,omitempty,omitzero"` // Native Google tool declarations derived from Captain caller tools. - Tools *json.RawMessage `json:"tools,omitempty,omitzero"` + Tools []GoogleAPITool `json:"tools,omitempty,omitzero"` // Number of highest-probability tokens retained during sampling. TopK *float64 `json:"topK,omitempty,omitzero"` @@ -115,4 +1176,975 @@ type GoogleAPIOptions struct { } // String key-value labels attached to the request for billing and reporting. -type Labels map[string]string +type GoogleAPIOptionsLabels map[string]string + +type GoogleAPIOptionsMediaResolution string + +const GoogleAPIOptionsMediaResolutionMEDIARESOLUTIONHIGH GoogleAPIOptionsMediaResolution = "MEDIA_RESOLUTION_HIGH" +const GoogleAPIOptionsMediaResolutionMEDIARESOLUTIONLOW GoogleAPIOptionsMediaResolution = "MEDIA_RESOLUTION_LOW" +const GoogleAPIOptionsMediaResolutionMEDIARESOLUTIONMEDIUM GoogleAPIOptionsMediaResolution = "MEDIA_RESOLUTION_MEDIUM" +const GoogleAPIOptionsMediaResolutionMEDIARESOLUTIONUNSPECIFIED GoogleAPIOptionsMediaResolution = "MEDIA_RESOLUTION_UNSPECIFIED" + +type GoogleAPIOptionsServiceTier string + +const GoogleAPIOptionsServiceTierFlex GoogleAPIOptionsServiceTier = "flex" +const GoogleAPIOptionsServiceTierPriority GoogleAPIOptionsServiceTier = "priority" +const GoogleAPIOptionsServiceTierStandard GoogleAPIOptionsServiceTier = "standard" +const GoogleAPIOptionsServiceTierUnspecified GoogleAPIOptionsServiceTier = "unspecified" + +// A datatype containing media content. +// Exactly one field within a Part should be set, representing the specific type +// of content being conveyed. Using multiple fields within the same `Part` +// instance is considered invalid. +type GoogleAPIPart struct { + // Optional. The result of executing the ExecutableCode. + // + CodeExecutionResult *GoogleAPICodeExecutionResult `json:"codeExecutionResult,omitempty,omitzero"` + + // Optional. Code generated by the model that is intended to be executed. + // + ExecutableCode *GoogleAPIExecutableCode `json:"executableCode,omitempty,omitzero"` + + // Optional. The URI-based data of the part. This can be used to include files + // from + // Google Cloud Storage. + // + FileData *GoogleAPIFileData `json:"fileData,omitempty,omitzero"` + + // Optional. A predicted [FunctionCall] returned from the model that contains a + // string + // representing the [FunctionDeclaration.Name] with the parameters and their + // values. + // + FunctionCall *GoogleAPIFunctionCall `json:"functionCall,omitempty,omitzero"` + + // Optional. The result output of a [FunctionCall] that contains a string + // representing + // the [FunctionDeclaration.Name] and a structured JSON object containing any + // output + // from the function call. It is used as context to the model. + // + FunctionResponse *GoogleAPIFunctionResponse `json:"functionResponse,omitempty,omitzero"` + + // Optional. The inline data content of the part. This can be used to include + // images, + // audio, or video in a request. + // + InlineData *GoogleAPIBlob `json:"inlineData,omitempty,omitzero"` + + // Optional. Media resolution for the input media. + // + MediaResolution *GoogleAPIPartMediaResolution `json:"mediaResolution,omitempty,omitzero"` + + // Custom metadata associated with the Part. Agents using genai.Part as content + // representation + // may need to keep track of the additional information. For example it can be + // name + // of a file/source from which the Part originates or a way to multiplex multiple + // Part + // streams. This field is not supported in Vertex AI. + // + PartMetadata GoogleAPIPartPartMetadata `json:"partMetadata,omitempty,omitzero"` + + // Optional. The text content of the part. When sent from the VSCode Gemini Code + // Assist + // extension, references to @mentioned items will be converted to markdown + // boldface + // text. For example `@my-repo` will be converted to and sent as `**my-repo**` by + // the + // IDE agent. + // + Text *string `json:"text,omitempty,omitzero"` + + // Optional. Indicates whether the `part` represents the model's thought process + // or + // reasoning. + // + Thought *bool `json:"thought,omitempty,omitzero"` + + // Optional. An opaque signature for the thought so it can be reused in subsequent + // requests. + // + ThoughtSignature *string `json:"thoughtSignature,omitempty,omitzero"` + + // Optional. Server-side tool call. This field is populated when the model + // predicts + // a tool invocation that should be executed on the server. The client is expected + // to + // echo this message back to the API. + // + ToolCall *GoogleAPIToolCall `json:"toolCall,omitempty,omitzero"` + + // Optional. The output from a server-side ToolCall execution. This field is + // populated + // by the client with the results of executing the corresponding ToolCall. + // + ToolResponse *GoogleAPIToolResponse `json:"toolResponse,omitempty,omitzero"` + + // Optional. Video metadata. The metadata should only be specified while the video + // data + // is presented in inline_data or file_data. + // + VideoMetadata *GoogleAPIVideoMetadata `json:"videoMetadata,omitempty,omitzero"` +} + +// Media resolution for the input media. +type GoogleAPIPartMediaResolution struct { + // Optional. The tokenization quality used for given media. + // + Level *GoogleAPIPartMediaResolutionLevel `json:"level,omitempty,omitzero"` + + // Optional. Specifies the required sequence length for media tokenization. + // + NumTokens *int `json:"numTokens,omitempty,omitzero"` +} + +type GoogleAPIPartMediaResolutionLevel string + +const GoogleAPIPartMediaResolutionLevelMEDIARESOLUTIONHIGH GoogleAPIPartMediaResolutionLevel = "MEDIA_RESOLUTION_HIGH" +const GoogleAPIPartMediaResolutionLevelMEDIARESOLUTIONLOW GoogleAPIPartMediaResolutionLevel = "MEDIA_RESOLUTION_LOW" +const GoogleAPIPartMediaResolutionLevelMEDIARESOLUTIONMEDIUM GoogleAPIPartMediaResolutionLevel = "MEDIA_RESOLUTION_MEDIUM" +const GoogleAPIPartMediaResolutionLevelMEDIARESOLUTIONULTRAHIGH GoogleAPIPartMediaResolutionLevel = "MEDIA_RESOLUTION_ULTRA_HIGH" +const GoogleAPIPartMediaResolutionLevelMEDIARESOLUTIONUNSPECIFIED GoogleAPIPartMediaResolutionLevel = "MEDIA_RESOLUTION_UNSPECIFIED" + +// Custom metadata associated with the Part. Agents using genai.Part as content +// representation +// may need to keep track of the additional information. For example it can be name +// of a file/source from which the Part originates or a way to multiplex multiple +// Part +// streams. This field is not supported in Vertex AI. +type GoogleAPIPartPartMetadata map[string]interface{} + +// Partial argument value of the function call. This data type is not supported in +// Gemini +// API. +type GoogleAPIPartialArg struct { + // Optional. Represents a boolean value. + // + BoolValue *bool `json:"boolValue,omitempty,omitzero"` + + // Required. A JSON Path (RFC 9535) to the argument being streamed. + // https://datatracker.ietf.org/doc/html/rfc9535. + // e.g. "$.foo.bar[0].data". + // + JsonPath *string `json:"jsonPath,omitempty,omitzero"` + + // Optional. Represents a NULL value. + // + NullValue *string `json:"nullValue,omitempty,omitzero"` + + // Optional. Represents a double value. + // + NumberValue *float64 `json:"numberValue,omitempty,omitzero"` + + // Optional. Represents a string value. + // + StringValue *string `json:"stringValue,omitempty,omitzero"` + + // Optional. Whether this is not the last part of the same json_path. If true, + // another + // PartialArg message for the current json_path is expected to follow. + // + WillContinue *bool `json:"willContinue,omitempty,omitzero"` +} + +// Configuration for a prebuilt voice. +type GoogleAPIPrebuiltVoiceConfig struct { + // The name of the prebuilt voice to use. + // + VoiceName *string `json:"voiceName,omitempty,omitzero"` +} + +// Specifies the context retrieval config. This data type is not supported in +// Gemini +// API. +type GoogleAPIRAGRetrievalConfig struct { + // Optional. Config for filters. + // + Filter *GoogleAPIRAGRetrievalConfigFilter `json:"filter,omitempty,omitzero"` + + // Optional. Config for Hybrid Search. + // + HybridSearch *GoogleAPIRAGRetrievalConfigHybridSearch `json:"hybridSearch,omitempty,omitzero"` + + // Optional. Config for ranking and reranking. + // + Ranking *GoogleAPIRAGRetrievalConfigRanking `json:"ranking,omitempty,omitzero"` + + // Optional. The number of contexts to retrieve. + // + TopK *int `json:"topK,omitempty,omitzero"` +} + +// Config for filters. This data type is not supported in Gemini API. +type GoogleAPIRAGRetrievalConfigFilter struct { + // Optional. String for metadata filtering. + // + MetadataFilter *string `json:"metadataFilter,omitempty,omitzero"` + + // Optional. Only returns contexts with vector distance smaller than the + // threshold. + // + VectorDistanceThreshold *float64 `json:"vectorDistanceThreshold,omitempty,omitzero"` + + // Optional. Only returns contexts with vector similarity larger than the + // threshold. + // + VectorSimilarityThreshold *float64 `json:"vectorSimilarityThreshold,omitempty,omitzero"` +} + +// Config for Hybrid Search. This data type is not supported in Gemini API. +type GoogleAPIRAGRetrievalConfigHybridSearch struct { + // Optional. Alpha value controls the weight between dense and sparse vector + // search + // results. The range is [0, 1], while 0 means sparse vector search only and 1 + // means + // dense vector search only. The default value is 0.5 which balances sparse and + // dense + // vector search equally. + // + Alpha *float64 `json:"alpha,omitempty,omitzero"` +} + +// Config for ranking and reranking. This data type is not supported in Gemini API. +type GoogleAPIRAGRetrievalConfigRanking struct { + // Optional. Config for LlmRanker. + // + LlmRanker *GoogleAPIRAGRetrievalConfigRankingLlmRanker `json:"llmRanker,omitempty,omitzero"` + + // Optional. Config for Rank Service. + // + RankService *GoogleAPIRAGRetrievalConfigRankingRankService `json:"rankService,omitempty,omitzero"` +} + +// Config for LlmRanker. This data type is not supported in Gemini API. +type GoogleAPIRAGRetrievalConfigRankingLlmRanker struct { + // Optional. The model name used for ranking. See [Supported + // models](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/inference#supported-models). + // + ModelName *string `json:"modelName,omitempty,omitzero"` +} + +// Config for Rank Service. This data type is not supported in Gemini API. +type GoogleAPIRAGRetrievalConfigRankingRankService struct { + // Optional. The model name of the rank service. Format: + // `semantic-ranker-512@latest` + // + ModelName *string `json:"modelName,omitempty,omitzero"` +} + +// The configuration for the replicated voice to use. +type GoogleAPIReplicatedVoiceConfig struct { + // Optional. The mimetype of the voice sample. The only currently supported + // value is `audio/wav`. This represents 16-bit signed little-endian wav + // data, with a 24kHz sampling rate. + // + MimeType *string `json:"mimeType,omitempty,omitzero"` + + // Optional. The sample of the custom voice. + // + VoiceSampleAudio *string `json:"voiceSampleAudio,omitempty,omitzero"` +} + +// Defines a retrieval tool that model can call to access external knowledge. This +// data +// type is not supported in Gemini API. +type GoogleAPIRetrieval struct { + // Optional. Deprecated. This option is no longer supported. + // + DisableAttribution *bool `json:"disableAttribution,omitempty,omitzero"` + + // Use data source powered by external API for grounding. + // + ExternalApi *GoogleAPIExternalAPI `json:"externalApi,omitempty,omitzero"` + + // Set to use data source powered by Vertex AI Search. + // + VertexAiSearch *GoogleAPIVertexAISearch `json:"vertexAiSearch,omitempty,omitzero"` + + // Set to use data source powered by Vertex RAG store. User data is uploaded via + // the + // VertexRAGDataService. + // + VertexRagStore *GoogleAPIVertexRAGStore `json:"vertexRagStore,omitempty,omitzero"` +} + +// Retrieval config. +type GoogleAPIRetrievalConfig struct { + // The language code of the user. + // + LanguageCode *string `json:"languageCode,omitempty,omitzero"` + + // Optional. The location of the user. + // + LatLng *GoogleAPILatLng `json:"latLng,omitempty,omitzero"` +} + +// A safety setting that affects the safety-blocking behavior. A SafetySetting +// consists +// of a harm category and a threshold for that category. +type GoogleAPISafetySetting struct { + // Required. The harm category to be blocked. + // + Category *GoogleAPISafetySettingCategory `json:"category,omitempty,omitzero"` + + // Optional. The method for blocking content. If not specified, the default + // behavior + // is to use the probability score. This field is not supported in Gemini API. + // + Method *GoogleAPISafetySettingMethod `json:"method,omitempty,omitzero"` + + // Required. The threshold for blocking content. If the harm probability exceeds + // this + // threshold, the content will be blocked. + // + Threshold *GoogleAPISafetySettingThreshold `json:"threshold,omitempty,omitzero"` +} + +type GoogleAPISafetySettingCategory string + +const GoogleAPISafetySettingCategoryHARMCATEGORYCIVICINTEGRITY GoogleAPISafetySettingCategory = "HARM_CATEGORY_CIVIC_INTEGRITY" +const GoogleAPISafetySettingCategoryHARMCATEGORYDANGEROUSCONTENT GoogleAPISafetySettingCategory = "HARM_CATEGORY_DANGEROUS_CONTENT" +const GoogleAPISafetySettingCategoryHARMCATEGORYHARASSMENT GoogleAPISafetySettingCategory = "HARM_CATEGORY_HARASSMENT" +const GoogleAPISafetySettingCategoryHARMCATEGORYHATESPEECH GoogleAPISafetySettingCategory = "HARM_CATEGORY_HATE_SPEECH" +const GoogleAPISafetySettingCategoryHARMCATEGORYIMAGEDANGEROUSCONTENT GoogleAPISafetySettingCategory = "HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT" +const GoogleAPISafetySettingCategoryHARMCATEGORYIMAGEHARASSMENT GoogleAPISafetySettingCategory = "HARM_CATEGORY_IMAGE_HARASSMENT" +const GoogleAPISafetySettingCategoryHARMCATEGORYIMAGEHATE GoogleAPISafetySettingCategory = "HARM_CATEGORY_IMAGE_HATE" +const GoogleAPISafetySettingCategoryHARMCATEGORYIMAGESEXUALLYEXPLICIT GoogleAPISafetySettingCategory = "HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT" +const GoogleAPISafetySettingCategoryHARMCATEGORYJAILBREAK GoogleAPISafetySettingCategory = "HARM_CATEGORY_JAILBREAK" +const GoogleAPISafetySettingCategoryHARMCATEGORYSEXUALLYEXPLICIT GoogleAPISafetySettingCategory = "HARM_CATEGORY_SEXUALLY_EXPLICIT" +const GoogleAPISafetySettingCategoryHARMCATEGORYUNSPECIFIED GoogleAPISafetySettingCategory = "HARM_CATEGORY_UNSPECIFIED" + +type GoogleAPISafetySettingMethod string + +const GoogleAPISafetySettingMethodHARMBLOCKMETHODUNSPECIFIED GoogleAPISafetySettingMethod = "HARM_BLOCK_METHOD_UNSPECIFIED" +const GoogleAPISafetySettingMethodPROBABILITY GoogleAPISafetySettingMethod = "PROBABILITY" +const GoogleAPISafetySettingMethodSEVERITY GoogleAPISafetySettingMethod = "SEVERITY" + +type GoogleAPISafetySettingThreshold string + +const GoogleAPISafetySettingThresholdBLOCKLOWANDABOVE GoogleAPISafetySettingThreshold = "BLOCK_LOW_AND_ABOVE" +const GoogleAPISafetySettingThresholdBLOCKMEDIUMANDABOVE GoogleAPISafetySettingThreshold = "BLOCK_MEDIUM_AND_ABOVE" +const GoogleAPISafetySettingThresholdBLOCKNONE GoogleAPISafetySettingThreshold = "BLOCK_NONE" +const GoogleAPISafetySettingThresholdBLOCKONLYHIGH GoogleAPISafetySettingThreshold = "BLOCK_ONLY_HIGH" +const GoogleAPISafetySettingThresholdHARMBLOCKTHRESHOLDUNSPECIFIED GoogleAPISafetySettingThreshold = "HARM_BLOCK_THRESHOLD_UNSPECIFIED" +const GoogleAPISafetySettingThresholdOFF GoogleAPISafetySettingThreshold = "OFF" + +// Schema is used to define the format of input/output data. +// Represents a select subset of an [OpenAPI 3.0 schema +// object](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may +// be added in the future as needed. +// You can find more details and examples at +// https://spec.openapis.org/oas/v3.0.3.html#schema-object +type GoogleAPISchema struct { + // Optional. The instance must be valid against any (one or more) of the + // subschemas + // listed in `any_of`. + // + AnyOf []GoogleAPISchema `json:"anyOf,omitempty,omitzero"` + + // Optional. Default value to use if the field is not specified. + // + Default interface{} `json:"default,omitempty,omitzero"` + + // Optional. Describes the data. The model uses this field to understand the + // purpose + // of the schema and how to use it. It is a best practice to provide a clear and + // descriptive + // explanation for the schema and its properties here, rather than in the prompt. + // + Description *string `json:"description,omitempty,omitzero"` + + // Optional. Possible values of the field. This field can be used to restrict a + // value + // to a fixed set of values. To mark a field as an enum, set `format` to `enum` + // and + // provide the list of possible values in `enum`. For example: 1. To define + // directions: + // `{type:STRING, format:enum, enum:["EAST", "NORTH", "SOUTH", "WEST"]}` 2. To + // define + // apartment numbers: `{type:INTEGER, format:enum, enum:["101", "201", "301"]}` + // + Enum []string `json:"enum,omitempty,omitzero"` + + // Optional. Example of an instance of this schema. + // + Example interface{} `json:"example,omitempty,omitzero"` + + // Optional. The format of the data. For `NUMBER` type, format can be `float` or + // `double`. + // For `INTEGER` type, format can be `int32` or `int64`. For `STRING` type, format + // can + // be `email`, `byte`, `date`, `date-time`, `password`, and other formats to + // further + // refine the data type. + // + Format *string `json:"format,omitempty,omitzero"` + + // Optional. If type is `ARRAY`, `items` specifies the schema of elements in the + // array. + // + Items *GoogleAPISchema `json:"items,omitempty,omitzero"` + + // Optional. If type is `ARRAY`, `max_items` specifies the maximum number of items + // in + // an array. + // + MaxItems *int `json:"maxItems,omitempty,omitzero"` + + // Optional. If type is `STRING`, `max_length` specifies the maximum length of the + // string. + // + MaxLength *int `json:"maxLength,omitempty,omitzero"` + + // Optional. If type is `OBJECT`, `max_properties` specifies the maximum number of + // properties + // that can be provided. + // + MaxProperties *int `json:"maxProperties,omitempty,omitzero"` + + // Optional. If type is `INTEGER` or `NUMBER`, `maximum` specifies the maximum + // allowed + // value. + // + Maximum *float64 `json:"maximum,omitempty,omitzero"` + + // Optional. If type is `ARRAY`, `min_items` specifies the minimum number of items + // in + // an array. + // + MinItems *int `json:"minItems,omitempty,omitzero"` + + // Optional. If type is `STRING`, `min_length` specifies the minimum length of the + // string. + // + MinLength *int `json:"minLength,omitempty,omitzero"` + + // Optional. If type is `OBJECT`, `min_properties` specifies the minimum number of + // properties + // that can be provided. + // + MinProperties *int `json:"minProperties,omitempty,omitzero"` + + // Optional. Minimum value of the Type.INTEGER and Type.NUMBER. + // + Minimum *float64 `json:"minimum,omitempty,omitzero"` + + // Optional. Indicates if the value of this field can be null. + // + Nullable *bool `json:"nullable,omitempty,omitzero"` + + // Optional. If type is `STRING`, `pattern` specifies a regular expression that + // the + // string must match. + // + Pattern *string `json:"pattern,omitempty,omitzero"` + + // Optional. If type is `OBJECT`, `properties` is a map of property names to + // schema + // definitions for each property of the object. + // + Properties GoogleAPISchemaProperties `json:"properties,omitempty,omitzero"` + + // Optional. Order of properties displayed or used where order matters. This is + // not + // a standard field in OpenAPI specification, but can be used to control the order + // of + // properties. + // + PropertyOrdering []string `json:"propertyOrdering,omitempty,omitzero"` + + // Optional. If type is `OBJECT`, `required` lists the names of properties that + // must + // be present. + // + Required []string `json:"required"` + + // Optional. Title for the schema. + // + Title *string `json:"title,omitempty,omitzero"` + + // Optional. Data type of the schema field. + // + Type *GoogleAPISchemaType `json:"type,omitempty,omitzero"` +} + +// Optional. If type is `OBJECT`, `properties` is a map of property names to schema +// definitions for each property of the object. +type GoogleAPISchemaProperties map[string]GoogleAPISchema + +type GoogleAPISchemaType string + +const GoogleAPISchemaTypeARRAY GoogleAPISchemaType = "ARRAY" +const GoogleAPISchemaTypeBOOLEAN GoogleAPISchemaType = "BOOLEAN" +const GoogleAPISchemaTypeINTEGER GoogleAPISchemaType = "INTEGER" +const GoogleAPISchemaTypeNULL GoogleAPISchemaType = "NULL" +const GoogleAPISchemaTypeNUMBER GoogleAPISchemaType = "NUMBER" +const GoogleAPISchemaTypeOBJECT GoogleAPISchemaType = "OBJECT" +const GoogleAPISchemaTypeSTRING GoogleAPISchemaType = "STRING" +const GoogleAPISchemaTypeTYPEUNSPECIFIED GoogleAPISchemaType = "TYPE_UNSPECIFIED" + +// Different types of search that can be enabled on the GoogleSearch tool. +type GoogleAPISearchTypes struct { + // Optional. Setting this field enables image search. Image bytes are returned. + // + ImageSearch GoogleAPIImageSearch `json:"imageSearch,omitempty,omitzero"` + + // Optional. Setting this field enables web search. Only text results are + // returned. + // + WebSearch GoogleAPIWebSearch `json:"webSearch,omitempty,omitzero"` +} + +// Configuration for a single speaker in a multi-speaker setup. +type GoogleAPISpeakerVoiceConfig struct { + // Required. The name of the speaker. This should be the same as the speaker name + // used + // in the prompt. + // + Speaker *string `json:"speaker,omitempty,omitzero"` + + // Required. The configuration for the voice of this speaker. + // + VoiceConfig *GoogleAPIVoiceConfig `json:"voiceConfig,omitempty,omitzero"` +} + +// Config for speech generation and transcription. +type GoogleAPISpeechConfig struct { + // Optional. The language code (ISO 639-1) for the speech synthesis. + // + LanguageCode *string `json:"languageCode,omitempty,omitzero"` + + // The configuration for a multi-speaker text-to-speech request. This field is + // mutually + // exclusive with `voice_config`. + // + MultiSpeakerVoiceConfig *GoogleAPIMultiSpeakerVoiceConfig `json:"multiSpeakerVoiceConfig,omitempty,omitzero"` + + // Optional. The configuration in case of single-voice output. + // + VoiceConfig *GoogleAPIVoiceConfig `json:"voiceConfig,omitempty,omitzero"` +} + +// A transport that can stream HTTP requests and responses. Next ID: 6. This data +// type +// is not supported in Vertex AI. +type GoogleAPIStreamableHTTPTransport struct { + // Optional. Optional: Fields for authentication headers, timeouts, etc., if + // needed. + // + Headers GoogleAPIStreamableHTTPTransportHeaders `json:"headers,omitempty,omitzero"` + + // Timeout for SSE read operations. + // + SseReadTimeout *int `json:"sseReadTimeout,omitempty,omitzero"` + + // Whether to close the client session when the transport closes. + // + TerminateOnClose *bool `json:"terminateOnClose,omitempty,omitzero"` + + // HTTP timeout for regular operations. + // + Timeout *int `json:"timeout,omitempty,omitzero"` + + // The full URL for the MCPServer endpoint. Example: + // "https://api.example.com/mcp". + // + Url *string `json:"url,omitempty,omitzero"` +} + +// Optional. Optional: Fields for authentication headers, timeouts, etc., if +// needed. +type GoogleAPIStreamableHTTPTransportHeaders map[string]string + +// The thinking features configuration. +type GoogleAPIThinkingConfig struct { + // Optional. Indicates whether to include thoughts in the response. If true, + // thoughts + // are returned only if the model supports thought and thoughts are available. + // + IncludeThoughts *bool `json:"includeThoughts,omitempty,omitzero"` + + // Optional. Indicates the thinking budget in tokens. + // + ThinkingBudget *int `json:"thinkingBudget,omitempty,omitzero"` + + // Optional. The number of thoughts tokens that the model should generate. + // + ThinkingLevel *GoogleAPIThinkingConfigThinkingLevel `json:"thinkingLevel,omitempty,omitzero"` +} + +type GoogleAPIThinkingConfigThinkingLevel string + +const GoogleAPIThinkingConfigThinkingLevelHIGH GoogleAPIThinkingConfigThinkingLevel = "HIGH" +const GoogleAPIThinkingConfigThinkingLevelLOW GoogleAPIThinkingConfigThinkingLevel = "LOW" +const GoogleAPIThinkingConfigThinkingLevelMEDIUM GoogleAPIThinkingConfigThinkingLevel = "MEDIUM" +const GoogleAPIThinkingConfigThinkingLevelMINIMAL GoogleAPIThinkingConfigThinkingLevel = "MINIMAL" +const GoogleAPIThinkingConfigThinkingLevelTHINKINGLEVELUNSPECIFIED GoogleAPIThinkingConfigThinkingLevel = "THINKING_LEVEL_UNSPECIFIED" + +// Tool details of a tool that the model may use to generate a response. +type GoogleAPITool struct { + // Optional. CodeExecution tool type. Enables the model to execute code as part of + // generation. + // + CodeExecution *GoogleAPIToolCodeExecution `json:"codeExecution,omitempty,omitzero"` + + // Optional. Tool to support the model interacting directly with the + // computer. If enabled, it automatically populates computer-use specific + // Function Declarations. + // + ComputerUse *GoogleAPIComputerUse `json:"computerUse,omitempty,omitzero"` + + // Optional. Tool to support searching public web data, powered by Vertex AI + // Search + // and Sec4 compliance. This field is not supported in Gemini API. + // + EnterpriseWebSearch *GoogleAPIEnterpriseWebSearch `json:"enterpriseWebSearch,omitempty,omitzero"` + + // Optional. FileSearch tool type. Tool to retrieve knowledge from Semantic + // Retrieval + // corpora. This field is not supported in Vertex AI. + // + FileSearch *GoogleAPIFileSearch `json:"fileSearch,omitempty,omitzero"` + + // Optional. Function tool type. One or more function declarations to be passed to + // the + // model along with the current user query. Model may decide to call a subset of + // these + // functions by populating FunctionCall in the response. User should provide a + // FunctionResponse + // for each function call in the next turn. Based on the function responses, Model + // will + // generate the final response back to the user. Maximum 512 function declarations + // can + // be provided. + // + FunctionDeclarations []GoogleAPIFunctionDeclaration `json:"functionDeclarations,omitempty,omitzero"` + + // Optional. Tool that allows grounding the model's response with + // geospatial context related to the user's query. + // + GoogleMaps *GoogleAPIGoogleMaps `json:"googleMaps,omitempty,omitzero"` + + // Optional. GoogleSearch tool type. Tool to support Google Search in Model. + // Powered + // by Google. + // + GoogleSearch *GoogleAPIGoogleSearch `json:"googleSearch,omitempty,omitzero"` + + // Optional. Specialized retrieval tool that is powered by Google Search. + // + GoogleSearchRetrieval *GoogleAPIGoogleSearchRetrieval `json:"googleSearchRetrieval,omitempty,omitzero"` + + // Optional. MCP Servers to connect to. This field is not supported in Vertex AI. + // + McpServers []GoogleAPIMCPServer `json:"mcpServers,omitempty,omitzero"` + + // Optional. If specified, Vertex AI will use Parallel.ai to search for + // information + // to answer user queries. The search results will be grounded on Parallel.ai and + // presented + // to the model for response generation. This field is not supported in Gemini + // API. + // + ParallelAiSearch *GoogleAPIToolParallelAISearch `json:"parallelAiSearch,omitempty,omitzero"` + + // Optional. Retrieval tool type. System will always execute the provided + // retrieval + // tool(s) to get external knowledge to answer the prompt. Retrieval results are + // presented + // to the model for generation. This field is not supported in Gemini API. + // + Retrieval *GoogleAPIRetrieval `json:"retrieval,omitempty,omitzero"` + + // Optional. Tool to support URL context retrieval. + // + UrlContext GoogleAPIURLContext `json:"urlContext,omitempty,omitzero"` +} + +// A predicted server-side `ToolCall` returned from the model. +// This message contains information about a tool that the model wants to invoke. +// The client is NOT expected to execute this `ToolCall`. Instead, the +// client should pass this `ToolCall` back to the API in a subsequent turn +// within a `Content` message, along with the corresponding `ToolResponse`. +type GoogleAPIToolCall struct { + // Optional. The tool call arguments. Example: {"arg1": "value1", "arg2": + // "value2"}. + // + Args GoogleAPIToolCallArgs `json:"args,omitempty,omitzero"` + + // Optional. Unique identifier of the tool call. The server returns the tool + // response + // with the matching `id`. + // + Id *string `json:"id,omitempty,omitzero"` + + // Optional. The type of tool that was called. + // + ToolType *GoogleAPIToolCallToolType `json:"toolType,omitempty,omitzero"` +} + +// Optional. The tool call arguments. Example: {"arg1": "value1", "arg2": +// "value2"}. +type GoogleAPIToolCallArgs map[string]interface{} + +type GoogleAPIToolCallToolType string + +const GoogleAPIToolCallToolTypeFILESEARCH GoogleAPIToolCallToolType = "FILE_SEARCH" +const GoogleAPIToolCallToolTypeGOOGLEMAPS GoogleAPIToolCallToolType = "GOOGLE_MAPS" +const GoogleAPIToolCallToolTypeGOOGLESEARCHIMAGE GoogleAPIToolCallToolType = "GOOGLE_SEARCH_IMAGE" +const GoogleAPIToolCallToolTypeGOOGLESEARCHWEB GoogleAPIToolCallToolType = "GOOGLE_SEARCH_WEB" +const GoogleAPIToolCallToolTypeTOOLTYPEUNSPECIFIED GoogleAPIToolCallToolType = "TOOL_TYPE_UNSPECIFIED" +const GoogleAPIToolCallToolTypeURLCONTEXT GoogleAPIToolCallToolType = "URL_CONTEXT" + +// Tool that executes code generated by the model, and automatically returns the +// result +// to the model. See also [ExecutableCode]and [CodeExecutionResult] which are input +// and output to this tool. This data type is not supported in Gemini API. +type GoogleAPIToolCodeExecution map[string]interface{} + +// Tool config. +// This config is shared for all tools provided in the request. +type GoogleAPIToolConfig struct { + // Optional. Function calling config. + // + FunctionCallingConfig *GoogleAPIFunctionCallingConfig `json:"functionCallingConfig,omitempty,omitzero"` + + // Optional. If true, the API response will include the server-side tool calls and + // responses + // within the `Content` message. This allows clients to observe the server's tool + // invocations. + // + IncludeServerSideToolInvocations *bool `json:"includeServerSideToolInvocations,omitempty,omitzero"` + + // Optional. Retrieval config. + // + RetrievalConfig *GoogleAPIRetrievalConfig `json:"retrievalConfig,omitempty,omitzero"` +} + +// ParallelAISearch tool type. A tool that uses the Parallel.ai search engine for +// grounding. +// This data type is not supported in Gemini API. +type GoogleAPIToolParallelAISearch struct { + // Optional. The API key for ParallelAISearch. If an API key is not provided, the + // system + // will attempt to verify access by checking for an active Parallel.ai + // subscription + // through the Google Cloud Marketplace. See + // https://docs.parallel.ai/search/search-quickstart + // for more details. + // + ApiKey *string `json:"apiKey,omitempty,omitzero"` + + // Optional. Custom configs for ParallelAISearch. This field can be used to pass + // any + // parameter from the Parallel.ai Search API. See the Parallel.ai documentation + // for + // the full list of available parameters and their usage: + // https://docs.parallel.ai/api-reference/search-beta/search + // Currently only `source_policy`, `excerpts`, `max_results`, `mode`, + // `fetch_policy` + // can be set via this field. For example: { "source_policy": { "include_domains": + // ["google.com", + // "wikipedia.org"], "exclude_domains": ["example.com"] }, "fetch_policy": { + // "max_age_seconds": + // 3600 } } + // + CustomConfigs GoogleAPIToolParallelAISearchCustomConfigs `json:"customConfigs,omitempty,omitzero"` +} + +// Optional. Custom configs for ParallelAISearch. This field can be used to pass +// any +// parameter from the Parallel.ai Search API. See the Parallel.ai documentation for +// the full list of available parameters and their usage: +// https://docs.parallel.ai/api-reference/search-beta/search +// Currently only `source_policy`, `excerpts`, `max_results`, `mode`, +// `fetch_policy` +// can be set via this field. For example: { "source_policy": { "include_domains": +// ["google.com", +// "wikipedia.org"], "exclude_domains": ["example.com"] }, "fetch_policy": { +// "max_age_seconds": +// 3600 } } +type GoogleAPIToolParallelAISearchCustomConfigs map[string]interface{} + +// The output from a server-side `ToolCall` execution. +// This message contains the results of a tool invocation that was initiated by a +// `ToolCall` from the model. The client should pass this `ToolResponse` back to +// the API in a subsequent turn within a `Content` message, along with the +// corresponding `ToolCall`. +type GoogleAPIToolResponse struct { + // Optional. The identifier of the tool call this response is for. + // + Id *string `json:"id,omitempty,omitzero"` + + // Optional. The tool response. + // + Response GoogleAPIToolResponseResponse `json:"response,omitempty,omitzero"` + + // Optional. The type of tool that was called, matching the tool_type in the + // corresponding + // ToolCall. + // + ToolType *GoogleAPIToolResponseToolType `json:"toolType,omitempty,omitzero"` +} + +// Optional. The tool response. +type GoogleAPIToolResponseResponse map[string]interface{} + +type GoogleAPIToolResponseToolType string + +const GoogleAPIToolResponseToolTypeFILESEARCH GoogleAPIToolResponseToolType = "FILE_SEARCH" +const GoogleAPIToolResponseToolTypeGOOGLEMAPS GoogleAPIToolResponseToolType = "GOOGLE_MAPS" +const GoogleAPIToolResponseToolTypeGOOGLESEARCHIMAGE GoogleAPIToolResponseToolType = "GOOGLE_SEARCH_IMAGE" +const GoogleAPIToolResponseToolTypeGOOGLESEARCHWEB GoogleAPIToolResponseToolType = "GOOGLE_SEARCH_WEB" +const GoogleAPIToolResponseToolTypeTOOLTYPEUNSPECIFIED GoogleAPIToolResponseToolType = "TOOL_TYPE_UNSPECIFIED" +const GoogleAPIToolResponseToolTypeURLCONTEXT GoogleAPIToolResponseToolType = "URL_CONTEXT" + +// Tool to support URL context. +type GoogleAPIURLContext map[string]interface{} + +// Retrieve from Vertex AI Search datastore or engine for grounding. datastore and +// engine +// are mutually exclusive. See https://cloud.google.com/products/agent-builder. +// This +// data type is not supported in Gemini API. +type GoogleAPIVertexAISearch struct { + // Specifications that define the specific DataStores to be searched, along with + // configurations + // for those data stores. This is only considered for Engines with multiple data + // stores. + // It should only be set if engine is used. + // + DataStoreSpecs []GoogleAPIVertexAISearchDataStoreSpec `json:"dataStoreSpecs,omitempty,omitzero"` + + // Optional. Fully-qualified Vertex AI Search data store resource ID. Format: + // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}` + // + Datastore *string `json:"datastore,omitempty,omitzero"` + + // Optional. Fully-qualified Vertex AI Search engine resource ID. Format: + // `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}` + // + Engine *string `json:"engine,omitempty,omitzero"` + + // Optional. Filter strings to be passed to the search API. + // + Filter *string `json:"filter,omitempty,omitzero"` + + // Optional. Number of search results to return per query. The default value is + // 10. + // The maximumm allowed value is 10. + // + MaxResults *int `json:"maxResults,omitempty,omitzero"` +} + +// Define data stores within engine to filter on in a search call and +// configurations +// for those data stores. For more information, see +// https://cloud.google.com/generative-ai-app-builder/docs/reference/rpc/google.cloud.discoveryengine.v1#datastorespec. +// This data type is not supported in Gemini API. +type GoogleAPIVertexAISearchDataStoreSpec struct { + // Full resource name of DataStore, such as Format: + // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}` + // + DataStore *string `json:"dataStore,omitempty,omitzero"` + + // Optional. Filter specification to filter documents in the data store specified + // by + // data_store field. For more information on filtering, see + // [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata) + // + Filter *string `json:"filter,omitempty,omitzero"` +} + +// Retrieve from Vertex RAG Store for grounding. This data type is not supported in +// Gemini API. You can find API default values and more details at +// https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/rag-api-v1#parameters-list +type GoogleAPIVertexRAGStore struct { + // Optional. Deprecated. Please use rag_resources instead. + // + RagCorpora []string `json:"ragCorpora,omitempty,omitzero"` + + // Optional. The representation of the RAG source. It can be used to specify + // corpus + // only or ragfiles. Currently only support one corpus or multiple files from one + // corpus. + // In the future we may open up multiple corpora support. + // + RagResources []GoogleAPIVertexRAGStoreRAGResource `json:"ragResources,omitempty,omitzero"` + + // Optional. The retrieval config for the RAG query. + // + RagRetrievalConfig *GoogleAPIRAGRetrievalConfig `json:"ragRetrievalConfig,omitempty,omitzero"` + + // Optional. Number of top k results to return from the selected corpora. + // + SimilarityTopK *int `json:"similarityTopK,omitempty,omitzero"` + + // Optional. Currently only supported for Gemini Multimodal Live API. In Gemini + // Multimodal + // Live API, if `store_context` bool is specified, Gemini will leverage it to + // automatically + // memorize the interactions between the client and Gemini, and retrieve context + // when + // needed to augment the response generation for users' ongoing and future + // interactions. + // + StoreContext *bool `json:"storeContext,omitempty,omitzero"` + + // Optional. Only return results with vector distance smaller than the threshold. + // + VectorDistanceThreshold *float64 `json:"vectorDistanceThreshold,omitempty,omitzero"` +} + +// The definition of the RAG resource. This data type is not supported in Gemini +// API. +type GoogleAPIVertexRAGStoreRAGResource struct { + // Optional. RAGCorpora resource name. Format: + // `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}` + // + RagCorpus *string `json:"ragCorpus,omitempty,omitzero"` + + // Optional. rag_file_id. The files should be in the same rag_corpus set in + // rag_corpus + // field. + // + RagFileIds []string `json:"ragFileIds,omitempty,omitzero"` +} + +// Provides metadata for a video, including the start and end offsets for clipping +// and +// the frame rate. +type GoogleAPIVideoMetadata struct { + // Optional. The end offset of the video. + // + EndOffset *int `json:"endOffset,omitempty,omitzero"` + + // Optional. The frame rate of the video sent to the model. If not specified, the + // default + // value is 1.0. The valid range is (0.0, 24.0]. + // + Fps *float64 `json:"fps,omitempty,omitzero"` + + // Optional. The start offset of the video. + // + StartOffset *int `json:"startOffset,omitempty,omitzero"` +} + +// The configuration for the voice to use. +type GoogleAPIVoiceConfig struct { + // The configuration for a prebuilt voice. + // + PrebuiltVoiceConfig *GoogleAPIPrebuiltVoiceConfig `json:"prebuiltVoiceConfig,omitempty,omitzero"` + + // Optional. The configuration for a replicated voice, which is a clone of a + // user's voice that can be used for speech synthesis. If this is unset, a + // default voice is used. + // + ReplicatedVoiceConfig *GoogleAPIReplicatedVoiceConfig `json:"replicatedVoiceConfig,omitempty,omitzero"` +} + +// Standard web search for grounding and related configurations. Only text results +// are +// returned. +type GoogleAPIWebSearch map[string]interface{} diff --git a/pkg/adapters/zz_generated_jev_api.go b/pkg/adapters/zz_generated_jev_api.go index f62729b0..04d37b69 100644 --- a/pkg/adapters/zz_generated_jev_api.go +++ b/pkg/adapters/zz_generated_jev_api.go @@ -4,36 +4,52 @@ package adapters import "encoding/json" +// Jev APIChoice Question configuration. See the linked native reference for +// semantics and availability. type JevAPIChoiceQuestion struct { - // Criteria corresponds to the JSON schema field "criteria". + // Criteria configuration. See the linked native reference for semantics and + // availability. Criteria JevAPIChoiceQuestionCriteria `json:"criteria"` - // Instructions corresponds to the JSON schema field "instructions". - Instructions interface{} `json:"instructions"` + // Instructions configuration. See the linked native reference for semantics and + // availability. + Instructions json.RawMessage `json:"instructions"` - // Type corresponds to the JSON schema field "type". + // Type configuration. See the linked native reference for semantics and + // availability. Type interface{} `json:"type"` } -type JevAPIChoiceQuestionCriteria map[string]interface{} +// Criteria configuration. See the linked native reference for semantics and +// availability. +type JevAPIChoiceQuestionCriteria map[string]json.RawMessage +// Jev APINoul Question configuration. See the linked native reference for +// semantics and availability. type JevAPINoulQuestion struct { - // Criteria corresponds to the JSON schema field "criteria". + // Criteria configuration. See the linked native reference for semantics and + // availability. Criteria *JevAPINoulQuestionCriteria `json:"criteria,omitempty,omitzero"` - // Instructions corresponds to the JSON schema field "instructions". - Instructions interface{} `json:"instructions"` + // Instructions configuration. See the linked native reference for semantics and + // availability. + Instructions json.RawMessage `json:"instructions"` - // Type corresponds to the JSON schema field "type". + // Type configuration. See the linked native reference for semantics and + // availability. Type interface{} `json:"type"` } +// Criteria configuration. See the linked native reference for semantics and +// availability. type JevAPINoulQuestionCriteria struct { - // False corresponds to the JSON schema field "false". - False interface{} `json:"false,omitempty,omitzero"` + // False configuration. See the linked native reference for semantics and + // availability. + False *json.RawMessage `json:"false,omitempty,omitzero"` - // True corresponds to the JSON schema field "true". - True interface{} `json:"true,omitempty,omitzero"` + // True configuration. See the linked native reference for semantics and + // availability. + True *json.RawMessage `json:"true,omitempty,omitzero"` } // Native TypeSafe SystemOne evaluation request sent by Captain's Jev API runtime. @@ -48,13 +64,18 @@ type JevAPIOptions struct { State json.RawMessage `json:"state"` } +// Jev APIScore Question configuration. See the linked native reference for +// semantics and availability. type JevAPIScoreQuestion struct { - // Criteria corresponds to the JSON schema field "criteria". - Criteria []interface{} `json:"criteria"` + // Criteria configuration. See the linked native reference for semantics and + // availability. + Criteria []json.RawMessage `json:"criteria"` - // Instructions corresponds to the JSON schema field "instructions". - Instructions interface{} `json:"instructions"` + // Instructions configuration. See the linked native reference for semantics and + // availability. + Instructions json.RawMessage `json:"instructions"` - // Type corresponds to the JSON schema field "type". + // Type configuration. See the linked native reference for semantics and + // availability. Type interface{} `json:"type"` } diff --git a/pkg/adapters/zz_generated_openai_agent.go b/pkg/adapters/zz_generated_openai_agent.go index 7e7b89a0..23bbdfa7 100644 --- a/pkg/adapters/zz_generated_openai_agent.go +++ b/pkg/adapters/zz_generated_openai_agent.go @@ -4,122 +4,333 @@ package adapters import "encoding/json" -// Parameters sent in the Codex app-server initialize request. -type Initialize struct { - // Experimental protocol capabilities supported by the client. - Capabilities *json.RawMessage `json:"capabilities,omitempty,omitzero"` +// A path that is guaranteed to be absolute and normalized (though it is not +// guaranteed to be canonicalized or exist on the filesystem). +// +// IMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set +// using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization +// will fail unless the path being deserialized is already absolute. +type OpenAIAgentAbsolutePathBuf string + +// Open AIAgent Additional Context Entry configuration. See the linked native +// reference for semantics and availability. +type OpenAIAgentAdditionalContextEntry struct { + // Kind configuration. See the linked native reference for semantics and + // availability. + Kind OpenAIAgentAdditionalContextKind `json:"kind"` + + // Value configuration. See the linked native reference for semantics and + // availability. + Value string `json:"value"` +} - // Name, title, and version identifying the app-server client. - ClientInfo *json.RawMessage `json:"clientInfo,omitempty,omitzero"` +type OpenAIAgentAdditionalContextKind string + +const OpenAIAgentAdditionalContextKindApplication OpenAIAgentAdditionalContextKind = "application" +const OpenAIAgentAdditionalContextKindUntrusted OpenAIAgentAdditionalContextKind = "untrusted" + +// Open AIAgent Agent Message Input Content configuration. See the linked native +// reference for semantics and availability. +type OpenAIAgentAgentMessageInputContent = json.RawMessage + +type OpenAIAgentApprovalsReviewer string + +const OpenAIAgentApprovalsReviewerAutoReview OpenAIAgentApprovalsReviewer = "auto_review" +const OpenAIAgentApprovalsReviewerGuardianSubagent OpenAIAgentApprovalsReviewer = "guardian_subagent" +const OpenAIAgentApprovalsReviewerUser OpenAIAgentApprovalsReviewer = "user" + +// Open AIAgent Ask For Approval configuration. See the linked native reference for +// semantics and availability. +type OpenAIAgentAskForApproval = json.RawMessage + +// Open AIAgent Byte Range configuration. See the linked native reference for +// semantics and availability. +type OpenAIAgentByteRange struct { + // End configuration. See the linked native reference for semantics and + // availability. + End int `json:"end"` + + // Start configuration. See the linked native reference for semantics and + // availability. + Start int `json:"start"` } -// Native Codex app-server initialize, thread, and turn arguments used by Captain's -// OpenAI agent runtime. -type OpenAIAgentOptions struct { - // Parameters sent in the Codex app-server initialize request. - Initialize *Initialize `json:"initialize,omitempty,omitzero"` +// Location used to resolve a selected capability root. +type OpenAIAgentCapabilityRootLocation = json.RawMessage - // Parameters used to resume an existing Codex app-server thread. - ThreadResume *ThreadResume `json:"threadResume,omitempty,omitzero"` +// Open AIAgent Client Info configuration. See the linked native reference for +// semantics and availability. +type OpenAIAgentClientInfo struct { + // Name configuration. See the linked native reference for semantics and + // availability. + Name string `json:"name"` - // Parameters used to start a new Codex app-server thread. - ThreadStart *ThreadStart `json:"threadStart,omitempty,omitzero"` + // Title configuration. See the linked native reference for semantics and + // availability. + Title OpenAIAgentClientInfoTitle `json:"title,omitempty,omitzero"` - // Parameters used to start a turn on an active Codex app-server thread. - TurnStart *TurnStart `json:"turnStart,omitempty,omitzero"` + // Version configuration. See the linked native reference for semantics and + // availability. + Version string `json:"version"` +} + +// Title configuration. See the linked native reference for semantics and +// availability. +type OpenAIAgentClientInfoTitle *string + +// Collaboration mode for a Codex session. +type OpenAIAgentCollaborationMode struct { + // Mode configuration. See the linked native reference for semantics and + // availability. + Mode OpenAIAgentModeKind `json:"mode"` + + // Settings configuration. See the linked native reference for semantics and + // availability. + Settings OpenAIAgentSettings `json:"settings"` +} + +// Reasoning settings interpreted by the backend for the routed model. +type OpenAIAgentConfigurationReasoning struct { + // Effort configuration. See the linked native reference for semantics and + // availability. + Effort OpenAIAgentReasoningEffort `json:"effort"` +} + +// Open AIAgent Content Item configuration. See the linked native reference for +// semantics and availability. +type OpenAIAgentContentItem = json.RawMessage + +type OpenAIAgentCyberAccessProgram string + +const OpenAIAgentCyberAccessProgramDaybreakBlue OpenAIAgentCyberAccessProgram = "daybreakBlue" +const OpenAIAgentCyberAccessProgramDaybreakRed OpenAIAgentCyberAccessProgram = "daybreakRed" +const OpenAIAgentCyberAccessProgramStandard OpenAIAgentCyberAccessProgram = "standard" + +// Open AIAgent Dynamic Tool Namespace Tool configuration. See the linked native +// reference for semantics and availability. +type OpenAIAgentDynamicToolNamespaceTool = json.RawMessage + +// Open AIAgent Dynamic Tool Spec configuration. See the linked native reference +// for semantics and availability. +type OpenAIAgentDynamicToolSpec = json.RawMessage + +// Open AIAgent Function Call Output Body configuration. See the linked native +// reference for semantics and availability. +type OpenAIAgentFunctionCallOutputBody = json.RawMessage + +// Responses API compatible content items that can be returned by a tool call. This +// is a subset of ContentItem with the types we support as function call outputs. +type OpenAIAgentFunctionCallOutputContentItem = json.RawMessage + +type OpenAIAgentImageDetail string + +const OpenAIAgentImageDetailAuto OpenAIAgentImageDetail = "auto" +const OpenAIAgentImageDetailHigh OpenAIAgentImageDetail = "high" +const OpenAIAgentImageDetailLow OpenAIAgentImageDetail = "low" +const OpenAIAgentImageDetailOriginal OpenAIAgentImageDetail = "original" + +// Client-declared capabilities negotiated during initialize. +type OpenAIAgentInitializeCapabilities struct { + // Opt into receiving experimental API methods and fields. + ExperimentalApi bool `json:"experimentalApi,omitempty,omitzero"` + + // Use explicit gateway OAuth login instead of automatic browser authorization. + // Applies to this app-server's gateway runtime; later connections cannot undo it. + ExplicitGatewayOauth *bool `json:"explicitGatewayOauth,omitempty,omitzero"` + + // MCP extension settings declared by the app-server client. + Extensions *OpenAIAgentInitializeCapabilitiesExtensions `json:"extensions,omitempty,omitzero"` + + // Legacy opt-in for the `openai/form` MCP extension. + // + // New clients should declare `openai/form` in [`Self::extensions`]. + McpServerOpenaiFormElicitation *bool `json:"mcpServerOpenaiFormElicitation,omitempty,omitzero"` + + // Exact notification method names that should be suppressed for this connection + // (for example `thread/started`). + OptOutNotificationMethods *OpenAIAgentInitializeCapabilitiesOptOutNotificationMethods `json:"optOutNotificationMethods,omitempty,omitzero"` + + // Opt into `attestation/generate` requests for upstream `x-oai-attestation`. + RequestAttestation bool `json:"requestAttestation,omitempty,omitzero"` +} + +// MCP extension settings declared by the app-server client. +type OpenAIAgentInitializeCapabilitiesExtensions map[string]interface{} + +// Exact notification method names that should be suppressed for this connection +// (for example `thread/started`). +type OpenAIAgentInitializeCapabilitiesOptOutNotificationMethods []string + +// Internal Responses API passthrough metadata copied into underlying chat +// messages. +// +// Responses API strongly types this payload. Do not modify it without first +// getting API approval and making the corresponding Responses API change. +type OpenAIAgentInternalChatMessageMetadataPassthrough struct { + // Turn id configuration. See the linked native reference for semantics and + // availability. + TurnId OpenAIAgentInternalChatMessageMetadataPassthroughTurnId `json:"turn_id,omitempty,omitzero"` } -type OpenAIAgentOptionsThreadResumeApprovalsReviewer string +// Turn id configuration. See the linked native reference for semantics and +// availability. +type OpenAIAgentInternalChatMessageMetadataPassthroughTurnId *string + +// Open AIAgent Legacy App Path String configuration. See the linked native +// reference for semantics and availability. +type OpenAIAgentLegacyAppPathString string + +// Open AIAgent Local Shell Action configuration. See the linked native reference +// for semantics and availability. +type OpenAIAgentLocalShellAction = json.RawMessage + +type OpenAIAgentLocalShellStatus string + +const OpenAIAgentLocalShellStatusCompleted OpenAIAgentLocalShellStatus = "completed" +const OpenAIAgentLocalShellStatusInProgress OpenAIAgentLocalShellStatus = "in_progress" +const OpenAIAgentLocalShellStatusIncomplete OpenAIAgentLocalShellStatus = "incomplete" + +// Classifies assistant text as commentary, a partial answer, or a terminal answer. +// +// Providers do not emit this consistently, so callers must treat `None` as "phase +// unknown" and keep compatibility behavior for legacy models. +type OpenAIAgentMessagePhase = json.RawMessage + +type OpenAIAgentModeKind string + +const OpenAIAgentModeKindDefault OpenAIAgentModeKind = "default" +const OpenAIAgentModeKindPlan OpenAIAgentModeKind = "plan" -const OpenAIAgentOptionsThreadResumeApprovalsReviewerAutoReview OpenAIAgentOptionsThreadResumeApprovalsReviewer = "auto_review" -const OpenAIAgentOptionsThreadResumeApprovalsReviewerGuardianSubagent OpenAIAgentOptionsThreadResumeApprovalsReviewer = "guardian_subagent" -const OpenAIAgentOptionsThreadResumeApprovalsReviewerUser OpenAIAgentOptionsThreadResumeApprovalsReviewer = "user" +// Controls the effective multi-agent delegation instructions for a turn. `custom` +// means the configured mode hint defines the policy instead of a built-in policy. +type OpenAIAgentMultiAgentMode = json.RawMessage -type OpenAIAgentOptionsThreadResumeSandbox string +type OpenAIAgentNetworkAccess string -const OpenAIAgentOptionsThreadResumeSandboxDangerFullAccess OpenAIAgentOptionsThreadResumeSandbox = "danger-full-access" -const OpenAIAgentOptionsThreadResumeSandboxReadOnly OpenAIAgentOptionsThreadResumeSandbox = "read-only" -const OpenAIAgentOptionsThreadResumeSandboxWorkspaceWrite OpenAIAgentOptionsThreadResumeSandbox = "workspace-write" +const OpenAIAgentNetworkAccessEnabled OpenAIAgentNetworkAccess = "enabled" +const OpenAIAgentNetworkAccessRestricted OpenAIAgentNetworkAccess = "restricted" -type OpenAIAgentOptionsThreadStartApprovalsReviewer string +// Native Codex app-server initialize, thread, and turn arguments used by Captain's +// OpenAI agent runtime. +type OpenAIAgentOptions struct { + // Parameters sent in the Codex app-server initialize request. + Initialize *OpenAIAgentOptionsInitialize `json:"initialize,omitempty,omitzero"` -const OpenAIAgentOptionsThreadStartApprovalsReviewerAutoReview OpenAIAgentOptionsThreadStartApprovalsReviewer = "auto_review" -const OpenAIAgentOptionsThreadStartApprovalsReviewerGuardianSubagent OpenAIAgentOptionsThreadStartApprovalsReviewer = "guardian_subagent" -const OpenAIAgentOptionsThreadStartApprovalsReviewerUser OpenAIAgentOptionsThreadStartApprovalsReviewer = "user" + // Parameters used to resume an existing Codex app-server thread. + ThreadResume *OpenAIAgentOptionsThreadResume `json:"threadResume,omitempty,omitzero"` -type OpenAIAgentOptionsThreadStartSandbox string + // Parameters used to start a new Codex app-server thread. + ThreadStart *OpenAIAgentOptionsThreadStart `json:"threadStart,omitempty,omitzero"` -const OpenAIAgentOptionsThreadStartSandboxDangerFullAccess OpenAIAgentOptionsThreadStartSandbox = "danger-full-access" -const OpenAIAgentOptionsThreadStartSandboxReadOnly OpenAIAgentOptionsThreadStartSandbox = "read-only" -const OpenAIAgentOptionsThreadStartSandboxWorkspaceWrite OpenAIAgentOptionsThreadStartSandbox = "workspace-write" + // Parameters used to start a turn on an active Codex app-server thread. + TurnStart *OpenAIAgentOptionsTurnStart `json:"turnStart,omitempty,omitzero"` +} -type OpenAIAgentOptionsTurnStartApprovalsReviewer string +// Parameters sent in the Codex app-server initialize request. +type OpenAIAgentOptionsInitialize struct { + // Experimental protocol capabilities supported by the client. + Capabilities *json.RawMessage `json:"capabilities,omitempty,omitzero"` -const OpenAIAgentOptionsTurnStartApprovalsReviewerAutoReview OpenAIAgentOptionsTurnStartApprovalsReviewer = "auto_review" -const OpenAIAgentOptionsTurnStartApprovalsReviewerGuardianSubagent OpenAIAgentOptionsTurnStartApprovalsReviewer = "guardian_subagent" -const OpenAIAgentOptionsTurnStartApprovalsReviewerUser OpenAIAgentOptionsTurnStartApprovalsReviewer = "user" + // Name, title, and version identifying the app-server client. + ClientInfo OpenAIAgentClientInfo `json:"clientInfo"` +} // Parameters used to resume an existing Codex app-server thread. -type ThreadResume struct { +type OpenAIAgentOptionsThreadResume struct { // Approval policy override applied while resuming the thread. ApprovalPolicy *json.RawMessage `json:"approvalPolicy,omitempty,omitzero"` // Reviewer override applied to the resumed thread. - ApprovalsReviewer *OpenAIAgentOptionsThreadResumeApprovalsReviewer `json:"approvalsReviewer,omitempty,omitzero"` + ApprovalsReviewer *json.RawMessage `json:"approvalsReviewer,omitempty,omitzero"` // Replacement base instructions applied to the resumed thread. - BaseInstructions *string `json:"baseInstructions,omitempty,omitzero"` + BaseInstructions OpenAIAgentOptionsThreadResumeBaseInstructions `json:"baseInstructions,omitempty,omitzero"` // Codex configuration overrides reconstructed for the resumed thread. - Config *json.RawMessage `json:"config,omitempty,omitzero"` + Config *OpenAIAgentOptionsThreadResumeConfig `json:"config,omitempty,omitzero"` // Working directory applied when the thread is resumed. - Cwd *string `json:"cwd,omitempty,omitzero"` + Cwd OpenAIAgentOptionsThreadResumeCwd `json:"cwd,omitempty,omitzero"` // Developer instructions attached while resuming a thread. - DeveloperInstructions *string `json:"developerInstructions,omitempty,omitzero"` + DeveloperInstructions OpenAIAgentOptionsThreadResumeDeveloperInstructions `json:"developerInstructions,omitempty,omitzero"` // Turn identifiers omitted when loading the resumed thread. - ExcludeTurns []string `json:"excludeTurns,omitempty,omitzero"` + ExcludeTurns *bool `json:"excludeTurns,omitempty,omitzero"` // Replacement conversation history supplied while resuming. - History *json.RawMessage `json:"history,omitempty,omitzero"` + History *OpenAIAgentOptionsThreadResumeHistory `json:"history,omitempty,omitzero"` // Pagination request controlling the initial resumed-turn page. InitialTurnsPage *json.RawMessage `json:"initialTurnsPage,omitempty,omitzero"` // Model override applied to the resumed thread. - Model *string `json:"model,omitempty,omitzero"` + Model OpenAIAgentOptionsThreadResumeModel `json:"model,omitempty,omitzero"` // Model-provider override applied to the resumed thread. - ModelProvider *string `json:"modelProvider,omitempty,omitzero"` + ModelProvider OpenAIAgentOptionsThreadResumeModelProvider `json:"modelProvider,omitempty,omitzero"` // Filesystem path of the Codex rollout to resume. - Path *string `json:"path,omitempty,omitzero"` + Path OpenAIAgentOptionsThreadResumePath `json:"path,omitempty,omitzero"` // Named Codex permission-profile identifier applied to the resumed thread; it // cannot be combined with sandbox. - Permissions *string `json:"permissions,omitempty,omitzero"` + Permissions OpenAIAgentOptionsThreadResumePermissions `json:"permissions,omitempty,omitzero"` // Response personality override applied to the resumed thread. - Personality *string `json:"personality,omitempty,omitzero"` + Personality *json.RawMessage `json:"personality,omitempty,omitzero"` // Replacement runtime workspace roots for the resumed thread; paths must be // absolute. - RuntimeWorkspaceRoots []string `json:"runtimeWorkspaceRoots,omitempty,omitzero"` + RuntimeWorkspaceRoots *OpenAIAgentOptionsThreadResumeRuntimeWorkspaceRoots `json:"runtimeWorkspaceRoots,omitempty,omitzero"` // Sandbox override applied while resuming the thread. - Sandbox *OpenAIAgentOptionsThreadResumeSandbox `json:"sandbox,omitempty,omitzero"` + Sandbox *json.RawMessage `json:"sandbox,omitempty,omitzero"` // Processing tier override applied to the resumed thread. - ServiceTier *string `json:"serviceTier,omitempty,omitzero"` + ServiceTier OpenAIAgentOptionsThreadResumeServiceTier `json:"serviceTier,omitempty,omitzero"` // Codex thread identifier to resume. - ThreadId *string `json:"threadId,omitempty,omitzero"` + ThreadId string `json:"threadId"` } +// Replacement base instructions applied to the resumed thread. +type OpenAIAgentOptionsThreadResumeBaseInstructions *string + +// Codex configuration overrides reconstructed for the resumed thread. +type OpenAIAgentOptionsThreadResumeConfig map[string]interface{} + +// Working directory applied when the thread is resumed. +type OpenAIAgentOptionsThreadResumeCwd *string + +// Developer instructions attached while resuming a thread. +type OpenAIAgentOptionsThreadResumeDeveloperInstructions *string + +// Replacement conversation history supplied while resuming. +type OpenAIAgentOptionsThreadResumeHistory []OpenAIAgentResponseItem + +// Model override applied to the resumed thread. +type OpenAIAgentOptionsThreadResumeModel *string + +// Model-provider override applied to the resumed thread. +type OpenAIAgentOptionsThreadResumeModelProvider *string + +// Filesystem path of the Codex rollout to resume. +type OpenAIAgentOptionsThreadResumePath *string + +// Named Codex permission-profile identifier applied to the resumed thread; it +// cannot be combined with sandbox. +type OpenAIAgentOptionsThreadResumePermissions *string + +// Replacement runtime workspace roots for the resumed thread; paths must be +// absolute. +type OpenAIAgentOptionsThreadResumeRuntimeWorkspaceRoots []OpenAIAgentAbsolutePathBuf + +// Processing tier override applied to the resumed thread. +type OpenAIAgentOptionsThreadResumeServiceTier *string + // Parameters used to start a new Codex app-server thread. -type ThreadStart struct { +type OpenAIAgentOptionsThreadStart struct { // Whether Codex may fall back to a different provider model. AllowProviderModelFallback *bool `json:"allowProviderModelFallback,omitempty,omitzero"` @@ -127,162 +338,472 @@ type ThreadStart struct { ApprovalPolicy *json.RawMessage `json:"approvalPolicy,omitempty,omitzero"` // Reviewer implementation used to evaluate approval requests. - ApprovalsReviewer *OpenAIAgentOptionsThreadStartApprovalsReviewer `json:"approvalsReviewer,omitempty,omitzero"` + ApprovalsReviewer *json.RawMessage `json:"approvalsReviewer,omitempty,omitzero"` // Replacement base instruction text for the Codex thread. - BaseInstructions *string `json:"baseInstructions,omitempty,omitzero"` + BaseInstructions OpenAIAgentOptionsThreadStartBaseInstructions `json:"baseInstructions,omitempty,omitzero"` // Codex configuration overrides derived from Captain sandbox and caller-tool // settings. - Config *json.RawMessage `json:"config,omitempty,omitzero"` + Config *OpenAIAgentOptionsThreadStartConfig `json:"config,omitempty,omitzero"` // Initial working directory for the Codex thread. - Cwd *string `json:"cwd,omitempty,omitzero"` + Cwd OpenAIAgentOptionsThreadStartCwd `json:"cwd,omitempty,omitzero"` // Initial Daybreak choice for a persistent Codex thread; not supported for // ephemeral threads. - DaybreakEnabled *bool `json:"daybreakEnabled,omitempty,omitzero"` + DaybreakEnabled OpenAIAgentOptionsThreadStartDaybreakEnabled `json:"daybreakEnabled,omitempty,omitzero"` // Developer instruction text attached to the Codex thread. - DeveloperInstructions *string `json:"developerInstructions,omitempty,omitzero"` + DeveloperInstructions OpenAIAgentOptionsThreadStartDeveloperInstructions `json:"developerInstructions,omitempty,omitzero"` // Tool definitions registered dynamically with the Codex thread. - DynamicTools *json.RawMessage `json:"dynamicTools,omitempty,omitzero"` + DynamicTools *OpenAIAgentOptionsThreadStartDynamicTools `json:"dynamicTools,omitempty,omitzero"` // Named execution environments available to the Codex thread. - Environments *json.RawMessage `json:"environments,omitempty,omitzero"` + Environments *OpenAIAgentOptionsThreadStartEnvironments `json:"environments,omitempty,omitzero"` // Whether Codex avoids persisting the thread to disk. - Ephemeral *bool `json:"ephemeral,omitempty,omitzero"` + Ephemeral OpenAIAgentOptionsThreadStartEphemeral `json:"ephemeral,omitempty,omitzero"` // Whether raw protocol events are included in item streams. ExperimentalRawEvents *bool `json:"experimentalRawEvents,omitempty,omitzero"` // Codex policy controlling which history is retained. - HistoryMode *string `json:"historyMode,omitempty,omitzero"` + HistoryMode *json.RawMessage `json:"historyMode,omitempty,omitzero"` // Protocol test field reserved by the experimental app-server schema. - MockExperimentalField *string `json:"mockExperimentalField,omitempty,omitzero"` + MockExperimentalField OpenAIAgentOptionsThreadStartMockExperimentalField `json:"mockExperimentalField,omitempty,omitzero"` // Model identifier used to start the Codex thread. - Model *string `json:"model,omitempty,omitzero"` + Model OpenAIAgentOptionsThreadStartModel `json:"model,omitempty,omitzero"` // Codex model-provider implementation selected for the thread. - ModelProvider *string `json:"modelProvider,omitempty,omitzero"` + ModelProvider OpenAIAgentOptionsThreadStartModelProvider `json:"modelProvider,omitempty,omitzero"` // Codex multi-agent coordination mode for the thread. - MultiAgentMode *string `json:"multiAgentMode,omitempty,omitzero"` + MultiAgentMode *json.RawMessage `json:"multiAgentMode,omitempty,omitzero"` // Named Codex permission-profile identifier for the thread; it cannot be combined // with sandbox. - Permissions *string `json:"permissions,omitempty,omitzero"` + Permissions OpenAIAgentOptionsThreadStartPermissions `json:"permissions,omitempty,omitzero"` // Named Codex response personality for the thread. - Personality *string `json:"personality,omitempty,omitzero"` + Personality *json.RawMessage `json:"personality,omitempty,omitzero"` // Codex project identifier associated with the thread. - ProjectId *string `json:"projectId,omitempty,omitzero"` + ProjectId OpenAIAgentOptionsThreadStartProjectId `json:"projectId,omitempty,omitzero"` // Replacement runtime workspace roots for the Codex thread; paths must be // absolute. - RuntimeWorkspaceRoots []string `json:"runtimeWorkspaceRoots,omitempty,omitzero"` + RuntimeWorkspaceRoots *OpenAIAgentOptionsThreadStartRuntimeWorkspaceRoots `json:"runtimeWorkspaceRoots,omitempty,omitzero"` // Named Codex sandbox mode for the thread. - Sandbox *OpenAIAgentOptionsThreadStartSandbox `json:"sandbox,omitempty,omitzero"` + Sandbox *json.RawMessage `json:"sandbox,omitempty,omitzero"` // Filesystem roots selected for capability discovery. - SelectedCapabilityRoots []string `json:"selectedCapabilityRoots,omitempty,omitzero"` + SelectedCapabilityRoots *OpenAIAgentOptionsThreadStartSelectedCapabilityRoots `json:"selectedCapabilityRoots,omitempty,omitzero"` // Service identity attached to the Codex thread. - ServiceName *string `json:"serviceName,omitempty,omitzero"` + ServiceName OpenAIAgentOptionsThreadStartServiceName `json:"serviceName,omitempty,omitzero"` // Processing tier selected for the Codex thread. - ServiceTier *string `json:"serviceTier,omitempty,omitzero"` + ServiceTier OpenAIAgentOptionsThreadStartServiceTier `json:"serviceTier,omitempty,omitzero"` // Source label describing how the session was launched. - SessionStartSource *string `json:"sessionStartSource,omitempty,omitzero"` + SessionStartSource *json.RawMessage `json:"sessionStartSource,omitempty,omitzero"` // Native source label attached to the Codex thread. - ThreadSource *string `json:"threadSource,omitempty,omitzero"` + ThreadSource *json.RawMessage `json:"threadSource,omitempty,omitzero"` } +// Replacement base instruction text for the Codex thread. +type OpenAIAgentOptionsThreadStartBaseInstructions *string + +// Codex configuration overrides derived from Captain sandbox and caller-tool +// settings. +type OpenAIAgentOptionsThreadStartConfig map[string]interface{} + +// Initial working directory for the Codex thread. +type OpenAIAgentOptionsThreadStartCwd *string + +// Initial Daybreak choice for a persistent Codex thread; not supported for +// ephemeral threads. +type OpenAIAgentOptionsThreadStartDaybreakEnabled *bool + +// Developer instruction text attached to the Codex thread. +type OpenAIAgentOptionsThreadStartDeveloperInstructions *string + +// Tool definitions registered dynamically with the Codex thread. +type OpenAIAgentOptionsThreadStartDynamicTools []OpenAIAgentDynamicToolSpec + +// Named execution environments available to the Codex thread. +type OpenAIAgentOptionsThreadStartEnvironments []OpenAIAgentTurnEnvironmentParams + +// Whether Codex avoids persisting the thread to disk. +type OpenAIAgentOptionsThreadStartEphemeral *bool + +// Protocol test field reserved by the experimental app-server schema. +type OpenAIAgentOptionsThreadStartMockExperimentalField *string + +// Model identifier used to start the Codex thread. +type OpenAIAgentOptionsThreadStartModel *string + +// Codex model-provider implementation selected for the thread. +type OpenAIAgentOptionsThreadStartModelProvider *string + +// Named Codex permission-profile identifier for the thread; it cannot be combined +// with sandbox. +type OpenAIAgentOptionsThreadStartPermissions *string + +// Codex project identifier associated with the thread. +type OpenAIAgentOptionsThreadStartProjectId *string + +// Replacement runtime workspace roots for the Codex thread; paths must be +// absolute. +type OpenAIAgentOptionsThreadStartRuntimeWorkspaceRoots []OpenAIAgentAbsolutePathBuf + +// Filesystem roots selected for capability discovery. +type OpenAIAgentOptionsThreadStartSelectedCapabilityRoots []OpenAIAgentSelectedCapabilityRoot + +// Service identity attached to the Codex thread. +type OpenAIAgentOptionsThreadStartServiceName *string + +// Processing tier selected for the Codex thread. +type OpenAIAgentOptionsThreadStartServiceTier *string + // Parameters used to start a turn on an active Codex app-server thread. -type TurnStart struct { +type OpenAIAgentOptionsTurnStart struct { // Extra context attached to the turn outside the user input list. - AdditionalContext *string `json:"additionalContext,omitempty,omitzero"` + AdditionalContext *OpenAIAgentOptionsTurnStartAdditionalContext `json:"additionalContext,omitempty,omitzero"` // Approval-policy override for the turn. ApprovalPolicy *json.RawMessage `json:"approvalPolicy,omitempty,omitzero"` // Reviewer override used for approvals in this turn. - ApprovalsReviewer *OpenAIAgentOptionsTurnStartApprovalsReviewer `json:"approvalsReviewer,omitempty,omitzero"` + ApprovalsReviewer *json.RawMessage `json:"approvalsReviewer,omitempty,omitzero"` // Client-assigned identifier for the turn's user message. - ClientUserMessageId *string `json:"clientUserMessageId,omitempty,omitzero"` + ClientUserMessageId OpenAIAgentOptionsTurnStartClientUserMessageId `json:"clientUserMessageId,omitempty,omitzero"` // Codex collaboration mode applied for the turn. CollaborationMode *json.RawMessage `json:"collaborationMode,omitempty,omitzero"` // Working-directory override for the turn. - Cwd *string `json:"cwd,omitempty,omitzero"` + Cwd OpenAIAgentOptionsTurnStartCwd `json:"cwd,omitempty,omitzero"` // Codex cyber-access program configuration for the turn. CyberAccessProgram *json.RawMessage `json:"cyberAccessProgram,omitempty,omitzero"` // Replacement list of plugin identifiers disabled for the thread; an empty list // clears it. - DisabledPluginIds []string `json:"disabledPluginIds,omitempty,omitzero"` + DisabledPluginIds *OpenAIAgentOptionsTurnStartDisabledPluginIds `json:"disabledPluginIds,omitempty,omitzero"` // Reasoning effort used for this Codex turn. - Effort *string `json:"effort,omitempty,omitzero"` + Effort *json.RawMessage `json:"effort,omitempty,omitzero"` // Execution environments made available for this turn. - Environments *json.RawMessage `json:"environments,omitempty,omitzero"` + Environments *OpenAIAgentOptionsTurnStartEnvironments `json:"environments,omitempty,omitzero"` // Text and local-image items supplied for the Codex turn. - Input *json.RawMessage `json:"input,omitempty,omitzero"` + Input []OpenAIAgentUserInput `json:"input"` // Model identifier used for this Codex turn. - Model *string `json:"model,omitempty,omitzero"` + Model OpenAIAgentOptionsTurnStartModel `json:"model,omitempty,omitzero"` // Codex multi-agent coordination mode for this turn. - MultiAgentMode *string `json:"multiAgentMode,omitempty,omitzero"` + MultiAgentMode *json.RawMessage `json:"multiAgentMode,omitempty,omitzero"` // JSON Schema constraining the final turn response. - OutputSchema *json.RawMessage `json:"outputSchema,omitempty,omitzero"` + OutputSchema interface{} `json:"outputSchema,omitempty,omitzero"` + + // ID of the turn that caused this new turn to start. + // + // Set this when starting work on behalf of another turn, such as delegated work + // in a different thread. Leave unset for work started directly by the user. + // Ignored when this request adds input to an active turn. + ParentTurnId OpenAIAgentOptionsTurnStartParentTurnId `json:"parentTurnId,omitempty,omitzero"` // Named Codex permission-profile identifier for this turn and subsequent turns; // it cannot be combined with sandboxPolicy. - Permissions *string `json:"permissions,omitempty,omitzero"` + Permissions OpenAIAgentOptionsTurnStartPermissions `json:"permissions,omitempty,omitzero"` // Response personality override for this turn. - Personality *string `json:"personality,omitempty,omitzero"` + Personality *json.RawMessage `json:"personality,omitempty,omitzero"` // Client metadata forwarded to the underlying Responses API call. - ResponsesapiClientMetadata *json.RawMessage `json:"responsesapiClientMetadata,omitempty,omitzero"` + ResponsesapiClientMetadata *OpenAIAgentOptionsTurnStartResponsesapiClientMetadata `json:"responsesapiClientMetadata,omitempty,omitzero"` + + // Merge entries into the ResponsesAPI turn metadata without removing existing + // entries. Applied after `responsesapiClientMetadata` if both are provided; + // reserved keys remain protected. + ResponsesapiClientMetadataPatch *OpenAIAgentOptionsTurnStartResponsesapiClientMetadataPatch `json:"responsesapiClientMetadataPatch,omitempty,omitzero"` + + // ID of the first turn in the chain of work that led to this new turn. + // + // When setting `parentTurnId`, set this to the parent turn's `rootTurnId` when + // known. This keeps descendant work attributed to the original turn. If omitted, + // the new turn becomes its own root. Ignored when this request adds input to an + // active turn. + RootTurnId OpenAIAgentOptionsTurnStartRootTurnId `json:"rootTurnId,omitempty,omitzero"` // Replacement runtime workspace roots for this turn and subsequent turns; paths // must be absolute. - RuntimeWorkspaceRoots []string `json:"runtimeWorkspaceRoots,omitempty,omitzero"` + RuntimeWorkspaceRoots *OpenAIAgentOptionsTurnStartRuntimeWorkspaceRoots `json:"runtimeWorkspaceRoots,omitempty,omitzero"` // Detailed sandbox policy override for this turn. SandboxPolicy *json.RawMessage `json:"sandboxPolicy,omitempty,omitzero"` // Processing tier selected for this turn. - ServiceTier *string `json:"serviceTier,omitempty,omitzero"` + ServiceTier OpenAIAgentOptionsTurnStartServiceTier `json:"serviceTier,omitempty,omitzero"` // Whether a service tier applies only to this turn. - ServiceTierForTurn *bool `json:"serviceTierForTurn,omitempty,omitzero"` + ServiceTierForTurn OpenAIAgentOptionsTurnStartServiceTierForTurn `json:"serviceTierForTurn,omitempty,omitzero"` // Reasoning-summary mode requested for the turn. - Summary *string `json:"summary,omitempty,omitzero"` + Summary *json.RawMessage `json:"summary,omitempty,omitzero"` // Active Codex thread receiving the turn. - ThreadId *string `json:"threadId,omitempty,omitzero"` + ThreadId string `json:"threadId"` // Out-of-band tool output supplied with the turn-start request. ToolOutput *json.RawMessage `json:"toolOutput,omitempty,omitzero"` // Source describing what triggered the Codex turn. - TurnTrigger *string `json:"turnTrigger,omitempty,omitzero"` + TurnTrigger OpenAIAgentOptionsTurnStartTurnTrigger `json:"turnTrigger,omitempty,omitzero"` +} + +// Extra context attached to the turn outside the user input list. +type OpenAIAgentOptionsTurnStartAdditionalContext map[string]OpenAIAgentAdditionalContextEntry + +// Client-assigned identifier for the turn's user message. +type OpenAIAgentOptionsTurnStartClientUserMessageId *string + +// Working-directory override for the turn. +type OpenAIAgentOptionsTurnStartCwd *string + +// Replacement list of plugin identifiers disabled for the thread; an empty list +// clears it. +type OpenAIAgentOptionsTurnStartDisabledPluginIds []string + +// Execution environments made available for this turn. +type OpenAIAgentOptionsTurnStartEnvironments []OpenAIAgentTurnEnvironmentParams + +// Model identifier used for this Codex turn. +type OpenAIAgentOptionsTurnStartModel *string + +// ID of the turn that caused this new turn to start. +// +// Set this when starting work on behalf of another turn, such as delegated work in +// a different thread. Leave unset for work started directly by the user. Ignored +// when this request adds input to an active turn. +type OpenAIAgentOptionsTurnStartParentTurnId *string + +// Named Codex permission-profile identifier for this turn and subsequent turns; it +// cannot be combined with sandboxPolicy. +type OpenAIAgentOptionsTurnStartPermissions *string + +// Client metadata forwarded to the underlying Responses API call. +type OpenAIAgentOptionsTurnStartResponsesapiClientMetadata map[string]string + +// Merge entries into the ResponsesAPI turn metadata without removing existing +// entries. Applied after `responsesapiClientMetadata` if both are provided; +// reserved keys remain protected. +type OpenAIAgentOptionsTurnStartResponsesapiClientMetadataPatch map[string]string + +// ID of the first turn in the chain of work that led to this new turn. +// +// When setting `parentTurnId`, set this to the parent turn's `rootTurnId` when +// known. This keeps descendant work attributed to the original turn. If omitted, +// the new turn becomes its own root. Ignored when this request adds input to an +// active turn. +type OpenAIAgentOptionsTurnStartRootTurnId *string + +// Replacement runtime workspace roots for this turn and subsequent turns; paths +// must be absolute. +type OpenAIAgentOptionsTurnStartRuntimeWorkspaceRoots []OpenAIAgentAbsolutePathBuf + +// Processing tier selected for this turn. +type OpenAIAgentOptionsTurnStartServiceTier *string + +// Whether a service tier applies only to this turn. +type OpenAIAgentOptionsTurnStartServiceTierForTurn *string + +// Source describing what triggered the Codex turn. +type OpenAIAgentOptionsTurnStartTurnTrigger *string + +type OpenAIAgentPersonality string + +const OpenAIAgentPersonalityFriendly OpenAIAgentPersonality = "friendly" +const OpenAIAgentPersonalityNone OpenAIAgentPersonality = "none" +const OpenAIAgentPersonalityPragmatic OpenAIAgentPersonality = "pragmatic" + +// A non-empty reasoning effort value advertised by the model. +type OpenAIAgentReasoningEffort string + +// Open AIAgent Reasoning Item Content configuration. See the linked native +// reference for semantics and availability. +type OpenAIAgentReasoningItemContent = json.RawMessage + +// Open AIAgent Reasoning Item Reasoning Summary configuration. See the linked +// native reference for semantics and availability. +type OpenAIAgentReasoningItemReasoningSummary = json.RawMessage + +// A summary of the reasoning performed by the model. This can be useful for +// debugging and understanding the model's reasoning process. See +// https://platform.openai.com/docs/guides/reasoning?api-mode=responses#reasoning-summaries +type OpenAIAgentReasoningSummary = json.RawMessage + +// Open AIAgent Response Item configuration. See the linked native reference for +// semantics and availability. +type OpenAIAgentResponseItem = json.RawMessage + +// Open AIAgent Responses API Web Search Action configuration. See the linked +// native reference for semantics and availability. +type OpenAIAgentResponsesApiWebSearchAction = json.RawMessage + +type OpenAIAgentSandboxMode string + +const OpenAIAgentSandboxModeDangerFullAccess OpenAIAgentSandboxMode = "danger-full-access" +const OpenAIAgentSandboxModeReadOnly OpenAIAgentSandboxMode = "read-only" +const OpenAIAgentSandboxModeWorkspaceWrite OpenAIAgentSandboxMode = "workspace-write" + +// Open AIAgent Sandbox Policy configuration. See the linked native reference for +// semantics and availability. +type OpenAIAgentSandboxPolicy = json.RawMessage + +// A user-selected root that can expose one or more runtime capabilities. +type OpenAIAgentSelectedCapabilityRoot struct { + // Stable identifier supplied by the capability selection platform. + Id string `json:"id"` + + // Where the selected root can be resolved. + Location json.RawMessage `json:"location"` +} + +// Settings for a collaboration mode. +type OpenAIAgentSettings struct { + // Developer instructions configuration. See the linked native reference for + // semantics and availability. + DeveloperInstructions OpenAIAgentSettingsDeveloperInstructions `json:"developer_instructions,omitempty,omitzero"` + + // Model configuration. See the linked native reference for semantics and + // availability. + Model string `json:"model"` + + // Reasoning effort configuration. See the linked native reference for semantics + // and availability. + ReasoningEffort *json.RawMessage `json:"reasoning_effort,omitempty,omitzero"` +} + +// Developer instructions configuration. See the linked native reference for +// semantics and availability. +type OpenAIAgentSettingsDeveloperInstructions *string + +type OpenAIAgentSortDirection string + +const OpenAIAgentSortDirectionAsc OpenAIAgentSortDirection = "asc" +const OpenAIAgentSortDirectionDesc OpenAIAgentSortDirection = "desc" + +// Open AIAgent Text Element configuration. See the linked native reference for +// semantics and availability. +type OpenAIAgentTextElement struct { + // Byte range in the parent `text` buffer that this element occupies. + ByteRange OpenAIAgentTextElementByteRange `json:"byteRange"` + + // Optional human-readable placeholder for the element, displayed in the UI. + Placeholder OpenAIAgentTextElementPlaceholder `json:"placeholder,omitempty,omitzero"` +} + +// Byte range in the parent `text` buffer that this element occupies. +type OpenAIAgentTextElementByteRange struct { + // End configuration. See the linked native reference for semantics and + // availability. + End int `json:"end"` + + // Start configuration. See the linked native reference for semantics and + // availability. + Start int `json:"start"` +} + +// Optional human-readable placeholder for the element, displayed in the UI. +type OpenAIAgentTextElementPlaceholder *string + +type OpenAIAgentThreadHistoryMode string + +const OpenAIAgentThreadHistoryModeLegacy OpenAIAgentThreadHistoryMode = "legacy" +const OpenAIAgentThreadHistoryModePaginated OpenAIAgentThreadHistoryMode = "paginated" + +// Open AIAgent Thread Resume Initial Turns Page Params configuration. See the +// linked native reference for semantics and availability. +type OpenAIAgentThreadResumeInitialTurnsPageParams struct { + // How much item detail to include for each returned turn; defaults to summary. + ItemsView *json.RawMessage `json:"itemsView,omitempty,omitzero"` + + // Optional turn page size. + Limit OpenAIAgentThreadResumeInitialTurnsPageParamsLimit `json:"limit,omitempty,omitzero"` + + // Optional turn pagination direction; defaults to descending. + SortDirection *json.RawMessage `json:"sortDirection,omitempty,omitzero"` +} + +// Optional turn page size. +type OpenAIAgentThreadResumeInitialTurnsPageParamsLimit *int + +// Open AIAgent Thread Source configuration. See the linked native reference for +// semantics and availability. +type OpenAIAgentThreadSource string + +type OpenAIAgentThreadStartSource string + +const OpenAIAgentThreadStartSourceClear OpenAIAgentThreadStartSource = "clear" +const OpenAIAgentThreadStartSourceStartup OpenAIAgentThreadStartSource = "startup" + +// Open AIAgent Turn Environment Params configuration. See the linked native +// reference for semantics and availability. +type OpenAIAgentTurnEnvironmentParams struct { + // Cwd configuration. See the linked native reference for semantics and + // availability. + Cwd OpenAIAgentLegacyAppPathString `json:"cwd"` + + // Environment Id configuration. See the linked native reference for semantics and + // availability. + EnvironmentId string `json:"environmentId"` + + // Environment-native runtime workspace roots. Omitted defaults to `cwd`. + RuntimeWorkspaceRoots *OpenAIAgentTurnEnvironmentParamsRuntimeWorkspaceRoots `json:"runtimeWorkspaceRoots,omitempty,omitzero"` +} + +// Environment-native runtime workspace roots. Omitted defaults to `cwd`. +type OpenAIAgentTurnEnvironmentParamsRuntimeWorkspaceRoots []OpenAIAgentLegacyAppPathString + +// Open AIAgent Turn Items View configuration. See the linked native reference for +// semantics and availability. +type OpenAIAgentTurnItemsView = json.RawMessage + +// Open AIAgent Turn Tool Output configuration. See the linked native reference for +// semantics and availability. +type OpenAIAgentTurnToolOutput struct { + // Name configuration. See the linked native reference for semantics and + // availability. + Name string `json:"name"` + + // Namespace configuration. See the linked native reference for semantics and + // availability. + Namespace OpenAIAgentTurnToolOutputNamespace `json:"namespace,omitempty,omitzero"` + + // Output configuration. See the linked native reference for semantics and + // availability. + Output OpenAIAgentFunctionCallOutputBody `json:"output"` + + // Requests retention of this output in the thread's model history. + Retain *bool `json:"retain,omitempty,omitzero"` } + +// Namespace configuration. See the linked native reference for semantics and +// availability. +type OpenAIAgentTurnToolOutputNamespace *string + +// Open AIAgent User Input configuration. See the linked native reference for +// semantics and availability. +type OpenAIAgentUserInput = json.RawMessage diff --git a/pkg/adapters/zz_generated_openai_api.go b/pkg/adapters/zz_generated_openai_api.go index aea3d39b..6392fe75 100644 --- a/pkg/adapters/zz_generated_openai_api.go +++ b/pkg/adapters/zz_generated_openai_api.go @@ -4,19 +4,16 @@ package adapters import "encoding/json" -// Up to sixteen string key-value pairs attached to the response. -type Metadata map[string]string - // Native OpenAI Responses API request options used by Captain's API runtime. type OpenAIAPIOptions struct { // Whether OpenAI runs the response asynchronously in the background. Background *bool `json:"background,omitempty,omitzero"` // Additional response fields requested from the Responses API. - Include []string `json:"include,omitempty,omitzero"` + Include []OpenAIAPIOptionsIncludeElem `json:"include,omitempty,omitzero"` // Text, image, file, conversation, and function-result items sent to the model. - Input json.RawMessage `json:"input"` + Input OpenaiAPIResponseNewParamsInputUnion `json:"input"` // System or developer instructions inserted into the model context. Instructions *string `json:"instructions,omitempty,omitzero"` @@ -28,7 +25,7 @@ type OpenAIAPIOptions struct { MaxToolCalls *int `json:"max_tool_calls,omitempty,omitzero"` // Up to sixteen string key-value pairs attached to the response. - Metadata Metadata `json:"metadata,omitempty,omitzero"` + Metadata OpenAIAPIOptionsMetadata `json:"metadata,omitempty,omitzero"` // OpenAI model identifier used to generate the response. Model string `json:"model"` @@ -40,13 +37,13 @@ type OpenAIAPIOptions struct { PreviousResponseId *string `json:"previous_response_id,omitempty,omitzero"` // Reusable OpenAI prompt template reference and variables. - Prompt *json.RawMessage `json:"prompt,omitempty,omitzero"` + Prompt *OpenaiAPIResponsePromptParam `json:"prompt,omitempty,omitzero"` // Stable key used by OpenAI to improve prompt-cache routing. PromptCacheKey *string `json:"prompt_cache_key,omitempty,omitzero"` // Reasoning effort and summary configuration for reasoning models. - Reasoning *json.RawMessage `json:"reasoning,omitempty,omitzero"` + Reasoning *OpenaiAPIReasoningParam `json:"reasoning,omitempty,omitzero"` // Stable hashed identifier used for abuse detection. SafetyIdentifier *string `json:"safety_identifier,omitempty,omitzero"` @@ -64,13 +61,13 @@ type OpenAIAPIOptions struct { Temperature *float64 `json:"temperature,omitempty,omitzero"` // Plain-text or JSON Schema output configuration. - Text *json.RawMessage `json:"text,omitempty,omitzero"` + Text *OpenaiAPIResponseTextConfigParam `json:"text,omitempty,omitzero"` // Policy selecting whether and which tool the model should call. - ToolChoice *json.RawMessage `json:"tool_choice,omitempty,omitzero"` + ToolChoice *OpenaiAPIResponseNewParamsToolChoiceUnion `json:"tool_choice,omitempty,omitzero"` // Native Responses API tool definitions derived from Captain caller tools. - Tools *json.RawMessage `json:"tools,omitempty,omitzero"` + Tools []OpenaiAPIToolUnionParam `json:"tools,omitempty,omitzero"` // Number of likely tokens returned with log probabilities at each position. TopLogprobs *int `json:"top_logprobs,omitempty,omitzero"` @@ -86,6 +83,18 @@ type OpenAIAPIOptions struct { User *string `json:"user,omitempty,omitzero"` } +type OpenAIAPIOptionsIncludeElem string + +const OpenAIAPIOptionsIncludeElemCodeInterpreterCallOutputs OpenAIAPIOptionsIncludeElem = "code_interpreter_call.outputs" +const OpenAIAPIOptionsIncludeElemComputerCallOutputOutputImageUrl OpenAIAPIOptionsIncludeElem = "computer_call_output.output.image_url" +const OpenAIAPIOptionsIncludeElemFileSearchCallResults OpenAIAPIOptionsIncludeElem = "file_search_call.results" +const OpenAIAPIOptionsIncludeElemMessageInputImageImageUrl OpenAIAPIOptionsIncludeElem = "message.input_image.image_url" +const OpenAIAPIOptionsIncludeElemMessageOutputTextLogprobs OpenAIAPIOptionsIncludeElem = "message.output_text.logprobs" +const OpenAIAPIOptionsIncludeElemReasoningEncryptedContent OpenAIAPIOptionsIncludeElem = "reasoning.encrypted_content" + +// Up to sixteen string key-value pairs attached to the response. +type OpenAIAPIOptionsMetadata map[string]string + type OpenAIAPIOptionsServiceTier string const OpenAIAPIOptionsServiceTierAuto OpenAIAPIOptionsServiceTier = "auto" @@ -98,3 +107,2084 @@ type OpenAIAPIOptionsTruncation string const OpenAIAPIOptionsTruncationAuto OpenAIAPIOptionsTruncation = "auto" const OpenAIAPIOptionsTruncationDisabled OpenAIAPIOptionsTruncation = "disabled" + +// A filter used to compare a specified attribute key to a given value using a +// defined comparison operation. +// +// The properties Key, Type, Value are required. +type OpenaiAPIComparisonFilterParam struct { + // The key to compare against the value. + // + Key string `json:"key"` + + // Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`. + // + // - `eq`: equals + // - `ne`: not equal + // - `gt`: greater than + // - `gte`: greater than or equal + // - `lt`: less than + // - `lte`: less than or equal + // + // Any of "eq", "ne", "gt", "gte", "lt", "lte". + // + Type OpenaiAPIComparisonFilterParamType `json:"type"` + + // The value to compare against the attribute key; supports string, number, or + // boolean types. + // + Value OpenaiAPIComparisonFilterValueUnionParam `json:"value"` +} + +type OpenaiAPIComparisonFilterParamType string + +const OpenaiAPIComparisonFilterParamTypeEq OpenaiAPIComparisonFilterParamType = "eq" +const OpenaiAPIComparisonFilterParamTypeGt OpenaiAPIComparisonFilterParamType = "gt" +const OpenaiAPIComparisonFilterParamTypeGte OpenaiAPIComparisonFilterParamType = "gte" +const OpenaiAPIComparisonFilterParamTypeLt OpenaiAPIComparisonFilterParamType = "lt" +const OpenaiAPIComparisonFilterParamTypeLte OpenaiAPIComparisonFilterParamType = "lte" +const OpenaiAPIComparisonFilterParamTypeNe OpenaiAPIComparisonFilterParamType = "ne" + +// OpenAI APIComparison Filter Value Union Param configuration. See the linked +// native reference for semantics and availability. +type OpenaiAPIComparisonFilterValueUnionParam = json.RawMessage + +// Combine multiple filters using `and` or `or`. +// +// The properties Filters, Type are required. +type OpenaiAPICompoundFilterParam struct { + // Array of filters to combine. Items can be `ComparisonFilter` or + // `CompoundFilter`. + // + Filters []OpenaiAPIComparisonFilterParam `json:"filters"` + + // Type of operation: `and` or `or`. + // + // Any of "and", "or". + // + Type OpenaiAPICompoundFilterParamType `json:"type"` +} + +type OpenaiAPICompoundFilterParamType string + +const OpenaiAPICompoundFilterParamTypeAnd OpenaiAPICompoundFilterParamType = "and" +const OpenaiAPICompoundFilterParamTypeOr OpenaiAPICompoundFilterParamType = "or" + +// A tool that controls a virtual computer. Learn more about the +// [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). +// +// The properties DisplayHeight, DisplayWidth, Environment, Type are required. +type OpenaiAPIComputerToolParam struct { + // The height of the computer display. + // + DisplayHeight int `json:"display_height"` + + // The width of the computer display. + // + DisplayWidth int `json:"display_width"` + + // The type of computer environment to control. + // + // Any of "windows", "mac", "linux", "ubuntu", "browser". + // + Environment OpenaiAPIComputerToolParamEnvironment `json:"environment"` + + // The type of the computer use tool. Always `computer_use_preview`. + // + // This field can be elided, and will marshal its zero value as + // "computer_use_preview". + // + Type interface{} `json:"type"` +} + +type OpenaiAPIComputerToolParamEnvironment string + +const OpenaiAPIComputerToolParamEnvironmentBrowser OpenaiAPIComputerToolParamEnvironment = "browser" +const OpenaiAPIComputerToolParamEnvironmentLinux OpenaiAPIComputerToolParamEnvironment = "linux" +const OpenaiAPIComputerToolParamEnvironmentMac OpenaiAPIComputerToolParamEnvironment = "mac" +const OpenaiAPIComputerToolParamEnvironmentUbuntu OpenaiAPIComputerToolParamEnvironment = "ubuntu" +const OpenaiAPIComputerToolParamEnvironmentWindows OpenaiAPIComputerToolParamEnvironment = "windows" + +// OpenAI APIEasy Input Message Content Union Param configuration. See the linked +// native reference for semantics and availability. +type OpenaiAPIEasyInputMessageContentUnionParam = json.RawMessage + +// A message input to the model with a role indicating instruction following +// hierarchy. Instructions given with the `developer` or `system` role take +// precedence over instructions given with the `user` role. Messages with the +// `assistant` role are presumed to have been generated by the model in previous +// interactions. +// +// The properties Content, Role are required. +type OpenaiAPIEasyInputMessageParam struct { + // Text, image, or audio input to the model, used to generate a response. Can also + // contain previous assistant responses. + // + Content OpenaiAPIEasyInputMessageContentUnionParam `json:"content"` + + // The role of the message input. One of `user`, `assistant`, `system`, or + // `developer`. + // + // Any of "user", "assistant", "system", "developer". + // + Role OpenaiAPIEasyInputMessageParamRole `json:"role"` + + // The type of the message input. Always `message`. + // + // Any of "message". + // + Type *OpenaiAPIEasyInputMessageParamType `json:"type,omitempty,omitzero"` +} + +type OpenaiAPIEasyInputMessageParamRole string + +const OpenaiAPIEasyInputMessageParamRoleAssistant OpenaiAPIEasyInputMessageParamRole = "assistant" +const OpenaiAPIEasyInputMessageParamRoleDeveloper OpenaiAPIEasyInputMessageParamRole = "developer" +const OpenaiAPIEasyInputMessageParamRoleSystem OpenaiAPIEasyInputMessageParamRole = "system" +const OpenaiAPIEasyInputMessageParamRoleUser OpenaiAPIEasyInputMessageParamRole = "user" + +type OpenaiAPIEasyInputMessageParamType string + +const OpenaiAPIEasyInputMessageParamTypeMessage OpenaiAPIEasyInputMessageParamType = "message" + +// OpenAI APIFile Search Tool Filters Union Param configuration. See the linked +// native reference for semantics and availability. +type OpenaiAPIFileSearchToolFiltersUnionParam = json.RawMessage + +// A tool that searches for relevant content from uploaded files. Learn more about +// the +// [file search tool](https://platform.openai.com/docs/guides/tools-file-search). +// +// The properties Type, VectorStoreIDs are required. +type OpenaiAPIFileSearchToolParam struct { + // A filter to apply. + // + Filters *OpenaiAPIFileSearchToolFiltersUnionParam `json:"filters,omitempty,omitzero"` + + // The maximum number of results to return. This number should be between 1 and 50 + // inclusive. + // + MaxNumResults *int `json:"max_num_results,omitempty,omitzero"` + + // Ranking options for search. + // + RankingOptions *OpenaiAPIFileSearchToolRankingOptionsParam `json:"ranking_options,omitempty,omitzero"` + + // The type of the file search tool. Always `file_search`. + // + // This field can be elided, and will marshal its zero value as "file_search". + // + Type interface{} `json:"type"` + + // The IDs of the vector stores to search. + // + VectorStoreIds []string `json:"vector_store_ids"` +} + +// Ranking options for search. +type OpenaiAPIFileSearchToolRankingOptionsParam struct { + // The ranker to use for the file search. + // + // Any of "auto", "default-2024-11-15". + // + Ranker *string `json:"ranker,omitempty,omitzero"` + + // The score threshold for the file search, a number between 0 and 1. Numbers + // closer to 1 will attempt to return only the most relevant results, but may + // return fewer results. + // + ScoreThreshold *float64 `json:"score_threshold,omitempty,omitzero"` +} + +// Defines a function in your own code the model can choose to call. Learn more +// about +// [function calling](https://platform.openai.com/docs/guides/function-calling). +// +// The properties Name, Parameters, Strict, Type are required. +type OpenaiAPIFunctionToolParam struct { + // A description of the function. Used by the model to determine whether or not to + // call the function. + // + Description *string `json:"description,omitempty,omitzero"` + + // The name of the function to call. + // + Name string `json:"name"` + + // A JSON schema object describing the parameters of the function. + // + Parameters OpenaiAPIFunctionToolParamParameters `json:"parameters"` + + // Whether to enforce strict parameter validation. Default `true`. + // + Strict bool `json:"strict"` + + // The type of the function tool. Always `function`. + // + // This field can be elided, and will marshal its zero value as "function". + // + Type interface{} `json:"type"` +} + +// A JSON schema object describing the parameters of the function. +type OpenaiAPIFunctionToolParamParameters map[string]interface{} + +// **o-series models only** +// +// Configuration options for +// [reasoning models](https://platform.openai.com/docs/guides/reasoning). +type OpenaiAPIReasoningParam struct { + // **o-series models only** + // + // Constrains effort on reasoning for + // [reasoning models](https://platform.openai.com/docs/guides/reasoning). + // Currently + // supported values are `low`, `medium`, and `high`. Reducing reasoning effort can + // result in faster responses and fewer tokens used on reasoning in a response. + // + // Any of "low", "medium", "high". + // + Effort *OpenaiAPIReasoningParamEffort `json:"effort,omitempty,omitzero"` + + // **Deprecated:** use `summary` instead. + // + // A summary of the reasoning performed by the model. This can be useful for + // debugging and understanding the model's reasoning process. One of `auto`, + // `concise`, or `detailed`. + // + // Any of "auto", "concise", "detailed". + // + // Deprecated: deprecated + // + GenerateSummary *OpenaiAPIReasoningParamGenerateSummary `json:"generate_summary,omitempty,omitzero"` + + // A summary of the reasoning performed by the model. This can be useful for + // debugging and understanding the model's reasoning process. One of `auto`, + // `concise`, or `detailed`. + // + // Any of "auto", "concise", "detailed". + // + Summary *OpenaiAPIReasoningParamSummary `json:"summary,omitempty,omitzero"` +} + +type OpenaiAPIReasoningParamEffort string + +const OpenaiAPIReasoningParamEffortHigh OpenaiAPIReasoningParamEffort = "high" +const OpenaiAPIReasoningParamEffortLow OpenaiAPIReasoningParamEffort = "low" +const OpenaiAPIReasoningParamEffortMedium OpenaiAPIReasoningParamEffort = "medium" + +type OpenaiAPIReasoningParamGenerateSummary string + +const OpenaiAPIReasoningParamGenerateSummaryAuto OpenaiAPIReasoningParamGenerateSummary = "auto" +const OpenaiAPIReasoningParamGenerateSummaryConcise OpenaiAPIReasoningParamGenerateSummary = "concise" +const OpenaiAPIReasoningParamGenerateSummaryDetailed OpenaiAPIReasoningParamGenerateSummary = "detailed" + +type OpenaiAPIReasoningParamSummary string + +const OpenaiAPIReasoningParamSummaryAuto OpenaiAPIReasoningParamSummary = "auto" +const OpenaiAPIReasoningParamSummaryConcise OpenaiAPIReasoningParamSummary = "concise" +const OpenaiAPIReasoningParamSummaryDetailed OpenaiAPIReasoningParamSummary = "detailed" + +// The image output from the code interpreter. +// +// The properties Type, URL are required. +type OpenaiAPIResponseCodeInterpreterToolCallOutputImageParam struct { + // The type of the output. Always 'image'. + // + // This field can be elided, and will marshal its zero value as "image". + // + Type interface{} `json:"type"` + + // The URL of the image output from the code interpreter. + // + Url string `json:"url"` +} + +// The logs output from the code interpreter. +// +// The properties Logs, Type are required. +type OpenaiAPIResponseCodeInterpreterToolCallOutputLogsParam struct { + // The logs output from the code interpreter. + // + Logs string `json:"logs"` + + // The type of the output. Always 'logs'. + // + // This field can be elided, and will marshal its zero value as "logs". + // + Type interface{} `json:"type"` +} + +// OpenAI APIResponse Code Interpreter Tool Call Output Union Param configuration. +// See the linked native reference for semantics and availability. +type OpenaiAPIResponseCodeInterpreterToolCallOutputUnionParam = json.RawMessage + +// A tool call to run code. +// +// The properties ID, Code, ContainerID, Outputs, Status, Type are required. +type OpenaiAPIResponseCodeInterpreterToolCallParam struct { + // The code to run, or null if not available. + // + Code string `json:"code"` + + // The ID of the container used to run the code. + // + ContainerId string `json:"container_id"` + + // The unique ID of the code interpreter tool call. + // + Id string `json:"id"` + + // The outputs generated by the code interpreter, such as logs or images. Can be + // null if no outputs are available. + // + Outputs []OpenaiAPIResponseCodeInterpreterToolCallOutputUnionParam `json:"outputs"` + + // The status of the code interpreter tool call. Valid values are `in_progress`, + // `completed`, `incomplete`, `interpreting`, and `failed`. + // + // Any of "in_progress", "completed", "incomplete", "interpreting", "failed". + // + Status OpenaiAPIResponseCodeInterpreterToolCallParamStatus `json:"status"` + + // The type of the code interpreter tool call. Always `code_interpreter_call`. + // + // This field can be elided, and will marshal its zero value as + // "code_interpreter_call". + // + Type interface{} `json:"type"` +} + +type OpenaiAPIResponseCodeInterpreterToolCallParamStatus string + +const OpenaiAPIResponseCodeInterpreterToolCallParamStatusCompleted OpenaiAPIResponseCodeInterpreterToolCallParamStatus = "completed" +const OpenaiAPIResponseCodeInterpreterToolCallParamStatusFailed OpenaiAPIResponseCodeInterpreterToolCallParamStatus = "failed" +const OpenaiAPIResponseCodeInterpreterToolCallParamStatusInProgress OpenaiAPIResponseCodeInterpreterToolCallParamStatus = "in_progress" +const OpenaiAPIResponseCodeInterpreterToolCallParamStatusIncomplete OpenaiAPIResponseCodeInterpreterToolCallParamStatus = "incomplete" +const OpenaiAPIResponseCodeInterpreterToolCallParamStatusInterpreting OpenaiAPIResponseCodeInterpreterToolCallParamStatus = "interpreting" + +// A click action. +// +// The properties Button, Type, X, Y are required. +type OpenaiAPIResponseComputerToolCallActionClickParam struct { + // Indicates which mouse button was pressed during the click. One of `left`, + // `right`, `wheel`, `back`, or `forward`. + // + // Any of "left", "right", "wheel", "back", "forward". + // + Button string `json:"button"` + + // Specifies the event type. For a click action, this property is always set to + // `click`. + // + // This field can be elided, and will marshal its zero value as "click". + // + Type interface{} `json:"type"` + + // The x-coordinate where the click occurred. + // + X int `json:"x"` + + // The y-coordinate where the click occurred. + // + Y int `json:"y"` +} + +// A double click action. +// +// The properties Type, X, Y are required. +type OpenaiAPIResponseComputerToolCallActionDoubleClickParam struct { + // Specifies the event type. For a double click action, this property is always + // set + // to `double_click`. + // + // This field can be elided, and will marshal its zero value as "double_click". + // + Type interface{} `json:"type"` + + // The x-coordinate where the double click occurred. + // + X int `json:"x"` + + // The y-coordinate where the double click occurred. + // + Y int `json:"y"` +} + +// A drag action. +// +// The properties Path, Type are required. +type OpenaiAPIResponseComputerToolCallActionDragParam struct { + // An array of coordinates representing the path of the drag action. Coordinates + // will appear as an array of objects, eg + // + // ``` + // [ + // + // { x: 100, y: 200 }, + // { x: 200, y: 300 } + // + // ] + // ``` + // + Path []OpenaiAPIResponseComputerToolCallActionDragPathParam `json:"path"` + + // Specifies the event type. For a drag action, this property is always set to + // `drag`. + // + // This field can be elided, and will marshal its zero value as "drag". + // + Type interface{} `json:"type"` +} + +// A series of x/y coordinate pairs in the drag path. +// +// The properties X, Y are required. +type OpenaiAPIResponseComputerToolCallActionDragPathParam struct { + // The x-coordinate. + // + X int `json:"x"` + + // The y-coordinate. + // + Y int `json:"y"` +} + +// A collection of keypresses the model would like to perform. +// +// The properties Keys, Type are required. +type OpenaiAPIResponseComputerToolCallActionKeypressParam struct { + // The combination of keys the model is requesting to be pressed. This is an array + // of strings, each representing a key. + // + Keys []string `json:"keys"` + + // Specifies the event type. For a keypress action, this property is always set to + // `keypress`. + // + // This field can be elided, and will marshal its zero value as "keypress". + // + Type interface{} `json:"type"` +} + +// A mouse move action. +// +// The properties Type, X, Y are required. +type OpenaiAPIResponseComputerToolCallActionMoveParam struct { + // Specifies the event type. For a move action, this property is always set to + // `move`. + // + // This field can be elided, and will marshal its zero value as "move". + // + Type interface{} `json:"type"` + + // The x-coordinate to move to. + // + X int `json:"x"` + + // The y-coordinate to move to. + // + Y int `json:"y"` +} + +// A screenshot action. +// +// This struct has a constant value, construct it with +// [NewResponseComputerToolCallActionScreenshotParam]. +type OpenaiAPIResponseComputerToolCallActionScreenshotParam struct { + // Specifies the event type. For a screenshot action, this property is always set + // to `screenshot`. + // + Type interface{} `json:"type"` +} + +// A scroll action. +// +// The properties ScrollX, ScrollY, Type, X, Y are required. +type OpenaiAPIResponseComputerToolCallActionScrollParam struct { + // The horizontal scroll distance. + // + ScrollX int `json:"scroll_x"` + + // The vertical scroll distance. + // + ScrollY int `json:"scroll_y"` + + // Specifies the event type. For a scroll action, this property is always set to + // `scroll`. + // + // This field can be elided, and will marshal its zero value as "scroll". + // + Type interface{} `json:"type"` + + // The x-coordinate where the scroll occurred. + // + X int `json:"x"` + + // The y-coordinate where the scroll occurred. + // + Y int `json:"y"` +} + +// An action to type in text. +// +// The properties Text, Type are required. +type OpenaiAPIResponseComputerToolCallActionTypeParam struct { + // The text to type. + // + Text string `json:"text"` + + // Specifies the event type. For a type action, this property is always set to + // `type`. + // + // This field can be elided, and will marshal its zero value as "type". + // + Type interface{} `json:"type"` +} + +// OpenAI APIResponse Computer Tool Call Action Union Param configuration. See the +// linked native reference for semantics and availability. +type OpenaiAPIResponseComputerToolCallActionUnionParam = json.RawMessage + +// A wait action. +// +// This struct has a constant value, construct it with +// [NewResponseComputerToolCallActionWaitParam]. +type OpenaiAPIResponseComputerToolCallActionWaitParam struct { + // Specifies the event type. For a wait action, this property is always set to + // `wait`. + // + Type interface{} `json:"type"` +} + +// A computer screenshot image used with the computer use tool. +// +// The property Type is required. +type OpenaiAPIResponseComputerToolCallOutputScreenshotParam struct { + // The identifier of an uploaded file that contains the screenshot. + // + FileId *string `json:"file_id,omitempty,omitzero"` + + // The URL of the screenshot image. + // + ImageUrl *string `json:"image_url,omitempty,omitzero"` + + // Specifies the event type. For a computer screenshot, this property is always + // set + // to `computer_screenshot`. + // + // This field can be elided, and will marshal its zero value as + // "computer_screenshot". + // + Type interface{} `json:"type"` +} + +// A tool call to a computer use tool. See the +// [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) +// for more information. +// +// The properties ID, Action, CallID, PendingSafetyChecks, Status, Type are +// required. +type OpenaiAPIResponseComputerToolCallParam struct { + // A click action. + // + Action OpenaiAPIResponseComputerToolCallActionUnionParam `json:"action"` + + // An identifier used when responding to the tool call with output. + // + CallId string `json:"call_id"` + + // The unique ID of the computer call. + // + Id string `json:"id"` + + // The pending safety checks for the computer call. + // + PendingSafetyChecks []OpenaiAPIResponseComputerToolCallPendingSafetyCheckParam `json:"pending_safety_checks"` + + // The status of the item. One of `in_progress`, `completed`, or `incomplete`. + // Populated when items are returned via API. + // + // Any of "in_progress", "completed", "incomplete". + // + Status OpenaiAPIResponseComputerToolCallParamStatus `json:"status"` + + // The type of the computer call. Always `computer_call`. + // + // Any of "computer_call". + // + Type OpenaiAPIResponseComputerToolCallParamType `json:"type"` +} + +type OpenaiAPIResponseComputerToolCallParamStatus string + +const OpenaiAPIResponseComputerToolCallParamStatusCompleted OpenaiAPIResponseComputerToolCallParamStatus = "completed" +const OpenaiAPIResponseComputerToolCallParamStatusInProgress OpenaiAPIResponseComputerToolCallParamStatus = "in_progress" +const OpenaiAPIResponseComputerToolCallParamStatusIncomplete OpenaiAPIResponseComputerToolCallParamStatus = "incomplete" + +type OpenaiAPIResponseComputerToolCallParamType string + +const OpenaiAPIResponseComputerToolCallParamTypeComputerCall OpenaiAPIResponseComputerToolCallParamType = "computer_call" + +// A pending safety check for the computer call. +// +// The properties ID, Code, Message are required. +type OpenaiAPIResponseComputerToolCallPendingSafetyCheckParam struct { + // The type of the pending safety check. + // + Code string `json:"code"` + + // The ID of the pending safety check. + // + Id string `json:"id"` + + // Details about the pending safety check. + // + Message string `json:"message"` +} + +// The results of a file search tool call. See the +// [file search guide](https://platform.openai.com/docs/guides/tools-file-search) +// for more information. +// +// The properties ID, Queries, Status, Type are required. +type OpenaiAPIResponseFileSearchToolCallParam struct { + // The unique ID of the file search tool call. + // + Id string `json:"id"` + + // The queries used to search for files. + // + Queries []string `json:"queries"` + + // The results of the file search tool call. + // + Results []OpenaiAPIResponseFileSearchToolCallResultParam `json:"results,omitempty,omitzero"` + + // The status of the file search tool call. One of `in_progress`, `searching`, + // `incomplete` or `failed`, + // + // Any of "in_progress", "searching", "completed", "incomplete", "failed". + // + Status OpenaiAPIResponseFileSearchToolCallParamStatus `json:"status"` + + // The type of the file search tool call. Always `file_search_call`. + // + // This field can be elided, and will marshal its zero value as + // "file_search_call". + // + Type interface{} `json:"type"` +} + +type OpenaiAPIResponseFileSearchToolCallParamStatus string + +const OpenaiAPIResponseFileSearchToolCallParamStatusCompleted OpenaiAPIResponseFileSearchToolCallParamStatus = "completed" +const OpenaiAPIResponseFileSearchToolCallParamStatusFailed OpenaiAPIResponseFileSearchToolCallParamStatus = "failed" +const OpenaiAPIResponseFileSearchToolCallParamStatusInProgress OpenaiAPIResponseFileSearchToolCallParamStatus = "in_progress" +const OpenaiAPIResponseFileSearchToolCallParamStatusIncomplete OpenaiAPIResponseFileSearchToolCallParamStatus = "incomplete" +const OpenaiAPIResponseFileSearchToolCallParamStatusSearching OpenaiAPIResponseFileSearchToolCallParamStatus = "searching" + +// OpenAI APIResponse File Search Tool Call Result Attribute Union Param +// configuration. See the linked native reference for semantics and availability. +type OpenaiAPIResponseFileSearchToolCallResultAttributeUnionParam = json.RawMessage + +// OpenAI APIResponse File Search Tool Call Result Param configuration. See the +// linked native reference for semantics and availability. +type OpenaiAPIResponseFileSearchToolCallResultParam struct { + // Set of 16 key-value pairs that can be attached to an object. This can be useful + // for storing additional information about the object in a structured format, and + // querying for objects via API or the dashboard. Keys are strings with a maximum + // length of 64 characters. Values are strings with a maximum length of 512 + // characters, booleans, or numbers. + // + Attributes OpenaiAPIResponseFileSearchToolCallResultParamAttributes `json:"attributes,omitempty,omitzero"` + + // The unique ID of the file. + // + FileId *string `json:"file_id,omitempty,omitzero"` + + // The name of the file. + // + Filename *string `json:"filename,omitempty,omitzero"` + + // The relevance score of the file - a value between 0 and 1. + // + Score *float64 `json:"score,omitempty,omitzero"` + + // The text that was retrieved from the file. + // + Text *string `json:"text,omitempty,omitzero"` +} + +// Set of 16 key-value pairs that can be attached to an object. This can be useful +// for storing additional information about the object in a structured format, and +// querying for objects via API or the dashboard. Keys are strings with a maximum +// length of 64 characters. Values are strings with a maximum length of 512 +// characters, booleans, or numbers. +type OpenaiAPIResponseFileSearchToolCallResultParamAttributes map[string]OpenaiAPIResponseFileSearchToolCallResultAttributeUnionParam + +// JSON object response format. An older method of generating JSON responses. Using +// `json_schema` is recommended for models that support it. Note that the model +// will not generate JSON without a system or user message instructing it to do so. +// +// This struct has a constant value, construct it with +// [NewResponseFormatJSONObjectParam]. +type OpenaiAPIResponseFormatJSONObjectParam struct { + // The type of response format being defined. Always `json_object`. + // + Type interface{} `json:"type"` +} + +// OpenAI APIResponse Format Text Config Union Param configuration. See the linked +// native reference for semantics and availability. +type OpenaiAPIResponseFormatTextConfigUnionParam = json.RawMessage + +// JSON Schema response format. Used to generate structured JSON responses. Learn +// more about +// [Structured +// Outputs](https://platform.openai.com/docs/guides/structured-outputs). +// +// The properties Name, Schema, Type are required. +type OpenaiAPIResponseFormatTextJSONSchemaConfigParam struct { + // A description of what the response format is for, used by the model to + // determine + // how to respond in the format. + // + Description *string `json:"description,omitempty,omitzero"` + + // The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores + // and dashes, with a maximum length of 64. + // + Name string `json:"name"` + + // The schema for the response format, described as a JSON Schema object. Learn + // how + // to build JSON schemas [here](https://json-schema.org/). + // + Schema OpenaiAPIResponseFormatTextJSONSchemaConfigParamSchema `json:"schema"` + + // Whether to enable strict schema adherence when generating the output. If set to + // true, the model will always follow the exact schema defined in the `schema` + // field. Only a subset of JSON Schema is supported when `strict` is `true`. To + // learn more, read the + // [Structured Outputs + // guide](https://platform.openai.com/docs/guides/structured-outputs). + // + Strict *bool `json:"strict,omitempty,omitzero"` + + // The type of response format being defined. Always `json_schema`. + // + // This field can be elided, and will marshal its zero value as "json_schema". + // + Type interface{} `json:"type"` +} + +// The schema for the response format, described as a JSON Schema object. Learn how +// to build JSON schemas [here](https://json-schema.org/). +type OpenaiAPIResponseFormatTextJSONSchemaConfigParamSchema map[string]interface{} + +// Default response format. Used to generate text responses. +// +// This struct has a constant value, construct it with +// [NewResponseFormatTextParam]. +type OpenaiAPIResponseFormatTextParam struct { + // The type of response format being defined. Always `text`. + // + Type interface{} `json:"type"` +} + +// A tool call to run a function. See the +// [function calling +// guide](https://platform.openai.com/docs/guides/function-calling) +// for more information. +// +// The properties Arguments, CallID, Name, Type are required. +type OpenaiAPIResponseFunctionToolCallParam struct { + // A JSON string of the arguments to pass to the function. + // + Arguments string `json:"arguments"` + + // The unique ID of the function tool call generated by the model. + // + CallId string `json:"call_id"` + + // The unique ID of the function tool call. + // + Id *string `json:"id,omitempty,omitzero"` + + // The name of the function to run. + // + Name string `json:"name"` + + // The status of the item. One of `in_progress`, `completed`, or `incomplete`. + // Populated when items are returned via API. + // + // Any of "in_progress", "completed", "incomplete". + // + Status *OpenaiAPIResponseFunctionToolCallParamStatus `json:"status,omitempty,omitzero"` + + // The type of the function tool call. Always `function_call`. + // + // This field can be elided, and will marshal its zero value as "function_call". + // + Type interface{} `json:"type"` +} + +type OpenaiAPIResponseFunctionToolCallParamStatus string + +const OpenaiAPIResponseFunctionToolCallParamStatusCompleted OpenaiAPIResponseFunctionToolCallParamStatus = "completed" +const OpenaiAPIResponseFunctionToolCallParamStatusInProgress OpenaiAPIResponseFunctionToolCallParamStatus = "in_progress" +const OpenaiAPIResponseFunctionToolCallParamStatusIncomplete OpenaiAPIResponseFunctionToolCallParamStatus = "incomplete" + +// Action type "find": Searches for a pattern within a loaded page. +// +// The properties Pattern, Type, URL are required. +type OpenaiAPIResponseFunctionWebSearchActionFindParam struct { + // The pattern or text to search for within the page. + // + Pattern string `json:"pattern"` + + // The action type. + // + // This field can be elided, and will marshal its zero value as "find". + // + Type interface{} `json:"type"` + + // The URL of the page searched for the pattern. + // + Url string `json:"url"` +} + +// Action type "open_page" - Opens a specific URL from search results. +// +// The properties Type, URL are required. +type OpenaiAPIResponseFunctionWebSearchActionOpenPageParam struct { + // The action type. + // + // This field can be elided, and will marshal its zero value as "open_page". + // + Type interface{} `json:"type"` + + // The URL opened by the model. + // + Url string `json:"url"` +} + +// Action type "search" - Performs a web search query. +// +// The properties Query, Type are required. +type OpenaiAPIResponseFunctionWebSearchActionSearchParam struct { + // The search query. + // + Query string `json:"query"` + + // The action type. + // + // This field can be elided, and will marshal its zero value as "search". + // + Type interface{} `json:"type"` +} + +// OpenAI APIResponse Function Web Search Action Union Param configuration. See the +// linked native reference for semantics and availability. +type OpenaiAPIResponseFunctionWebSearchActionUnionParam = json.RawMessage + +// The results of a web search tool call. See the +// [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for +// more information. +// +// The properties ID, Action, Status, Type are required. +type OpenaiAPIResponseFunctionWebSearchParam struct { + // An object describing the specific action taken in this web search call. + // Includes + // details on how the model used the web (search, open_page, find). + // + Action OpenaiAPIResponseFunctionWebSearchActionUnionParam `json:"action"` + + // The unique ID of the web search tool call. + // + Id string `json:"id"` + + // The status of the web search tool call. + // + // Any of "in_progress", "searching", "completed", "failed". + // + Status OpenaiAPIResponseFunctionWebSearchParamStatus `json:"status"` + + // The type of the web search tool call. Always `web_search_call`. + // + // This field can be elided, and will marshal its zero value as "web_search_call". + // + Type interface{} `json:"type"` +} + +type OpenaiAPIResponseFunctionWebSearchParamStatus string + +const OpenaiAPIResponseFunctionWebSearchParamStatusCompleted OpenaiAPIResponseFunctionWebSearchParamStatus = "completed" +const OpenaiAPIResponseFunctionWebSearchParamStatusFailed OpenaiAPIResponseFunctionWebSearchParamStatus = "failed" +const OpenaiAPIResponseFunctionWebSearchParamStatusInProgress OpenaiAPIResponseFunctionWebSearchParamStatus = "in_progress" +const OpenaiAPIResponseFunctionWebSearchParamStatusSearching OpenaiAPIResponseFunctionWebSearchParamStatus = "searching" + +// OpenAI APIResponse Input Content Union Param configuration. See the linked +// native reference for semantics and availability. +type OpenaiAPIResponseInputContentUnionParam = json.RawMessage + +// A file input to the model. +// +// The property Type is required. +type OpenaiAPIResponseInputFileParam struct { + // The content of the file to be sent to the model. + // + FileData *string `json:"file_data,omitempty,omitzero"` + + // The ID of the file to be sent to the model. + // + FileId *string `json:"file_id,omitempty,omitzero"` + + // The URL of the file to be sent to the model. + // + FileUrl *string `json:"file_url,omitempty,omitzero"` + + // The name of the file to be sent to the model. + // + Filename *string `json:"filename,omitempty,omitzero"` + + // The type of the input item. Always `input_file`. + // + // This field can be elided, and will marshal its zero value as "input_file". + // + Type interface{} `json:"type"` +} + +// An image input to the model. Learn about +// [image inputs](https://platform.openai.com/docs/guides/vision). +// +// The properties Detail, Type are required. +type OpenaiAPIResponseInputImageParam struct { + // The detail level of the image to be sent to the model. One of `high`, `low`, or + // `auto`. Defaults to `auto`. + // + // Any of "low", "high", "auto". + // + Detail OpenaiAPIResponseInputImageParamDetail `json:"detail"` + + // The ID of the file to be sent to the model. + // + FileId *string `json:"file_id,omitempty,omitzero"` + + // The URL of the image to be sent to the model. A fully qualified URL or base64 + // encoded image in a data URL. + // + ImageUrl *string `json:"image_url,omitempty,omitzero"` + + // The type of the input item. Always `input_image`. + // + // This field can be elided, and will marshal its zero value as "input_image". + // + Type interface{} `json:"type"` +} + +type OpenaiAPIResponseInputImageParamDetail string + +const OpenaiAPIResponseInputImageParamDetailAuto OpenaiAPIResponseInputImageParamDetail = "auto" +const OpenaiAPIResponseInputImageParamDetailHigh OpenaiAPIResponseInputImageParamDetail = "high" +const OpenaiAPIResponseInputImageParamDetailLow OpenaiAPIResponseInputImageParamDetail = "low" + +// A pending safety check for the computer call. +// +// The property ID is required. +type OpenaiAPIResponseInputItemComputerCallOutputAcknowledgedSafetyCheckParam struct { + // The type of the pending safety check. + // + Code *string `json:"code,omitempty,omitzero"` + + // The ID of the pending safety check. + // + Id string `json:"id"` + + // Details about the pending safety check. + // + Message *string `json:"message,omitempty,omitzero"` +} + +// The output of a computer tool call. +// +// The properties CallID, Output, Type are required. +type OpenaiAPIResponseInputItemComputerCallOutputParam struct { + // The safety checks reported by the API that have been acknowledged by the + // developer. + // + AcknowledgedSafetyChecks []OpenaiAPIResponseInputItemComputerCallOutputAcknowledgedSafetyCheckParam `json:"acknowledged_safety_checks,omitempty,omitzero"` + + // The ID of the computer tool call that produced the output. + // + CallId string `json:"call_id"` + + // The ID of the computer tool call output. + // + Id *string `json:"id,omitempty,omitzero"` + + // A computer screenshot image used with the computer use tool. + // + Output OpenaiAPIResponseComputerToolCallOutputScreenshotParam `json:"output"` + + // The status of the message input. One of `in_progress`, `completed`, or + // `incomplete`. Populated when input items are returned via API. + // + // Any of "in_progress", "completed", "incomplete". + // + Status *string `json:"status,omitempty,omitzero"` + + // The type of the computer tool call output. Always `computer_call_output`. + // + // This field can be elided, and will marshal its zero value as + // "computer_call_output". + // + Type interface{} `json:"type"` +} + +// The output of a function tool call. +// +// The properties CallID, Output, Type are required. +type OpenaiAPIResponseInputItemFunctionCallOutputParam struct { + // The unique ID of the function tool call generated by the model. + // + CallId string `json:"call_id"` + + // The unique ID of the function tool call output. Populated when this item is + // returned via API. + // + Id *string `json:"id,omitempty,omitzero"` + + // A JSON string of the output of the function tool call. + // + Output string `json:"output"` + + // The status of the item. One of `in_progress`, `completed`, or `incomplete`. + // Populated when items are returned via API. + // + // Any of "in_progress", "completed", "incomplete". + // + Status *string `json:"status,omitempty,omitzero"` + + // The type of the function tool call output. Always `function_call_output`. + // + // This field can be elided, and will marshal its zero value as + // "function_call_output". + // + Type interface{} `json:"type"` +} + +// An image generation request made by the model. +// +// The properties ID, Result, Status, Type are required. +type OpenaiAPIResponseInputItemImageGenerationCallParam struct { + // The unique ID of the image generation call. + // + Id string `json:"id"` + + // The generated image encoded in base64. + // + Result string `json:"result"` + + // The status of the image generation call. + // + // Any of "in_progress", "completed", "generating", "failed". + // + Status string `json:"status"` + + // The type of the image generation call. Always `image_generation_call`. + // + // This field can be elided, and will marshal its zero value as + // "image_generation_call". + // + Type interface{} `json:"type"` +} + +// An internal identifier for an item to reference. +// +// The property ID is required. +type OpenaiAPIResponseInputItemItemReferenceParam struct { + // The ID of the item to reference. + // + Id string `json:"id"` + + // The type of item to reference. Always `item_reference`. + // + // Any of "item_reference". + // + Type *string `json:"type,omitempty,omitzero"` +} + +// Execute a shell command on the server. +// +// The properties Command, Env, Type are required. +type OpenaiAPIResponseInputItemLocalShellCallActionParam struct { + // The command to run. + // + Command []string `json:"command"` + + // Environment variables to set for the command. + // + Env OpenaiAPIResponseInputItemLocalShellCallActionParamEnv `json:"env"` + + // Optional timeout in milliseconds for the command. + // + TimeoutMs *int `json:"timeout_ms,omitempty,omitzero"` + + // The type of the local shell action. Always `exec`. + // + // This field can be elided, and will marshal its zero value as "exec". + // + Type interface{} `json:"type"` + + // Optional user to run the command as. + // + User *string `json:"user,omitempty,omitzero"` + + // Optional working directory to run the command in. + // + WorkingDirectory *string `json:"working_directory,omitempty,omitzero"` +} + +// Environment variables to set for the command. +type OpenaiAPIResponseInputItemLocalShellCallActionParamEnv map[string]string + +// The output of a local shell tool call. +// +// The properties ID, Output, Type are required. +type OpenaiAPIResponseInputItemLocalShellCallOutputParam struct { + // The unique ID of the local shell tool call generated by the model. + // + Id string `json:"id"` + + // A JSON string of the output of the local shell tool call. + // + Output string `json:"output"` + + // The status of the item. One of `in_progress`, `completed`, or `incomplete`. + // + // Any of "in_progress", "completed", "incomplete". + // + Status *string `json:"status,omitempty,omitzero"` + + // The type of the local shell tool call output. Always `local_shell_call_output`. + // + // This field can be elided, and will marshal its zero value as + // "local_shell_call_output". + // + Type interface{} `json:"type"` +} + +// A tool call to run a command on the local shell. +// +// The properties ID, Action, CallID, Status, Type are required. +type OpenaiAPIResponseInputItemLocalShellCallParam struct { + // Execute a shell command on the server. + // + Action OpenaiAPIResponseInputItemLocalShellCallActionParam `json:"action"` + + // The unique ID of the local shell tool call generated by the model. + // + CallId string `json:"call_id"` + + // The unique ID of the local shell call. + // + Id string `json:"id"` + + // The status of the local shell call. + // + // Any of "in_progress", "completed", "incomplete". + // + Status string `json:"status"` + + // The type of the local shell call. Always `local_shell_call`. + // + // This field can be elided, and will marshal its zero value as + // "local_shell_call". + // + Type interface{} `json:"type"` +} + +// A request for human approval of a tool invocation. +// +// The properties ID, Arguments, Name, ServerLabel, Type are required. +type OpenaiAPIResponseInputItemMcpApprovalRequestParam struct { + // A JSON string of arguments for the tool. + // + Arguments string `json:"arguments"` + + // The unique ID of the approval request. + // + Id string `json:"id"` + + // The name of the tool to run. + // + Name string `json:"name"` + + // The label of the MCP server making the request. + // + ServerLabel string `json:"server_label"` + + // The type of the item. Always `mcp_approval_request`. + // + // This field can be elided, and will marshal its zero value as + // "mcp_approval_request". + // + Type interface{} `json:"type"` +} + +// A response to an MCP approval request. +// +// The properties ApprovalRequestID, Approve, Type are required. +type OpenaiAPIResponseInputItemMcpApprovalResponseParam struct { + // The ID of the approval request being answered. + // + ApprovalRequestId string `json:"approval_request_id"` + + // Whether the request was approved. + // + Approve bool `json:"approve"` + + // The unique ID of the approval response + // + Id *string `json:"id,omitempty,omitzero"` + + // Optional reason for the decision. + // + Reason *string `json:"reason,omitempty,omitzero"` + + // The type of the item. Always `mcp_approval_response`. + // + // This field can be elided, and will marshal its zero value as + // "mcp_approval_response". + // + Type interface{} `json:"type"` +} + +// An invocation of a tool on an MCP server. +// +// The properties ID, Arguments, Name, ServerLabel, Type are required. +type OpenaiAPIResponseInputItemMcpCallParam struct { + // A JSON string of the arguments passed to the tool. + // + Arguments string `json:"arguments"` + + // The error from the tool call, if any. + // + Error *string `json:"error,omitempty,omitzero"` + + // The unique ID of the tool call. + // + Id string `json:"id"` + + // The name of the tool that was run. + // + Name string `json:"name"` + + // The output from the tool call. + // + Output *string `json:"output,omitempty,omitzero"` + + // The label of the MCP server running the tool. + // + ServerLabel string `json:"server_label"` + + // The type of the item. Always `mcp_call`. + // + // This field can be elided, and will marshal its zero value as "mcp_call". + // + Type interface{} `json:"type"` +} + +// A list of tools available on an MCP server. +// +// The properties ID, ServerLabel, Tools, Type are required. +type OpenaiAPIResponseInputItemMcpListToolsParam struct { + // Error message if the server could not list tools. + // + Error *string `json:"error,omitempty,omitzero"` + + // The unique ID of the list. + // + Id string `json:"id"` + + // The label of the MCP server. + // + ServerLabel string `json:"server_label"` + + // The tools available on the server. + // + Tools []OpenaiAPIResponseInputItemMcpListToolsToolParam `json:"tools"` + + // The type of the item. Always `mcp_list_tools`. + // + // This field can be elided, and will marshal its zero value as "mcp_list_tools". + // + Type interface{} `json:"type"` +} + +// A tool available on an MCP server. +// +// The properties InputSchema, Name are required. +type OpenaiAPIResponseInputItemMcpListToolsToolParam struct { + // Additional annotations about the tool. + // + Annotations interface{} `json:"annotations,omitempty,omitzero"` + + // The description of the tool. + // + Description *string `json:"description,omitempty,omitzero"` + + // The JSON schema describing the tool's input. + // + InputSchema interface{} `json:"input_schema"` + + // The name of the tool. + // + Name string `json:"name"` +} + +// A message input to the model with a role indicating instruction following +// hierarchy. Instructions given with the `developer` or `system` role take +// precedence over instructions given with the `user` role. +// +// The properties Content, Role are required. +type OpenaiAPIResponseInputItemMessageParam struct { + // A list of one or many input items to the model, containing different content + // types. + // + Content []OpenaiAPIResponseInputContentUnionParam `json:"content"` + + // The role of the message input. One of `user`, `system`, or `developer`. + // + // Any of "user", "system", "developer". + // + Role string `json:"role"` + + // The status of item. One of `in_progress`, `completed`, or `incomplete`. + // Populated when items are returned via API. + // + // Any of "in_progress", "completed", "incomplete". + // + Status *string `json:"status,omitempty,omitzero"` + + // The type of the message input. Always set to `message`. + // + // Any of "message". + // + Type *string `json:"type,omitempty,omitzero"` +} + +// OpenAI APIResponse Input Item Union Param configuration. See the linked native +// reference for semantics and availability. +type OpenaiAPIResponseInputItemUnionParam = json.RawMessage + +// A text input to the model. +// +// The properties Text, Type are required. +type OpenaiAPIResponseInputTextParam struct { + // The text input to the model. + // + Text string `json:"text"` + + // The type of the input item. Always `input_text`. + // + // This field can be elided, and will marshal its zero value as "input_text". + // + Type interface{} `json:"type"` +} + +// OpenAI APIResponse New Params Input Union configuration. See the linked native +// reference for semantics and availability. +type OpenaiAPIResponseNewParamsInputUnion = json.RawMessage + +// OpenAI APIResponse New Params Tool Choice Union configuration. See the linked +// native reference for semantics and availability. +type OpenaiAPIResponseNewParamsToolChoiceUnion = json.RawMessage + +// OpenAI APIResponse Output Message Content Union Param configuration. See the +// linked native reference for semantics and availability. +type OpenaiAPIResponseOutputMessageContentUnionParam = json.RawMessage + +// An output message from the model. +// +// The properties ID, Content, Role, Status, Type are required. +type OpenaiAPIResponseOutputMessageParam struct { + // The content of the output message. + // + Content []OpenaiAPIResponseOutputMessageContentUnionParam `json:"content"` + + // The unique ID of the output message. + // + Id string `json:"id"` + + // The role of the output message. Always `assistant`. + // + // This field can be elided, and will marshal its zero value as "assistant". + // + Role interface{} `json:"role"` + + // The status of the message input. One of `in_progress`, `completed`, or + // `incomplete`. Populated when input items are returned via API. + // + // Any of "in_progress", "completed", "incomplete". + // + Status OpenaiAPIResponseOutputMessageParamStatus `json:"status"` + + // The type of the output message. Always `message`. + // + // This field can be elided, and will marshal its zero value as "message". + // + Type interface{} `json:"type"` +} + +type OpenaiAPIResponseOutputMessageParamStatus string + +const OpenaiAPIResponseOutputMessageParamStatusCompleted OpenaiAPIResponseOutputMessageParamStatus = "completed" +const OpenaiAPIResponseOutputMessageParamStatusInProgress OpenaiAPIResponseOutputMessageParamStatus = "in_progress" +const OpenaiAPIResponseOutputMessageParamStatusIncomplete OpenaiAPIResponseOutputMessageParamStatus = "incomplete" + +// A refusal from the model. +// +// The properties Refusal, Type are required. +type OpenaiAPIResponseOutputRefusalParam struct { + // The refusal explanation from the model. + // + Refusal string `json:"refusal"` + + // The type of the refusal. Always `refusal`. + // + // This field can be elided, and will marshal its zero value as "refusal". + // + Type interface{} `json:"type"` +} + +// A citation for a container file used to generate a model response. +// +// The properties ContainerID, EndIndex, FileID, Filename, StartIndex, Type are +// required. +type OpenaiAPIResponseOutputTextAnnotationContainerFileCitationParam struct { + // The ID of the container file. + // + ContainerId string `json:"container_id"` + + // The index of the last character of the container file citation in the message. + // + EndIndex int `json:"end_index"` + + // The ID of the file. + // + FileId string `json:"file_id"` + + // The filename of the container file cited. + // + Filename string `json:"filename"` + + // The index of the first character of the container file citation in the message. + // + StartIndex int `json:"start_index"` + + // The type of the container file citation. Always `container_file_citation`. + // + // This field can be elided, and will marshal its zero value as + // "container_file_citation". + // + Type interface{} `json:"type"` +} + +// A citation to a file. +// +// The properties FileID, Filename, Index, Type are required. +type OpenaiAPIResponseOutputTextAnnotationFileCitationParam struct { + // The ID of the file. + // + FileId string `json:"file_id"` + + // The filename of the file cited. + // + Filename string `json:"filename"` + + // The index of the file in the list of files. + // + Index int `json:"index"` + + // The type of the file citation. Always `file_citation`. + // + // This field can be elided, and will marshal its zero value as "file_citation". + // + Type interface{} `json:"type"` +} + +// A path to a file. +// +// The properties FileID, Index, Type are required. +type OpenaiAPIResponseOutputTextAnnotationFilePathParam struct { + // The ID of the file. + // + FileId string `json:"file_id"` + + // The index of the file in the list of files. + // + Index int `json:"index"` + + // The type of the file path. Always `file_path`. + // + // This field can be elided, and will marshal its zero value as "file_path". + // + Type interface{} `json:"type"` +} + +// A citation for a web resource used to generate a model response. +// +// The properties EndIndex, StartIndex, Title, Type, URL are required. +type OpenaiAPIResponseOutputTextAnnotationURLCitationParam struct { + // The index of the last character of the URL citation in the message. + // + EndIndex int `json:"end_index"` + + // The index of the first character of the URL citation in the message. + // + StartIndex int `json:"start_index"` + + // The title of the web resource. + // + Title string `json:"title"` + + // The type of the URL citation. Always `url_citation`. + // + // This field can be elided, and will marshal its zero value as "url_citation". + // + Type interface{} `json:"type"` + + // The URL of the web resource. + // + Url string `json:"url"` +} + +// OpenAI APIResponse Output Text Annotation Union Param configuration. See the +// linked native reference for semantics and availability. +type OpenaiAPIResponseOutputTextAnnotationUnionParam = json.RawMessage + +// The log probability of a token. +// +// The properties Token, Bytes, Logprob, TopLogprobs are required. +type OpenaiAPIResponseOutputTextLogprobParam struct { + // Bytes configuration. See the linked native reference for semantics and + // availability. + Bytes []int `json:"bytes"` + + // Logprob configuration. See the linked native reference for semantics and + // availability. + Logprob float64 `json:"logprob"` + + // Token configuration. See the linked native reference for semantics and + // availability. + Token string `json:"token"` + + // Top logprobs configuration. See the linked native reference for semantics and + // availability. + TopLogprobs []OpenaiAPIResponseOutputTextLogprobTopLogprobParam `json:"top_logprobs"` +} + +// The top log probability of a token. +// +// The properties Token, Bytes, Logprob are required. +type OpenaiAPIResponseOutputTextLogprobTopLogprobParam struct { + // Bytes configuration. See the linked native reference for semantics and + // availability. + Bytes []int `json:"bytes"` + + // Logprob configuration. See the linked native reference for semantics and + // availability. + Logprob float64 `json:"logprob"` + + // Token configuration. See the linked native reference for semantics and + // availability. + Token string `json:"token"` +} + +// A text output from the model. +// +// The properties Annotations, Text, Type are required. +type OpenaiAPIResponseOutputTextParam struct { + // The annotations of the text output. + // + Annotations []OpenaiAPIResponseOutputTextAnnotationUnionParam `json:"annotations"` + + // Logprobs configuration. See the linked native reference for semantics and + // availability. + Logprobs []OpenaiAPIResponseOutputTextLogprobParam `json:"logprobs,omitempty,omitzero"` + + // The text output from the model. + // + Text string `json:"text"` + + // The type of the output text. Always `output_text`. + // + // This field can be elided, and will marshal its zero value as "output_text". + // + Type interface{} `json:"type"` +} + +// Reference to a prompt template and its variables. +// [Learn +// more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts). +// +// The property ID is required. +type OpenaiAPIResponsePromptParam struct { + // The unique identifier of the prompt template to use. + // + Id string `json:"id"` + + // Optional map of values to substitute in for variables in your prompt. The + // substitution values can either be strings, or other Response input types like + // images or files. + // + Variables OpenaiAPIResponsePromptParamVariables `json:"variables,omitempty,omitzero"` + + // Optional version of the prompt template. + // + Version *string `json:"version,omitempty,omitzero"` +} + +// Optional map of values to substitute in for variables in your prompt. The +// substitution values can either be strings, or other Response input types like +// images or files. +type OpenaiAPIResponsePromptParamVariables map[string]OpenaiAPIResponsePromptVariableUnionParam + +// OpenAI APIResponse Prompt Variable Union Param configuration. See the linked +// native reference for semantics and availability. +type OpenaiAPIResponsePromptVariableUnionParam = json.RawMessage + +// A description of the chain of thought used by a reasoning model while generating +// a response. Be sure to include these items in your `input` to the Responses API +// for subsequent turns of a conversation if you are manually +// [managing context](https://platform.openai.com/docs/guides/conversation-state). +// +// The properties ID, Summary, Type are required. +type OpenaiAPIResponseReasoningItemParam struct { + // The encrypted content of the reasoning item - populated when a response is + // generated with `reasoning.encrypted_content` in the `include` parameter. + // + EncryptedContent *string `json:"encrypted_content,omitempty,omitzero"` + + // The unique identifier of the reasoning content. + // + Id string `json:"id"` + + // The status of the item. One of `in_progress`, `completed`, or `incomplete`. + // Populated when items are returned via API. + // + // Any of "in_progress", "completed", "incomplete". + // + Status *OpenaiAPIResponseReasoningItemParamStatus `json:"status,omitempty,omitzero"` + + // Reasoning text contents. + // + Summary []OpenaiAPIResponseReasoningItemSummaryParam `json:"summary"` + + // The type of the object. Always `reasoning`. + // + // This field can be elided, and will marshal its zero value as "reasoning". + // + Type interface{} `json:"type"` +} + +type OpenaiAPIResponseReasoningItemParamStatus string + +const OpenaiAPIResponseReasoningItemParamStatusCompleted OpenaiAPIResponseReasoningItemParamStatus = "completed" +const OpenaiAPIResponseReasoningItemParamStatusInProgress OpenaiAPIResponseReasoningItemParamStatus = "in_progress" +const OpenaiAPIResponseReasoningItemParamStatusIncomplete OpenaiAPIResponseReasoningItemParamStatus = "incomplete" + +// The properties Text, Type are required. +type OpenaiAPIResponseReasoningItemSummaryParam struct { + // A short summary of the reasoning used by the model when generating the + // response. + // + Text string `json:"text"` + + // The type of the object. Always `summary_text`. + // + // This field can be elided, and will marshal its zero value as "summary_text". + // + Type interface{} `json:"type"` +} + +// Configuration options for a text response from the model. Can be plain text or +// structured JSON data. Learn more: +// +// - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) +// - [Structured +// Outputs](https://platform.openai.com/docs/guides/structured-outputs) +type OpenaiAPIResponseTextConfigParam struct { + // An object specifying the format that the model must output. + // + // Configuring `{ "type": "json_schema" }` enables Structured Outputs, which + // ensures the model will match your supplied JSON schema. Learn more in the + // [Structured Outputs + // guide](https://platform.openai.com/docs/guides/structured-outputs). + // + // The default format is `{ "type": "text" }` with no additional options. + // + // **Not recommended for gpt-4o and newer models:** + // + // Setting to `{ "type": "json_object" }` enables the older JSON mode, which + // ensures the message the model generates is valid JSON. Using `json_schema` is + // preferred for models that support it. + // + Format *OpenaiAPIResponseFormatTextConfigUnionParam `json:"format,omitempty,omitzero"` +} + +// Use this option to force the model to call a specific function. +// +// The properties Name, Type are required. +type OpenaiAPIToolChoiceFunctionParam struct { + // The name of the function to call. + // + Name string `json:"name"` + + // For function calling, the type is always `function`. + // + // This field can be elided, and will marshal its zero value as "function". + // + Type interface{} `json:"type"` +} + +// Use this option to force the model to call a specific tool on a remote MCP +// server. +// +// The properties ServerLabel, Type are required. +type OpenaiAPIToolChoiceMcpParam struct { + // The name of the tool to call on the server. + // + Name *string `json:"name,omitempty,omitzero"` + + // The label of the MCP server to use. + // + ServerLabel string `json:"server_label"` + + // For MCP tools, the type is always `mcp`. + // + // This field can be elided, and will marshal its zero value as "mcp". + // + Type interface{} `json:"type"` +} + +// Indicates that the model should use a built-in tool to generate a response. +// [Learn more about built-in +// tools](https://platform.openai.com/docs/guides/tools). +// +// The property Type is required. +type OpenaiAPIToolChoiceTypesParam struct { + // The type of hosted tool the model should to use. Learn more about + // [built-in tools](https://platform.openai.com/docs/guides/tools). + // + // Allowed values are: + // + // - `file_search` + // - `web_search_preview` + // - `computer_use_preview` + // - `code_interpreter` + // - `image_generation` + // + // Any of "file_search", "web_search_preview", "computer_use_preview", + // "web_search_preview_2025_03_11", "image_generation", "code_interpreter". + // + Type OpenaiAPIToolChoiceTypesParamType `json:"type"` +} + +type OpenaiAPIToolChoiceTypesParamType string + +const OpenaiAPIToolChoiceTypesParamTypeCodeInterpreter OpenaiAPIToolChoiceTypesParamType = "code_interpreter" +const OpenaiAPIToolChoiceTypesParamTypeComputerUsePreview OpenaiAPIToolChoiceTypesParamType = "computer_use_preview" +const OpenaiAPIToolChoiceTypesParamTypeFileSearch OpenaiAPIToolChoiceTypesParamType = "file_search" +const OpenaiAPIToolChoiceTypesParamTypeImageGeneration OpenaiAPIToolChoiceTypesParamType = "image_generation" +const OpenaiAPIToolChoiceTypesParamTypeWebSearchPreview OpenaiAPIToolChoiceTypesParamType = "web_search_preview" +const OpenaiAPIToolChoiceTypesParamTypeWebSearchPreview20250311 OpenaiAPIToolChoiceTypesParamType = "web_search_preview_2025_03_11" + +// Configuration for a code interpreter container. Optionally specify the IDs of +// the files to run the code on. +// +// The property Type is required. +type OpenaiAPIToolCodeInterpreterContainerCodeInterpreterContainerAutoParam struct { + // An optional list of uploaded files to make available to your code. + // + FileIds []string `json:"file_ids,omitempty,omitzero"` + + // Always `auto`. + // + // This field can be elided, and will marshal its zero value as "auto". + // + Type interface{} `json:"type"` +} + +// OpenAI APITool Code Interpreter Container Union Param configuration. See the +// linked native reference for semantics and availability. +type OpenaiAPIToolCodeInterpreterContainerUnionParam = json.RawMessage + +// A tool that runs Python code to help generate a response to a prompt. +// +// The properties Container, Type are required. +type OpenaiAPIToolCodeInterpreterParam struct { + // The code interpreter container. Can be a container ID or an object that + // specifies uploaded file IDs to make available to your code. + // + Container OpenaiAPIToolCodeInterpreterContainerUnionParam `json:"container"` + + // The type of the code interpreter tool. Always `code_interpreter`. + // + // This field can be elided, and will marshal its zero value as + // "code_interpreter". + // + Type interface{} `json:"type"` +} + +// Optional mask for inpainting. Contains `image_url` (string, optional) and +// `file_id` (string, optional). +type OpenaiAPIToolImageGenerationInputImageMaskParam struct { + // File ID for the mask image. + // + FileId *string `json:"file_id,omitempty,omitzero"` + + // Base64-encoded mask image. + // + ImageUrl *string `json:"image_url,omitempty,omitzero"` +} + +// A tool that generates images using a model like `gpt-image-1`. +// +// The property Type is required. +type OpenaiAPIToolImageGenerationParam struct { + // Background type for the generated image. One of `transparent`, `opaque`, or + // `auto`. Default: `auto`. + // + // Any of "transparent", "opaque", "auto". + // + Background *string `json:"background,omitempty,omitzero"` + + // Control how much effort the model will exert to match the style and features, + // especially facial features, of input images. This parameter is only supported + // for `gpt-image-1`. Supports `high` and `low`. Defaults to `low`. + // + // Any of "high", "low". + // + InputFidelity *string `json:"input_fidelity,omitempty,omitzero"` + + // Optional mask for inpainting. Contains `image_url` (string, optional) and + // `file_id` (string, optional). + // + InputImageMask *OpenaiAPIToolImageGenerationInputImageMaskParam `json:"input_image_mask,omitempty,omitzero"` + + // The image generation model to use. Default: `gpt-image-1`. + // + // Any of "gpt-image-1". + // + Model *string `json:"model,omitempty,omitzero"` + + // Moderation level for the generated image. Default: `auto`. + // + // Any of "auto", "low". + // + Moderation *string `json:"moderation,omitempty,omitzero"` + + // Compression level for the output image. Default: 100. + // + OutputCompression *int `json:"output_compression,omitempty,omitzero"` + + // The output format of the generated image. One of `png`, `webp`, or `jpeg`. + // Default: `png`. + // + // Any of "png", "webp", "jpeg". + // + OutputFormat *string `json:"output_format,omitempty,omitzero"` + + // Number of partial images to generate in streaming mode, from 0 (default value) + // to 3. + // + PartialImages *int `json:"partial_images,omitempty,omitzero"` + + // The quality of the generated image. One of `low`, `medium`, `high`, or `auto`. + // Default: `auto`. + // + // Any of "low", "medium", "high", "auto". + // + Quality *string `json:"quality,omitempty,omitzero"` + + // The size of the generated image. One of `1024x1024`, `1024x1536`, `1536x1024`, + // or `auto`. Default: `auto`. + // + // Any of "1024x1024", "1024x1536", "1536x1024", "auto". + // + Size *string `json:"size,omitempty,omitzero"` + + // The type of the image generation tool. Always `image_generation`. + // + // This field can be elided, and will marshal its zero value as + // "image_generation". + // + Type interface{} `json:"type"` +} + +// A tool that allows the model to execute shell commands in a local environment. +// +// This struct has a constant value, construct it with [NewToolLocalShellParam]. +type OpenaiAPIToolLocalShellParam struct { + // The type of the local shell tool. Always `local_shell`. + // + Type interface{} `json:"type"` +} + +// A filter object to specify which tools are allowed. +type OpenaiAPIToolMcpAllowedToolsMcpAllowedToolsFilterParam struct { + // List of allowed tool names. + // + ToolNames []string `json:"tool_names,omitempty,omitzero"` +} + +// OpenAI APITool MCP Allowed Tools Union Param configuration. See the linked +// native reference for semantics and availability. +type OpenaiAPIToolMcpAllowedToolsUnionParam = json.RawMessage + +// Give the model access to additional tools via remote Model Context Protocol +// (MCP) servers. +// [Learn more about +// MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). +// +// The properties ServerLabel, ServerURL, Type are required. +type OpenaiAPIToolMcpParam struct { + // List of allowed tool names or a filter object. + // + AllowedTools *OpenaiAPIToolMcpAllowedToolsUnionParam `json:"allowed_tools,omitempty,omitzero"` + + // Optional HTTP headers to send to the MCP server. Use for authentication or + // other + // purposes. + // + Headers OpenaiAPIToolMcpParamHeaders `json:"headers,omitempty,omitzero"` + + // Specify which of the MCP server's tools require approval. + // + RequireApproval *OpenaiAPIToolMcpRequireApprovalUnionParam `json:"require_approval,omitempty,omitzero"` + + // Optional description of the MCP server, used to provide more context. + // + ServerDescription *string `json:"server_description,omitempty,omitzero"` + + // A label for this MCP server, used to identify it in tool calls. + // + ServerLabel string `json:"server_label"` + + // The URL for the MCP server. + // + ServerUrl string `json:"server_url"` + + // The type of the MCP tool. Always `mcp`. + // + // This field can be elided, and will marshal its zero value as "mcp". + // + Type interface{} `json:"type"` +} + +// Optional HTTP headers to send to the MCP server. Use for authentication or other +// purposes. +type OpenaiAPIToolMcpParamHeaders map[string]string + +// A list of tools that always require approval. +type OpenaiAPIToolMcpRequireApprovalMcpToolApprovalFilterAlwaysParam struct { + // List of tools that require approval. + // + ToolNames []string `json:"tool_names,omitempty,omitzero"` +} + +// A list of tools that never require approval. +type OpenaiAPIToolMcpRequireApprovalMcpToolApprovalFilterNeverParam struct { + // List of tools that do not require approval. + // + ToolNames []string `json:"tool_names,omitempty,omitzero"` +} + +// OpenAI APITool MCP Require Approval MCP Tool Approval Filter Param +// configuration. See the linked native reference for semantics and availability. +type OpenaiAPIToolMcpRequireApprovalMcpToolApprovalFilterParam struct { + // A list of tools that always require approval. + // + Always *OpenaiAPIToolMcpRequireApprovalMcpToolApprovalFilterAlwaysParam `json:"always,omitempty,omitzero"` + + // A list of tools that never require approval. + // + Never *OpenaiAPIToolMcpRequireApprovalMcpToolApprovalFilterNeverParam `json:"never,omitempty,omitzero"` +} + +// OpenAI APITool MCP Require Approval Union Param configuration. See the linked +// native reference for semantics and availability. +type OpenaiAPIToolMcpRequireApprovalUnionParam = json.RawMessage + +// OpenAI APITool Union Param configuration. See the linked native reference for +// semantics and availability. +type OpenaiAPIToolUnionParam = json.RawMessage + +// This tool searches the web for relevant results to use in a response. Learn more +// about the +// [web search tool](https://platform.openai.com/docs/guides/tools-web-search). +// +// The property Type is required. +type OpenaiAPIWebSearchToolParam struct { + // High level guidance for the amount of context window space to use for the + // search. One of `low`, `medium`, or `high`. `medium` is the default. + // + // Any of "low", "medium", "high". + // + SearchContextSize *OpenaiAPIWebSearchToolParamSearchContextSize `json:"search_context_size,omitempty,omitzero"` + + // The type of the web search tool. One of `web_search_preview` or + // `web_search_preview_2025_03_11`. + // + // Any of "web_search_preview", "web_search_preview_2025_03_11". + // + Type OpenaiAPIWebSearchToolParamType `json:"type"` + + // The user's location. + // + UserLocation *OpenaiAPIWebSearchToolUserLocationParam `json:"user_location,omitempty,omitzero"` +} + +type OpenaiAPIWebSearchToolParamSearchContextSize string + +const OpenaiAPIWebSearchToolParamSearchContextSizeHigh OpenaiAPIWebSearchToolParamSearchContextSize = "high" +const OpenaiAPIWebSearchToolParamSearchContextSizeLow OpenaiAPIWebSearchToolParamSearchContextSize = "low" +const OpenaiAPIWebSearchToolParamSearchContextSizeMedium OpenaiAPIWebSearchToolParamSearchContextSize = "medium" + +type OpenaiAPIWebSearchToolParamType string + +const OpenaiAPIWebSearchToolParamTypeWebSearchPreview OpenaiAPIWebSearchToolParamType = "web_search_preview" +const OpenaiAPIWebSearchToolParamTypeWebSearchPreview20250311 OpenaiAPIWebSearchToolParamType = "web_search_preview_2025_03_11" + +// The user's location. +// +// The property Type is required. +type OpenaiAPIWebSearchToolUserLocationParam struct { + // Free text input for the city of the user, e.g. `San Francisco`. + // + City *string `json:"city,omitempty,omitzero"` + + // The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of + // the user, e.g. `US`. + // + Country *string `json:"country,omitempty,omitzero"` + + // Free text input for the region of the user, e.g. `California`. + // + Region *string `json:"region,omitempty,omitzero"` + + // The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the + // user, e.g. `America/Los_Angeles`. + // + Timezone *string `json:"timezone,omitempty,omitzero"` + + // The type of location approximation. Always `approximate`. + // + // This field can be elided, and will marshal its zero value as "approximate". + // + Type interface{} `json:"type"` +} diff --git a/pkg/adapters/zz_generated_openai_cli.go b/pkg/adapters/zz_generated_openai_cli.go index ad8a1e03..70691f0e 100644 --- a/pkg/adapters/zz_generated_openai_cli.go +++ b/pkg/adapters/zz_generated_openai_cli.go @@ -22,6 +22,10 @@ type OpenAICLIOptions struct { // Codex TOML key-value overrides emitted on the command line. Config []string `json:"config,omitempty,omitzero"` + // Experimental access program requested for this turn with the OpenAI provider. + // Fork requires a prompt and review does not support this option. + CyberAccessProgram *OpenAICLIOptionsCyberAccessProgram `json:"cyberAccessProgram,omitempty,omitzero"` + // Whether Codex executes without approval prompts or sandbox isolation. DangerouslyBypassApprovalsAndSandbox *bool `json:"dangerouslyBypassApprovalsAndSandbox,omitempty,omitzero"` @@ -107,6 +111,12 @@ const OpenAICLIOptionsColorAlways OpenAICLIOptionsColor = "always" const OpenAICLIOptionsColorAuto OpenAICLIOptionsColor = "auto" const OpenAICLIOptionsColorNever OpenAICLIOptionsColor = "never" +type OpenAICLIOptionsCyberAccessProgram string + +const OpenAICLIOptionsCyberAccessProgramDaybreakBlue OpenAICLIOptionsCyberAccessProgram = "daybreak_blue" +const OpenAICLIOptionsCyberAccessProgramDaybreakRed OpenAICLIOptionsCyberAccessProgram = "daybreak_red" +const OpenAICLIOptionsCyberAccessProgramStandard OpenAICLIOptionsCyberAccessProgram = "standard" + type OpenAICLIOptionsSandbox string const OpenAICLIOptionsSandboxDangerFullAccess OpenAICLIOptionsSandbox = "danger-full-access" diff --git a/pkg/ai/access.go b/pkg/ai/access.go new file mode 100644 index 00000000..7c47625b --- /dev/null +++ b/pkg/ai/access.go @@ -0,0 +1,62 @@ +package ai + +import ( + "context" + + "github.com/flanksource/captain/pkg/api" + "github.com/flanksource/commons/logger" +) + +var accessLog = logger.GetLogger("ai") + +// accessProvider compiles the request's access intent for the runtime this +// candidate actually runs on. It wraps every candidate — the primary and each +// fallback — so a fallback in another family speaks its own dialect rather +// than the primary's. With no access intent the request passes through as is. +type accessProvider struct { + provider Provider +} + +func (p *accessProvider) GetModel() string { return p.provider.GetModel() } +func (p *accessProvider) GetRuntime() Runtime { return p.provider.GetRuntime() } +func (p *accessProvider) Unwrap() Provider { return p.provider } + +func (p *accessProvider) request(ctx context.Context, req Request) (Request, error) { + compiled, report, err := api.CompileAccess(p.GetRuntime(), req) + if err != nil { + return Request{}, err + } + for _, equivalence := range report.Equivalences { + LoggerFromContext(ctx, accessLog).Debugf("%s permissions.access read-only: %s", report.Runtime, equivalence) + } + return compiled, nil +} + +func (p *accessProvider) Execute(ctx context.Context, req Request) (*Response, error) { + req, err := p.request(ctx, req) + if err != nil { + return nil, err + } + return p.provider.Execute(ctx, req) +} + +type accessStreamingProvider struct { + *accessProvider + streamer StreamingProvider +} + +func (p *accessStreamingProvider) ExecuteStream(ctx context.Context, req Request) (<-chan Event, error) { + req, err := p.request(ctx, req) + if err != nil { + return nil, err + } + return p.streamer.ExecuteStream(ctx, req) +} + +func withAccess(provider Provider) Provider { + base := &accessProvider{provider: provider} + if streamer, ok := provider.(StreamingProvider); ok { + return &accessStreamingProvider{accessProvider: base, streamer: streamer} + } + return base +} diff --git a/pkg/ai/access_ginkgo_test.go b/pkg/ai/access_ginkgo_test.go new file mode 100644 index 00000000..aea68c16 --- /dev/null +++ b/pkg/ai/access_ginkgo_test.go @@ -0,0 +1,69 @@ +package ai + +import ( + "context" + "errors" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + + "github.com/flanksource/captain/pkg/api" +) + +type accessCaptureProvider struct { + runtime Runtime + err error + request Request +} + +func (p *accessCaptureProvider) Execute(_ context.Context, req Request) (*Response, error) { + p.request = req + return &Response{}, p.err +} + +func (p *accessCaptureProvider) GetModel() string { return "capture" } +func (p *accessCaptureProvider) GetRuntime() Runtime { return p.runtime } + +var _ = Describe("access decorator", func() { + It("compiles read-only for each fallback candidate in its own dialect", func() { + claude := &accessCaptureProvider{runtime: RuntimeOf(Anthropic, ModeAgent), err: errors.New("anthropic: 429 rate limit")} + codex := &accessCaptureProvider{runtime: RuntimeOf(OpenAI, ModeAgent)} + byName := map[string]Provider{"sonnet": withAccess(claude), "gpt": withAccess(codex)} + fallback := &fallbackProvider{ + candidates: []api.Model{{Name: "sonnet"}, {Name: "gpt"}}, + build: func(cfg Config) (Provider, error) { return byName[cfg.Model.Name], nil }, + built: make([]Provider, 2), + } + req := Request{Permissions: api.Permissions{Access: api.AccessReadOnly}} + + _, err := fallback.Execute(context.Background(), req) + + Expect(err).NotTo(HaveOccurred()) + Expect(claude.request.Permissions.Tools.DenyList()).To(ContainElements("Bash", "Edit", "Write", "Agent")) + Expect(claude.request.Sandbox).To(BeNil()) + Expect(codex.request.Permissions.Tools).To(BeEmpty()) + Expect(codex.request.Sandbox.Policy.Filesystem.Access).To(Equal(api.SandboxFilesystemReadOnly)) + Expect(codex.request.Permissions.Mode).To(Equal(api.PermissionBypass)) + Expect(req.Permissions.Tools).To(BeNil(), "the caller's request is never written through") + }) + + It("passes a request without access through unchanged", func() { + capture := &accessCaptureProvider{runtime: RuntimeOf(OpenAI, ModeCLI)} + req := Request{Permissions: api.Permissions{Mode: api.PermissionPlan, Tools: api.Tools{"Read": api.ToolPolicyAllow}}} + + _, err := withAccess(capture).Execute(context.Background(), req) + + Expect(err).NotTo(HaveOccurred()) + Expect(capture.request).To(Equal(req)) + }) + + It("refuses a candidate that cannot reach read-only before it runs", func() { + capture := &accessCaptureProvider{runtime: RuntimeOf(OpenAI, ModeAgent)} + req := Request{Permissions: api.Permissions{Access: api.AccessReadOnly}, Sandbox: &api.SandboxRef{Mode: api.SandboxOff}} + + _, err := withAccess(capture).Execute(context.Background(), req) + + Expect(err).To(MatchError(ContainSubstring(`sandbox mode "off" cannot confine the agent`))) + Expect(capture.request).To(Equal(Request{})) + }) +}) diff --git a/pkg/ai/adapters_test.go b/pkg/ai/adapters_test.go index dd2d9728..c801872c 100644 --- a/pkg/ai/adapters_test.go +++ b/pkg/ai/adapters_test.go @@ -201,12 +201,12 @@ func TestProbeAdaptersUsesRegistryModelsForClaudeCmuxRegardlessOfAPIKey(t *testi if len(adapters) != 1 || len(adapters[0].Models) == 0 { t.Fatalf("adapters = %+v, want one adapter with registry models", adapters) } - if !stringSliceContains(adapters[0].Models, "claude-fable-5-1") { + if !stringSliceContains(adapters[0].Models, "claude-fable-5-2") { t.Fatalf("models = %v, want preferred Fable model", adapters[0].Models) } var fable *ModelDef for i := range adapters[0].ModelDetails { - if adapters[0].ModelDetails[i].ID == "claude-fable-5-1" { + if adapters[0].ModelDetails[i].ID == "claude-fable-5-2" { fable = &adapters[0].ModelDetails[i] break } diff --git a/pkg/ai/agent/commit/commit.go b/pkg/ai/agent/commit/commit.go index ad833ab9..3a970ef5 100644 --- a/pkg/ai/agent/commit/commit.go +++ b/pkg/ai/agent/commit/commit.go @@ -9,12 +9,15 @@ // stall or fail on an LLM call, and a run that is interrupted or fails // verification still leaves its work behind. // -// Repo pre-commit hooks are bypassed (`--no-verify`): captain runs its own cheap -// gates per commit, and a full pre-commit pipeline belongs to the host, which -// supplies it via Hook.Do together with gates: full. +// Every commit is cut through the commons-db workspace pipeline (stage → hooks +// → gates → commit), so content the setup cloned from the source's gitignored +// files never enters a commit. Repo git hooks are bypassed: the pipeline's +// gates — the policy's configured ones plus any the host supplies — are the +// checks. package commit import ( + "errors" "fmt" "path/filepath" "strings" @@ -22,15 +25,16 @@ import ( "github.com/flanksource/captain/pkg/ai" "github.com/flanksource/captain/pkg/ai/agent" "github.com/flanksource/captain/pkg/api" + dbcontext "github.com/flanksource/commons-db/context" + "github.com/flanksource/commons-db/workspace" "github.com/flanksource/commons/logger" ) var fallbackLog = logger.GetLogger("commit") -// Plan is one resolved commit, handed to Hook.Do so a host can cut it with its -// own pipeline. It is the policy after every default and lookup is applied — -// the phase, the exact paths, the anchor to fix up — so a host never has to -// re-derive any of it. +// Plan is one resolved commit: the policy after every default and lookup is +// applied — the phase, the exact paths, the anchor to fix up — handed to a +// host's Message callback so it never has to re-derive any of it. type Plan struct { Dir string // working dir the commit is cut in Phase agent.Phase // boundary this commit is being cut at @@ -39,8 +43,11 @@ type Plan struct { Anchor string // resolved SHA to fix up onto; empty in commit/amend mode Stage api.CommitStage // how Paths were selected Paths []string // repo-relative paths to stage (never empty) - Gates api.CommitGates // how much checking the host should run - DryRun bool + // WORKAROUND(gavel-commit-compat): Hook.Do hosts read the policy's gates to pick their pipeline + // Correct fix: gavel supplies HostMessage/HostGates/HostHooks + a push wrapper; then delete this field + // Ref: discussed with user 2026-10-28 + Gates api.CommitGateSpecs // the policy's gates as declared, including the full directive + DryRun bool } // action names what this plan does, distinguishing the run's first commit from @@ -54,28 +61,38 @@ func (p Plan) action() string { } // Hook cuts commits for one api.Commit policy. The embedded policy is the whole -// configuration; the three callbacks are escape hatches that let an API caller -// override a single decision — the subject, the file selection, or the commit -// itself — without reimplementing phase dispatch. +// configuration; the callbacks and host extension points let an API caller +// override a single decision — the subject, the file selection, the message — +// or add checks to the pipeline, without reimplementing phase dispatch. type Hook struct { api.Commit - // MaxFileSize overrides the cheap gate's per-file ceiling (DefaultMaxFileSize). - MaxFileSize int64 - // Subject overrides the commit subject. Called once per run; the result is // reused for every commit so a chain shares one anchor subject. Subject func(*agent.HookContext) (string, error) // StagePaths overrides which repo-relative paths are committed, replacing // the Stage policy entirely. StagePaths func(*agent.HookContext) ([]string, error) - // Do replaces the built-in git implementation with the host's commit - // pipeline. It may cut several commits under messages of its own; it returns - // the last one's SHA (the anchor later fixups fold into), or "" when it - // committed nothing. The workspace record is read from git — every commit - // between the pre-cut HEAD and HEAD, with git's stored messages — not built - // from the return value, which must be among those commits. This is what - // gates: full requires, and how gavel reuses its own fixup machinery. + // HostMessage composes a real commit's message (never a fixup's, which borrows + // its anchor's) from the resolved plan, in place of plan.Subject — how a + // host generates messages of its own. + HostMessage func(*agent.HookContext, Plan) (string, error) + // HostGates run after the policy's configured Gates on every commit; the + // host resolves them (they may be gates it never registers by name). + HostGates []workspace.Gate + // HostHooks run before the gates on every commit and may rewrite the + // staged files (formatters, tidy); the pipeline restages after them. + HostHooks []workspace.Hook + + // WORKAROUND(gavel-commit-compat): gavel still cuts its own commits (AI messages, grouping, PR push) + // Correct fix: gavel supplies HostMessage/HostGates/HostHooks + a push wrapper; then delete Do + // Ref: discussed with user 2026-10-28 + // + // Do replaces the workspace commit with the host's pipeline. It receives the + // plan — Paths already free of excluded content — and may cut several + // commits; it returns the last one's SHA, or "" when it committed nothing. + // The record is read from git between the pre-cut HEAD and HEAD. A policy + // whose gates carry the full directive requires it. Do func(*agent.HookContext, Plan) (string, error) anchor string // SHA the chain fixes up onto, set by the run's first commit @@ -162,11 +179,17 @@ func (h *Hook) commit(hc *agent.HookContext, phase agent.Phase) error { if err != nil { return err } - paths, stageMode, err := h.resolvePaths(hc, dir) + ctx := dbcontext.NewContext(hc) + ws, err := workspace.Open(ctx, dir) + if err != nil { + return fmt.Errorf("commit: open workspace %s: %w", dir, err) + } + paths, stageMode, err := h.resolvePaths(ctx, hc, ws, dir) if err != nil || len(paths) == 0 { return err } - if err := CheckGates(dir, h.EffectiveGates(), h.MaxFileSize, paths); err != nil { + gates, err := h.gates() + if err != nil { return err } @@ -187,7 +210,7 @@ func (h *Hook) commit(hc *agent.HookContext, phase agent.Phase) error { Anchor: anchor, Stage: stageMode, Paths: paths, - Gates: h.EffectiveGates(), + Gates: h.Gates, DryRun: h.DryRun, } if h.DryRun { @@ -195,59 +218,68 @@ func (h *Hook) commit(hc *agent.HookContext, phase agent.Phase) error { plan.action(), phase, len(paths), strings.Join(paths, ", ")) return nil } - if h.Do == nil && h.EffectiveGates() == api.CommitGatesFull { - return fmt.Errorf("commit: gates: full runs the host's pre-commit pipeline, which captain does not have — supply Hook.Do or lower gates to cheap") - } - // Announced before the cut, not only after it: a host pipeline on gates: full - // runs lint and pre-commit hooks, which is long enough that silence reads as a - // hang. A turn that resolved no paths says nothing at all — silence there - // already means "nothing happened", and a line per read-only turn is noise. + // Announced before the cut, not only after it: host hooks and gates (lint, + // secret scanners) can run long enough that silence reads as a hang. A turn + // that resolved no paths says nothing at all — silence there already means + // "nothing happened", and a line per read-only turn is noise. hc.Notify("[post-%s] committing %d file(s)", phase, len(paths)) - pre, sha, err := h.cut(hc, plan) + pre, err := headSHA(plan.Dir) + if err != nil { + return err + } + sha, err := h.cut(ctx, hc, ws, plan, gates) return h.record(hc, plan, pre, sha, err) } -// cut delegates to the host's commit pipeline when one is supplied, else to the -// built-in git implementation. pre is HEAD before the cut ("" when unborn), the -// lower bound record reads what was committed from. -func (h *Hook) cut(hc *agent.HookContext, plan Plan) (pre, sha string, err error) { - if pre, err = headSHA(plan.Dir); err != nil { - return "", "", err - } - if h.Do != nil { - sha, err = h.Do(hc, plan) - } else { - sha, err = h.run(plan) +// gates resolves the policy's configured gates and appends the host's. +func (h *Hook) gates() ([]workspace.Gate, error) { + // WORKAROUND(gavel-commit-compat): the full directive names the host pipeline, not a gate + // Correct fix: gavel registers named gates; then drop the directive and this check + // Ref: discussed with user 2026-10-28 + if api.HasGate(h.Gates, api.FullPipelineGate) && h.Do == nil { + return nil, fmt.Errorf("commit: gates: full runs the host's pre-commit pipeline, which captain does not have — supply Hook.Do or list gates by name") + } + gates, err := workspace.ResolveGates(h.Gates.Resolvable()) + if err != nil { + return nil, fmt.Errorf("commit: gates: %w", err) } - return pre, sha, err + return append(gates, h.HostGates...), nil } -// run is the built-in git implementation of a Plan. -func (h *Hook) run(plan Plan) (string, error) { - if err := stage(plan.Dir, plan.Paths); err != nil { - return "", err +// cut commits the plan through the workspace pipeline and returns the new +// commit's SHA, or "" when nothing was left to stage (an earlier phase already +// committed the paths). +func (h *Hook) cut(ctx dbcontext.Context, hc *agent.HookContext, ws *workspace.Workspace, plan Plan, gates []workspace.Gate) (string, error) { + // WORKAROUND(gavel-commit-compat): delegate to the host pipeline while gavel still uses Do + // Correct fix: gavel supplies HostMessage/HostGates/HostHooks + a push wrapper; then delete this branch + // Ref: discussed with user 2026-10-28 + if h.Do != nil { + return h.Do(hc, plan) + } + opts := workspace.CommitOptions{Paths: plan.Paths, Hooks: h.HostHooks, Gates: gates} + switch { + case plan.Mode == api.CommitModeFixup && plan.Anchor != "": + opts.Mode, opts.Anchor = workspace.CommitFixup, plan.Anchor + case plan.Mode == api.CommitModeAmend && h.anchor != "": + opts.Mode = workspace.CommitAmend + default: // a plain commit, or the anchor of a fixup/amend chain + opts.Mode, opts.Message = workspace.CommitNew, plan.Subject + if h.HostMessage != nil { + message, err := h.HostMessage(hc, plan) + if err != nil { + return "", fmt.Errorf("commit: message: %w", err) + } + opts.Message = message + } + } + result, err := ws.Commit(ctx, opts) + if errors.Is(err, workspace.ErrNothingStaged) { + return "", nil } - staged, err := hasStaged(plan.Dir) if err != nil { return "", err } - if !staged { - return "", nil // the paths were already committed by an earlier phase - } - switch plan.Mode { - case api.CommitModeFixup: - if plan.Anchor != "" { - return commitFixup(plan.Dir, plan.Anchor) - } - return commitStaged(plan.Dir, plan.Subject) // the anchor itself - case api.CommitModeAmend: - if h.anchor != "" { - return commitAmend(plan.Dir) - } - return commitStaged(plan.Dir, plan.Subject) - default: - return commitStaged(plan.Dir, plan.Subject) - } + return result.SHA, nil } // shouldCommit applies the outcome gate. A per-turn policy never reaches the @@ -266,13 +298,15 @@ func (h *Hook) shouldCommit(hc *agent.HookContext) bool { // resolvePaths selects the files this commit picks up, and reports which staging // mode chose them. -func (h *Hook) resolvePaths(hc *agent.HookContext, dir string) ([]string, api.CommitStage, error) { +// Candidates are the workspace's Changes, so content the setup cloned from the +// source's gitignored files is never a candidate, in any mode. +func (h *Hook) resolvePaths(ctx dbcontext.Context, hc *agent.HookContext, ws *workspace.Workspace, dir string) ([]string, api.CommitStage, error) { mode := h.stageMode(hc) if h.StagePaths != nil { paths, err := h.StagePaths(hc) return paths, mode, err } - dirty, err := dirtyPaths(dir) + dirty, err := ws.Changes(ctx) if err != nil { return nil, mode, err } @@ -443,7 +477,7 @@ func (h *Hook) resolveAnchor(dir string, mode api.CommitMode) (string, error) { case "": return "", nil // this commit becomes the anchor case "auto": - return "", fmt.Errorf("commit: anchor: auto routes each file to the commit that last touched it, which captain's built-in committer does not implement — supply Hook.Do (gavel does), or name a ref") + return "", fmt.Errorf("commit: anchor: auto routes each file to the commit that last touched it, which captain does not implement — leave anchor empty or name a ref") default: sha, err := resolveRef(dir, h.Anchor) if err != nil { diff --git a/pkg/ai/agent/commit/commit_test.go b/pkg/ai/agent/commit/commit_test.go index 1652ebfd..81efc92a 100644 --- a/pkg/ai/agent/commit/commit_test.go +++ b/pkg/ai/agent/commit/commit_test.go @@ -7,6 +7,7 @@ import ( "github.com/flanksource/captain/pkg/ai/agent" "github.com/flanksource/captain/pkg/api" + "github.com/flanksource/commons-db/workspace" ) // turn simulates one loop iteration: the agent edits a file, then the runner @@ -186,10 +187,10 @@ func TestFailedTurnCommitIsReportedOnce(t *testing.T) { hc := isolated(dir) h := New(api.Commit{On: api.CommitOnTurn, Message: "fix: attempt"}) attempts := 0 - h.Do = func(*agent.HookContext, Plan) (string, error) { + h.HostGates = []workspace.Gate{testGate(func(workspace.Check) error { attempts++ - return "", fmt.Errorf("pre-commit gate rejected the change set") - } + return fmt.Errorf("pre-commit gate rejected the change set") + })} write(t, dir, "fix.go", "package main\n") changed(hc, "fix.go") diff --git a/pkg/ai/agent/commit/compat_test.go b/pkg/ai/agent/commit/compat_test.go new file mode 100644 index 00000000..d2726246 --- /dev/null +++ b/pkg/ai/agent/commit/compat_test.go @@ -0,0 +1,54 @@ +package commit + +import ( + "fmt" + "strings" + "testing" + + "github.com/flanksource/captain/pkg/ai/agent" + "github.com/flanksource/captain/pkg/api" +) + +// TestDoTakesOverTheCommit pins the interim gavel seam: Do receives the plan, +// including the policy's declared gates, cuts the commit itself, and the hook +// records what it cut from git. +func TestDoTakesOverTheCommit(t *testing.T) { + dir := newRepo(t) + hc := isolated(dir) + h := New(api.Commit{On: api.CommitOnAgent, Message: "feat: host", Gates: api.CommitGatesFull}) + + var got Plan + h.Do = func(_ *agent.HookContext, plan Plan) (string, error) { + got = plan + mustGit(t, plan.Dir, append([]string{"add", "--"}, plan.Paths...)...) + mustGit(t, plan.Dir, "commit", "-q", "-m", "feat: cut by the host") + return mustGit(t, plan.Dir, "rev-parse", "HEAD"), nil + } + + write(t, dir, "host.go", "package main\n") + if err := h.Post(hc, agent.PhaseAgent); err != nil { + t.Fatalf("agent phase: %v", err) + } + if fmt.Sprint(got.Paths) != "[host.go]" || !api.HasGate(got.Gates, api.FullPipelineGate) { + t.Errorf("plan = %+v, want host.go with the full directive", got) + } + if log := subjects(t, dir); fmt.Sprint(log) != fmt.Sprint([]string{"feat: cut by the host", "chore: seed"}) { + t.Errorf("subjects = %v, want the host's commit on top of the seed", log) + } +} + +// TestFullGatesWithoutDoFail: the full directive names a host pipeline captain +// does not have, so it must refuse rather than commit with no checks. +func TestFullGatesWithoutDoFail(t *testing.T) { + dir := newRepo(t) + hc := isolated(dir) + h := New(api.Commit{On: api.CommitOnAgent, Message: "feat: x", Gates: api.CommitGatesFull}) + + write(t, dir, "x.go", "package main\n") + if err := h.Post(hc, agent.PhaseAgent); err == nil || !strings.Contains(err.Error(), "gates: full") { + t.Fatalf("Post() = %v, want the gates: full error", err) + } + if commitCount(t, dir) != 1 { + t.Errorf("nothing should have been committed, subjects: %v", subjects(t, dir)) + } +} diff --git a/pkg/ai/agent/commit/excludes_ginkgo_test.go b/pkg/ai/agent/commit/excludes_ginkgo_test.go new file mode 100644 index 00000000..8bbfdcf7 --- /dev/null +++ b/pkg/ai/agent/commit/excludes_ginkgo_test.go @@ -0,0 +1,51 @@ +package commit + +import ( + "context" + "path/filepath" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + + "github.com/flanksource/captain/pkg/ai" + "github.com/flanksource/captain/pkg/ai/agent" + "github.com/flanksource/captain/pkg/ai/agent/setup" + "github.com/flanksource/captain/pkg/api" + "github.com/flanksource/commons-db/shell" +) + +// The source checkout ignores .npmrc, but the branch the worktree is cut from +// predates that rule: the setup clones .npmrc in and the worktree's own +// .gitignore does not hide it, so only the workspace's excludes keep it out. +var _ = Describe("worktree stage mode", func() { + It("never commits content cloned from the source's gitignored files", func() { + repo, err := filepath.Abs(newRepo(GinkgoT())) + Expect(err).NotTo(HaveOccurred()) + mustGit(GinkgoT(), repo, "branch", "old") + write(GinkgoT(), repo, ".gitignore", ".npmrc\n") + mustGit(GinkgoT(), repo, "add", ".gitignore") + mustGit(GinkgoT(), repo, "commit", "-m", "chore: ignore .npmrc") + write(GinkgoT(), repo, ".npmrc", "//registry.example.com/:_authToken=not-a-real-token\n") + + plugin := &setup.Plugin{BaseDir: GinkgoT().TempDir()} + hc := &agent.HookContext{ + Context: context.Background(), + Request: &ai.Request{Prompt: api.Prompt{User: testPrompt}, Setup: &shell.Setup{Checkout: &shell.Checkout{ + Mode: shell.CheckoutLocal, Path: repo, + Worktree: &shell.Worktree{Mode: shell.WorktreeNew, Base: "old", Uncommitted: shell.CloneSkip, Ignored: shell.CloneClone}, + }}}, + Response: &ai.Response{Workspace: &api.Workspace{}}, + Hooks: []any{plugin}, + } + Expect(plugin.PreRun(hc)).To(Succeed()) + DeferCleanup(func() { _ = plugin.Post(hc, agent.PhaseRun) }) + wt := hc.Workspace().Cwd + Expect(filepath.Join(wt, ".npmrc")).To(BeARegularFile()) + write(GinkgoT(), wt, "agent.go", "package main\n") + + h := New(api.Commit{On: api.CommitOnRun, Stage: api.CommitStageWorktree, Message: "feat: agent work"}) + Expect(h.Post(hc, agent.PhaseRun)).To(Succeed()) + + Expect(mustGit(GinkgoT(), wt, "show", "--name-only", "--format=", "HEAD")).To(Equal("agent.go")) + }) +}) diff --git a/pkg/ai/agent/commit/gates.go b/pkg/ai/agent/commit/gates.go deleted file mode 100644 index a13457e8..00000000 --- a/pkg/ai/agent/commit/gates.go +++ /dev/null @@ -1,84 +0,0 @@ -package commit - -import ( - "fmt" - "os" - "path/filepath" - "strings" - - "github.com/flanksource/captain/pkg/api" -) - -// DefaultMaxFileSize is the cheap gate's per-file ceiling. An agent that writes -// something this large has almost always produced a binary, a build artifact or -// a log rather than source, and a per-turn chain would carry every revision of -// it forever. -const DefaultMaxFileSize = 1 << 20 // 1 MiB - -// secretBaseNames are file names that carry credentials often enough that -// committing one unattended is never the intended outcome. -var secretBaseNames = map[string]bool{ - ".env": true, - ".netrc": true, - ".npmrc": true, - ".pypirc": true, - "credentials.json": true, - "id_rsa": true, - "id_ed25519": true, - "service-account.json": true, -} - -// secretSuffixes are extensions whose contents are keys by definition. -var secretSuffixes = []string{".pem", ".key", ".p12", ".pfx", ".keystore"} - -// CheckGates applies the policy's pre-commit checks to the paths about to be -// staged. It rejects rather than filters: dropping a file would produce a commit -// that silently disagrees with the run's diff. -func CheckGates(dir string, level api.CommitGates, maxSize int64, paths []string) error { - if level != api.CommitGatesCheap { - return nil - } - if maxSize <= 0 { - maxSize = DefaultMaxFileSize - } - var secrets, oversized []string - for _, p := range paths { - if LooksSecret(p) { - secrets = append(secrets, p) - continue - } - info, err := os.Stat(filepath.Join(dir, p)) - if err != nil { - // A staged deletion has no file on disk; that is not a gate failure. - continue - } - if info.Size() > maxSize { - oversized = append(oversized, fmt.Sprintf("%s (%d bytes)", p, info.Size())) - } - } - if len(secrets) > 0 { - return fmt.Errorf("commit: refusing to commit files that look like credentials: %s — gitignore them, or set gates: none to commit them deliberately", strings.Join(secrets, ", ")) - } - if len(oversized) > 0 { - return fmt.Errorf("commit: refusing to commit files over %d bytes: %s — gitignore them, or set gates: none", maxSize, strings.Join(oversized, ", ")) - } - return nil -} - -// LooksSecret reports whether a repo-relative path names a credential file, by -// base name (including the .env.production family) or by extension. -func LooksSecret(path string) bool { - base := strings.ToLower(filepath.Base(path)) - if secretBaseNames[base] { - return true - } - if strings.HasPrefix(base, ".env.") && !strings.HasSuffix(base, ".example") && !strings.HasSuffix(base, ".sample") { - return true - } - for _, suffix := range secretSuffixes { - if strings.HasSuffix(base, suffix) { - return true - } - } - return false -} diff --git a/pkg/ai/agent/commit/git.go b/pkg/ai/agent/commit/git.go index c7068c91..df9b49c7 100644 --- a/pkg/ai/agent/commit/git.go +++ b/pkg/ai/agent/commit/git.go @@ -2,7 +2,6 @@ package commit import ( "fmt" - "os" "path/filepath" "strings" @@ -52,49 +51,6 @@ func canonicalDir(dir string) string { return resolved } -// dirtyPaths lists every repo-relative path with uncommitted work in dir, in -// git's own order. Ignored files are absent — `git status` excludes them — which -// is what keeps build artifacts out of the chain regardless of gate level. -// -// The -z porcelain format is used rather than the human one because it emits -// paths verbatim: the default format quotes and escapes any path with a space or -// a non-ASCII byte, which a line-based parse then has to unescape by hand. -func dirtyPaths(dir string) ([]string, error) { - res := exec.NewExec("git", "status", "--porcelain", "-z", "--untracked-files=all").WithCwd(dir).Run().Result() - if res.Error != nil { - return nil, fmt.Errorf("git status: %w: %s", res.Error, strings.TrimSpace(res.Stderr)) - } - if res.ExitCode != 0 { - return nil, fmt.Errorf("git status: exit %d: %s", res.ExitCode, strings.TrimSpace(res.Stderr)) - } - return parseStatusZ(res.Stdout), nil -} - -// parseStatusZ splits `git status --porcelain -z` output into paths. Each record -// is "XY ", and a rename/copy is followed by a second record holding the -// source path — which is why this cannot be a plain split. -func parseStatusZ(out string) []string { - fields := strings.Split(out, "\x00") - var paths []string - for i := 0; i < len(fields); i++ { - record := fields[i] - if len(record) < 4 { - continue - } - x, y := record[0], record[1] - paths = append(paths, record[3:]) - if x == 'R' || x == 'C' || y == 'R' || y == 'C' { - // The next field is the rename source; it also needs staging so the - // commit records a rename rather than an unexplained addition. - if i+1 < len(fields) && fields[i+1] != "" { - i++ - paths = append(paths, fields[i]) - } - } - } - return paths -} - // ignoredPaths returns the subset of relPaths git ignores in dir, asking git // itself rather than reimplementing its pattern language — so .gitignore files at // any depth, .git/info/exclude and core.excludesFile are all honoured, and a @@ -105,13 +61,13 @@ func parseStatusZ(out string) []string { // paths are ignored by one of your .gitignore files ... use -f"), tracked or not, // so a force-added build bundle the agent rebuilt is dirty in `git status` yet // impossible to stage. Without the flag it would be treated as attributable and -// the whole run would die inside stage() rather than committing what it could. +// the whole run would die staging it rather than committing what it could. // // Every path must be inside dir: git fails the whole invocation with exit 128 on // an out-of-tree path, so callers filter those out first. // -// The -z --stdin form is used for the same reason as in dirtyPaths — paths with -// spaces round-trip verbatim instead of arriving quoted and escaped. +// The -z --stdin form is used so paths with spaces round-trip verbatim instead +// of arriving quoted and escaped. func ignoredPaths(dir string, relPaths []string) (map[string]struct{}, error) { ignored := make(map[string]struct{}, len(relPaths)) if len(relPaths) == 0 { @@ -141,96 +97,6 @@ func ignoredPaths(dir string, relPaths []string) (map[string]struct{}, error) { return ignored, nil } -// stage adds exactly the named paths. The pathspecs are what bound the commit — -// unlike a bare `git add --all` this cannot pick up a file the policy did not -// select. -// -// Deleted files are why this is not a single call: `git add` refuses a pathspec -// that matches nothing on disk, so a path the agent removed has to be staged -// through its index entry with --all. A path that is in neither place was -// already staged as a deletion (the agent ran `git rm` itself) and needs no -// action — adding it would only fail on the missing file. -func stage(dir string, paths []string) error { - var present, missing []string - for _, p := range paths { - if _, err := os.Stat(filepath.Join(dir, p)); err == nil { - present = append(present, p) - } else { - missing = append(missing, p) - } - } - if len(present) > 0 { - if _, err := git(dir, append([]string{"add", "--"}, present...)...); err != nil { - return err - } - } - if len(missing) == 0 { - return nil - } - tracked, err := trackedSubset(dir, missing) - if err != nil || len(tracked) == 0 { - return err - } - _, err = git(dir, append([]string{"add", "--all", "--"}, tracked...)...) - return err -} - -// trackedSubset returns the paths git still holds an index entry for. A path -// whose deletion is already staged has none, which is how stage tells "delete -// this" apart from "already deleted". -func trackedSubset(dir string, paths []string) ([]string, error) { - out, err := git(dir, append([]string{"ls-files", "--"}, paths...)...) - if err != nil || out == "" { - return nil, err - } - return strings.Split(out, "\n"), nil -} - -// hasStaged reports whether the index holds anything to commit. `git diff -// --cached --quiet` exits 1 when it does, so the exit code is inspected before -// res.Error — clicky reports every non-zero exit as an error, and here 1 is the -// answer rather than a failure. -func hasStaged(dir string) (bool, error) { - res := exec.NewExec("git", "diff", "--cached", "--quiet").WithCwd(dir).Run().Result() - switch res.ExitCode { - case 0: - return false, nil - case 1: - return true, nil - } - if res.Error != nil { - return false, fmt.Errorf("git diff --cached: %w: %s", res.Error, strings.TrimSpace(res.Stderr)) - } - return false, fmt.Errorf("git diff --cached: exit %d: %s", res.ExitCode, strings.TrimSpace(res.Stderr)) -} - -// commitStaged commits the index with subject and returns the new SHA. -func commitStaged(dir, subject string) (string, error) { - if _, err := git(dir, "commit", "--no-verify", "-m", subject); err != nil { - return "", err - } - return git(dir, "rev-parse", "HEAD") -} - -// commitFixup commits the index as a `fixup!` of anchor, so the chain collapses -// back onto it at autosquash time. No message is composed — that is the point: -// a fixup borrows the anchor's subject, so committing a turn never waits on (or -// fails because of) a model call. -func commitFixup(dir, anchor string) (string, error) { - if _, err := git(dir, "commit", "--no-verify", "--fixup="+anchor); err != nil { - return "", err - } - return git(dir, "rev-parse", "HEAD") -} - -// commitAmend folds the index into HEAD, keeping its message. -func commitAmend(dir string) (string, error) { - if _, err := git(dir, "commit", "--no-verify", "--amend", "--no-edit"); err != nil { - return "", err - } - return git(dir, "rev-parse", "HEAD") -} - // headSHA returns the commit HEAD names, or "" when HEAD is unborn (a repo with // no commits yet). `rev-parse --verify --quiet` exits 1 silently for exactly // that case, so the code is read before res.Error — clicky reports every diff --git a/pkg/ai/agent/commit/helper_test.go b/pkg/ai/agent/commit/helper_test.go index 49d7a400..26e32c53 100644 --- a/pkg/ai/agent/commit/helper_test.go +++ b/pkg/ai/agent/commit/helper_test.go @@ -11,6 +11,8 @@ import ( "github.com/flanksource/captain/pkg/ai/agent" "github.com/flanksource/captain/pkg/api" "github.com/flanksource/clicky/exec" + dbcontext "github.com/flanksource/commons-db/context" + "github.com/flanksource/commons-db/workspace" ) const testPrompt = "add a greeting helper" @@ -130,6 +132,24 @@ func newContext(dir, branch string) *agent.HookContext { } } +// testGate is a host gate deciding from the check alone. +type testGate func(workspace.Check) error + +func (testGate) Name() string { return "test" } + +func (g testGate) Check(_ dbcontext.Context, _ *workspace.Workspace, c workspace.Check) error { + return g(c) +} + +// testHook is a host hook rewriting files from the commit's paths. +type testHook func(*workspace.Workspace, []string) error + +func (testHook) Name() string { return "test" } + +func (h testHook) Run(_ dbcontext.Context, ws *workspace.Workspace, paths []string) error { + return h(ws, paths) +} + // changed records paths as agent-modified, the way Runner.recordEvent does from // the agent's Edit/Write tool calls. func changed(hc *agent.HookContext, paths ...string) { @@ -195,5 +215,20 @@ func TestMain(m *testing.M) { os.Stderr.WriteString("commit: git is required for this package's tests\n") os.Exit(1) } - os.Exit(m.Run()) + // The developer's global git config (excludes such as .env, signing, hooks) + // must not change what the test repos report. + xdg, err := os.MkdirTemp("", "commit-test-xdg-") + if err != nil { + os.Stderr.WriteString("commit: " + err.Error() + "\n") + os.Exit(1) + } + for key, value := range map[string]string{"GIT_CONFIG_GLOBAL": os.DevNull, "GIT_CONFIG_NOSYSTEM": "1", "XDG_CONFIG_HOME": xdg} { + if err := os.Setenv(key, value); err != nil { + os.Stderr.WriteString("commit: " + err.Error() + "\n") + os.Exit(1) + } + } + code := m.Run() + _ = os.RemoveAll(xdg) + os.Exit(code) } diff --git a/pkg/ai/agent/commit/record_ginkgo_test.go b/pkg/ai/agent/commit/record_ginkgo_test.go index 2ee7d4fa..299cad40 100644 --- a/pkg/ai/agent/commit/record_ginkgo_test.go +++ b/pkg/ai/agent/commit/record_ginkgo_test.go @@ -1,8 +1,6 @@ package commit import ( - "fmt" - . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" @@ -20,14 +18,6 @@ var _ = Describe("the workspace commit record", func() { hc = isolated(dir) }) - // hostCommit is a host pipeline cutting one commit under its own message — - // the way gavel's commit pipeline does, ignoring Plan.Subject. - hostCommit := func(repo, rel, message string) string { - write(GinkgoT(), repo, rel, "package main\n") - mustGit(GinkgoT(), repo, "add", "--", rel) - mustGit(GinkgoT(), repo, "commit", "--no-verify", "-m", message) - return mustGit(GinkgoT(), repo, "rev-parse", "HEAD") - } headRecord := func(repo, message string) api.CommitRecord { return api.CommitRecord{SHA: mustGit(GinkgoT(), repo, "rev-parse", "HEAD"), Message: message} } @@ -37,24 +27,6 @@ var _ = Describe("the workspace commit record", func() { Expect(h.Post(hc, agent.PhaseTurn)).To(Succeed()) } - It("records every commit a host Do cuts, in order, with the messages git holds", func() { - messages := []string{"feat: one", "fix: two\n\nwith a body"} - var want []api.CommitRecord - h := New(api.Commit{On: api.CommitOnAgent, Message: "feat: captain subject"}) - h.Do = func(_ *agent.HookContext, plan Plan) (string, error) { - for i, message := range messages { - sha := hostCommit(plan.Dir, fmt.Sprintf("host-%d.go", i), message) - want = append(want, api.CommitRecord{SHA: sha, Message: message}) - } - // A host may hand back an abbreviated hash for the anchor. - return want[len(want)-1].SHA[:7], nil - } - write(GinkgoT(), dir, "agent.go", "package main\n") - - Expect(h.Post(hc, agent.PhaseAgent)).To(Succeed()) - Expect(hc.Workspace().Commits).To(Equal(want)) - }) - It("records the built-in committer's commit with the message git stored, not the policy text", func() { // A YAML block scalar leaves a trailing newline git's cleanup strips. h := New(api.Commit{On: api.CommitOnAgent, Message: "feat: built in\n"}) @@ -74,36 +46,6 @@ var _ = Describe("the workspace commit record", func() { Expect(rootHC.Workspace().Commits).To(Equal([]api.CommitRecord{headRecord(root, "feat: first")})) }) - It("fails naming the SHA and range when Do returns a SHA it did not cut", func() { - const stray = "0123456789abcdef0123456789abcdef01234567" - seed := mustGit(GinkgoT(), dir, "rev-parse", "HEAD") - h := New(api.Commit{On: api.CommitOnAgent, Message: "feat: hosted"}) - h.Do = func(_ *agent.HookContext, plan Plan) (string, error) { - hostCommit(plan.Dir, "host.go", "feat: hosted") - return stray, nil - } - write(GinkgoT(), dir, "agent.go", "package main\n") - - err := h.Post(hc, agent.PhaseAgent) - Expect(err).To(MatchError(And(ContainSubstring(stray), ContainSubstring(seed+"..HEAD")))) - Expect(hc.Workspace().Commits).To(BeEmpty()) - }) - - It("fails when Do commits but reports no SHA, instead of recording nothing", func() { - seed := mustGit(GinkgoT(), dir, "rev-parse", "HEAD") - h := New(api.Commit{On: api.CommitOnAgent, Message: "feat: hosted"}) - var cut string - h.Do = func(_ *agent.HookContext, plan Plan) (string, error) { - cut = hostCommit(plan.Dir, "host.go", "feat: hosted") - return "", nil - } - write(GinkgoT(), dir, "agent.go", "package main\n") - - err := h.Post(hc, agent.PhaseAgent) - Expect(err).To(MatchError(And(ContainSubstring("reported no commit"), ContainSubstring(seed), ContainSubstring(cut)))) - Expect(hc.Workspace().Commits).To(BeEmpty()) - }) - It("rewrites the record to the squashed commit once a per-turn chain collapses, keeping other entries", func() { other := api.CommitRecord{SHA: "feedfacefeedfacefeedfacefeedfacefeedface", Message: "chore: another hook"} hc.Workspace().AddCommit(other.SHA, other.Message) diff --git a/pkg/ai/agent/commit/setup_worktree_test.go b/pkg/ai/agent/commit/setup_worktree_test.go index 9a1d7434..90389989 100644 --- a/pkg/ai/agent/commit/setup_worktree_test.go +++ b/pkg/ai/agent/commit/setup_worktree_test.go @@ -38,9 +38,9 @@ func TestSetupWorktreeCommitsShellEdits(t *testing.T) { var stage api.CommitStage h := New(api.Commit{On: api.CommitOnRun, Message: "feat: via shell"}) - h.Do = func(_ *agent.HookContext, plan Plan) (string, error) { + h.HostMessage = func(_ *agent.HookContext, plan Plan) (string, error) { stage = plan.Stage - return h.run(plan) + return plan.Subject, nil } wt := hc.Workspace().Cwd write(t, wt, "via-shell.go", "package main\n") diff --git a/pkg/ai/agent/commit/stage_test.go b/pkg/ai/agent/commit/stage_test.go index e19a0297..e765d98b 100644 --- a/pkg/ai/agent/commit/stage_test.go +++ b/pkg/ai/agent/commit/stage_test.go @@ -1,6 +1,7 @@ package commit import ( + "errors" "fmt" "os" "path/filepath" @@ -9,6 +10,7 @@ import ( "github.com/flanksource/captain/pkg/ai/agent" "github.com/flanksource/captain/pkg/api" + "github.com/flanksource/commons-db/workspace" ) // TestSharedTreeCommitsOnlyAgentFiles is the isolation invariant: a run that @@ -200,12 +202,12 @@ func TestRefusalNamesOnlyCommittableRecordedEdits(t *testing.T) { // TestTrackedButIgnoredEditsAreSkippedNotFatal covers the awkward middle case a // force-added build bundle creates: it is tracked, so `git status` reports it // dirty, but `git add` still refuses it for matching an ignore rule. Attributing -// it therefore does not produce a commit — it kills the run inside stage(). It is +// it therefore does not produce a commit — it kills the run while staging. It is // dropped instead, and a sibling edit in the same turn still gets committed. func TestTrackedButIgnoredEditsAreSkippedNotFatal(t *testing.T) { dir := newRepo(t) hc := shared(dir) - h := New(api.Commit{On: api.CommitOnAgent, Gates: api.CommitGatesNone, Message: "feat: rebuild"}) + h := New(api.Commit{On: api.CommitOnAgent, Message: "feat: rebuild"}) write(t, dir, ".gitignore", "dist/\n") write(t, dir, "dist/bundle.js", "// v1\n") @@ -236,7 +238,7 @@ func TestTrackedButIgnoredEditsAreSkippedNotFatal(t *testing.T) { func TestOnlyTrackedIgnoredEditIsANoOp(t *testing.T) { dir := newRepo(t) hc := shared(dir) - h := New(api.Commit{On: api.CommitOnAgent, Gates: api.CommitGatesNone, Message: "chore: rebuild"}) + h := New(api.Commit{On: api.CommitOnAgent, Message: "chore: rebuild"}) write(t, dir, ".gitignore", "dist/\n") write(t, dir, "dist/bundle.js", "// v1\n") @@ -333,28 +335,31 @@ func TestDeletionsAreCommitted(t *testing.T) { } } -func TestCheapGatesRejectDangerousFiles(t *testing.T) { +// TestConfiguredGatesRejectDangerousFiles: the policy's gate specs resolve +// through the workspace registry and refuse before anything is committed. +func TestConfiguredGatesRejectDangerousFiles(t *testing.T) { + const maxBytes = 1 << 10 + gates := []workspace.GateSpec{ + {Name: workspace.SecretNamesGateName}, + {Name: workspace.MaxSizeGateName, Config: map[string]any{"bytes": maxBytes}}, + } cases := []struct { - name string - path string - body string - wantErr string + name, path, body, wantGate string }{ - {name: "dotenv", path: ".env", body: "TOKEN=hunter2\n", wantErr: "credentials"}, - {name: "environment-specific dotenv", path: ".env.production", body: "TOKEN=hunter2\n", wantErr: "credentials"}, - {name: "private key", path: "certs/server.pem", body: "-----BEGIN PRIVATE KEY-----\n", wantErr: "credentials"}, - {name: "oversized artifact", path: "dist/bundle.js", body: strings.Repeat("x", DefaultMaxFileSize+1), wantErr: "over"}, + {name: "dotenv", path: ".env", body: "TOKEN=hunter2\n", wantGate: workspace.SecretNamesGateName}, + {name: "private key", path: "certs/server.pem", body: "-----BEGIN PRIVATE KEY-----\n", wantGate: workspace.SecretNamesGateName}, + {name: "oversized artifact", path: "dist/bundle.js", body: strings.Repeat("x", maxBytes+1), wantGate: workspace.MaxSizeGateName}, } for _, tc := range cases { t.Run(tc.name, func(t *testing.T) { dir := newRepo(t) hc := isolated(dir) - h := New(api.Commit{On: api.CommitOnAgent, Message: "feat: oops"}) + h := New(api.Commit{On: api.CommitOnAgent, Message: "feat: oops", Gates: gates}) write(t, dir, tc.path, tc.body) - err := h.Post(hc, agent.PhaseAgent) - if err == nil || !strings.Contains(err.Error(), tc.wantErr) { - t.Fatalf("Post() = %v, want an error containing %q", err, tc.wantErr) + var gateErr *workspace.GateError + if err := h.Post(hc, agent.PhaseAgent); !errors.As(err, &gateErr) || gateErr.Gate != tc.wantGate { + t.Fatalf("Post() = %v, want the %s gate to refuse %s", err, tc.wantGate, tc.path) } if commitCount(t, dir) != 1 { t.Errorf("nothing should have been committed, subjects: %v", subjects(t, dir)) @@ -363,33 +368,35 @@ func TestCheapGatesRejectDangerousFiles(t *testing.T) { } } -// TestExampleDotenvIsNotTreatedAsSecret: .env.example is documentation and is -// meant to be committed; a gate that blocks it would be unusable. -func TestExampleDotenvIsNotTreatedAsSecret(t *testing.T) { +// TestUnconfiguredGatesCommitASecretNamedFile: no gate runs unless the policy +// lists it, so a deliberate .env commit needs no opt-out. +func TestUnconfiguredGatesCommitASecretNamedFile(t *testing.T) { dir := newRepo(t) hc := isolated(dir) - h := New(api.Commit{On: api.CommitOnAgent, Message: "docs: add env example"}) + h := New(api.Commit{On: api.CommitOnAgent, Message: "chore: deliberate"}) - write(t, dir, ".env.example", "TOKEN=\n") + write(t, dir, ".env", "TOKEN=hunter2\n") if err := h.Post(hc, agent.PhaseAgent); err != nil { - t.Fatalf("agent phase: %v", err) + t.Fatalf("agent phase with no gates: %v", err) } - if !contains(filesInHead(t, dir, "HEAD"), ".env.example") { - t.Errorf("commit should contain .env.example, got %v", filesInHead(t, dir, "HEAD")) + if !contains(filesInHead(t, dir, "HEAD"), ".env") { + t.Errorf("an ungated policy should commit it, got %v", filesInHead(t, dir, "HEAD")) } } -func TestGatesNoneCommitsWhatCheapWouldRefuse(t *testing.T) { +// TestUnknownGateFailsTheCommit: a misspelled gate must fail loudly rather than +// commit with fewer checks than the policy asked for. +func TestUnknownGateFailsTheCommit(t *testing.T) { dir := newRepo(t) hc := isolated(dir) - h := New(api.Commit{On: api.CommitOnAgent, Gates: api.CommitGatesNone, Message: "chore: deliberate"}) + h := New(api.Commit{On: api.CommitOnAgent, Message: "feat: x", Gates: []workspace.GateSpec{{Name: "secret-name"}}}) - write(t, dir, ".env", "TOKEN=hunter2\n") - if err := h.Post(hc, agent.PhaseAgent); err != nil { - t.Fatalf("agent phase with gates: none: %v", err) + write(t, dir, "x.go", "package main\n") + if err := h.Post(hc, agent.PhaseAgent); err == nil || !strings.Contains(err.Error(), `unknown gate "secret-name"`) { + t.Fatalf("Post() = %v, want an unknown-gate error", err) } - if !contains(filesInHead(t, dir, "HEAD"), ".env") { - t.Errorf("gates: none should commit it deliberately, got %v", filesInHead(t, dir, "HEAD")) + if commitCount(t, dir) != 1 { + t.Errorf("nothing should have been committed, subjects: %v", subjects(t, dir)) } } @@ -398,7 +405,7 @@ func TestGatesNoneCommitsWhatCheapWouldRefuse(t *testing.T) { func TestIgnoredFilesAreNeverStaged(t *testing.T) { dir := newRepo(t) hc := isolated(dir) - h := New(api.Commit{On: api.CommitOnAgent, Gates: api.CommitGatesNone, Message: "feat: build"}) + h := New(api.Commit{On: api.CommitOnAgent, Message: "feat: build"}) write(t, dir, ".gitignore", "build/\n") write(t, dir, "build/out.bin", "artifact\n") @@ -412,33 +419,18 @@ func TestIgnoredFilesAreNeverStaged(t *testing.T) { } } -// TestFullGatesRequireAHostPipeline: captain has no pre-commit pipeline of its -// own, so asking for one without supplying it must fail rather than quietly -// commit with fewer checks than were requested. -func TestFullGatesRequireAHostPipeline(t *testing.T) { - dir := newRepo(t) - hc := isolated(dir) - h := New(api.Commit{On: api.CommitOnAgent, Gates: api.CommitGatesFull, Message: "feat: gated"}) - - write(t, dir, "x.go", "package main\n") - err := h.Post(hc, agent.PhaseAgent) - if err == nil || !strings.Contains(err.Error(), "Hook.Do") { - t.Fatalf("Post() = %v, want an error pointing at the host callback", err) - } -} - -// TestAnchorAutoRequiresAHostCallback: last-touch routing is gavel's, and +// TestAnchorAutoIsRefused: captain does not implement last-touch routing, and // pretending to honour it would put fixups on the wrong commits. It fails on the // very first turn rather than after committing work under the wrong policy. -func TestAnchorAutoRequiresAHostCallback(t *testing.T) { +func TestAnchorAutoIsRefused(t *testing.T) { dir := newRepo(t) hc := isolated(dir) h := New(api.Commit{On: api.CommitOnTurn, Anchor: "auto"}) write(t, dir, "x.go", "package main\n") err := h.Post(hc, agent.PhaseTurn) - if err == nil || !strings.Contains(err.Error(), "Hook.Do") { - t.Fatalf("Post() = %v, want an error pointing at the host callback", err) + if err == nil || !strings.Contains(err.Error(), "anchor: auto") { + t.Fatalf("Post() = %v, want an error refusing anchor: auto", err) } if commitCount(t, dir) != 1 { t.Errorf("nothing should have been committed, subjects: %v", subjects(t, dir)) @@ -461,21 +453,28 @@ func TestExplicitAnchorFixesUpOntoAnExistingCommit(t *testing.T) { } } -// TestDoCallbackReceivesAResolvedPlan pins the host seam: everything gavel needs -// is on the Plan, so it never re-derives paths, mode or anchor. -func TestDoCallbackReceivesAResolvedPlan(t *testing.T) { +// TestHostExtensionsShapeTheCommit pins the host seam gavel builds on: Message +// gets the resolved Plan, a host hook's rewrite is restaged and committed, and a +// host gate sees the final staged set. +func TestHostExtensionsShapeTheCommit(t *testing.T) { dir := newRepo(t) hc := isolated(dir) var got Plan - const hostMessage = "feat: cut by the host pipeline" - h := New(api.Commit{On: api.CommitOnAgent, Gates: api.CommitGatesFull, Message: "feat: hosted"}) - h.Do = func(_ *agent.HookContext, plan Plan) (string, error) { + var gated []string + const hostMessage, formatted = "feat: composed by the host", "package main // formatted\n" + h := New(api.Commit{On: api.CommitOnAgent, Message: "feat: hosted"}) + h.HostMessage = func(_ *agent.HookContext, plan Plan) (string, error) { got = plan - mustGit(t, plan.Dir, append([]string{"add", "--"}, plan.Paths...)...) - mustGit(t, plan.Dir, "commit", "--no-verify", "-m", hostMessage) - return mustGit(t, plan.Dir, "rev-parse", "HEAD"), nil + return hostMessage, nil } + h.HostHooks = []workspace.Hook{testHook(func(ws *workspace.Workspace, paths []string) error { + return os.WriteFile(filepath.Join(ws.Dir, paths[0]), []byte(formatted), 0o600) + })} + h.HostGates = []workspace.Gate{testGate(func(c workspace.Check) error { + gated = c.Paths + return nil + })} write(t, dir, "hosted.go", "package main\n") if err := h.Post(hc, agent.PhaseAgent); err != nil { @@ -484,22 +483,19 @@ func TestDoCallbackReceivesAResolvedPlan(t *testing.T) { // Dir is the resolved working-tree root, not whatever the caller passed: // Plan.Paths are repo-relative, so the host needs the base they hang off. - if got.Dir != canonicalDir(dir) || got.Phase != agent.PhaseAgent || got.Subject != "feat: hosted" { - t.Errorf("plan = %+v, want dir %s with phase/subject resolved", got, canonicalDir(dir)) + want := Plan{Dir: canonicalDir(dir), Phase: agent.PhaseAgent, Mode: api.CommitModeCommit, + Subject: "feat: hosted", Stage: api.CommitStageWorktree, Paths: []string{"hosted.go"}} + if fmt.Sprint(got) != fmt.Sprint(want) { + t.Errorf("plan = %+v, want %+v", got, want) } - if got.Gates != api.CommitGatesFull || got.Stage != api.CommitStageWorktree { - t.Errorf("plan policy = %+v, want gates full and worktree staging", got) + if fmt.Sprint(gated) != fmt.Sprint([]string{"hosted.go"}) { + t.Errorf("host gate saw %v, want [hosted.go]", gated) } - if fmt.Sprint(got.Paths) != fmt.Sprint([]string{"hosted.go"}) { - t.Errorf("plan paths = %v, want [hosted.go]", got.Paths) + if body := mustGit(t, dir, "show", "HEAD:hosted.go"); body+"\n" != formatted { + t.Errorf("committed %q, want the host hook's rewrite %q", body, formatted) } - // The host owns the commit: exactly its one commit lands, under its message. if log := subjects(t, dir); fmt.Sprint(log) != fmt.Sprint([]string{hostMessage, "chore: seed"}) { - t.Errorf("subjects = %v, want only the host's commit on top of the seed", log) - } - want := []api.CommitRecord{{SHA: mustGit(t, dir, "rev-parse", "HEAD"), Message: hostMessage}} - if fmt.Sprint(hc.Workspace().Commits) != fmt.Sprint(want) { - t.Errorf("workspace commits = %+v, want the host's commit %+v", hc.Workspace().Commits, want) + t.Errorf("subjects = %v, want the host's message on top of the seed", log) } } diff --git a/pkg/ai/agent/hook_context.go b/pkg/ai/agent/hook_context.go index d50cfdd5..e5fa88bd 100644 --- a/pkg/ai/agent/hook_context.go +++ b/pkg/ai/agent/hook_context.go @@ -6,6 +6,7 @@ import ( "time" "github.com/flanksource/captain/pkg/ai" + "github.com/flanksource/captain/pkg/ai/tracing" "github.com/flanksource/captain/pkg/api" ) @@ -65,6 +66,8 @@ type HookContext struct { // turns reaches the same renderers as what the model does during them. Set by // Runner.Run; nil in a hand-built context, which Notify tolerates. emit func(ai.Event) + // trace is the run's root span. Set by Runner.Run. + trace *tracing.Run } // Notify reports one thing this hook did, in the run's own voice. It reaches the diff --git a/pkg/ai/agent/runner.go b/pkg/ai/agent/runner.go index 0508804f..d65813e0 100644 --- a/pkg/ai/agent/runner.go +++ b/pkg/ai/agent/runner.go @@ -20,6 +20,7 @@ import ( "github.com/flanksource/captain/pkg/ai" "github.com/flanksource/captain/pkg/ai/history" "github.com/flanksource/captain/pkg/ai/observe" + "github.com/flanksource/captain/pkg/ai/tracing" "github.com/flanksource/captain/pkg/api" "github.com/flanksource/captain/pkg/claude" "github.com/flanksource/commons/logger" @@ -60,11 +61,36 @@ type Result[T any] struct { // Post hooks declaring it and always runs, including on the failure path. An // empty prompt body runs verify-only (no generation, and so no turn phase); no // Verify hooks runs generate-only. +// +// The whole run is one OpenTelemetry "invoke_agent" span, parent of every model +// call, tool call and query it makes. func (r *Runner[T]) Run(ctx context.Context) (Result[T], error) { - var zero Result[T] if err := r.Request.ValidateRunnable(); err != nil { - return zero, fmt.Errorf("agent: %w", err) + return Result[T]{}, fmt.Errorf("agent: %w", err) + } + scope := r.Scope + if scope == "" { + scope = ScopeAll } + ctx, trace := tracing.StartRun(ctx, tracing.RunOptions{ + Agent: r.Request.Prompt.Source, + Scope: string(scope), + MaxIterations: max(r.MaxIterations, 1), + BudgetCostUSD: r.Request.Budget.Cost, + }) + result, err := r.run(ctx, scope, trace) + outcome := tracing.RunResult{Verified: VerifyPassed(result.Verdicts)} + if result.Loop != nil { + outcome.Iterations = len(result.Loop.Iterations) + outcome.CostUSD = result.Loop.TotalCost + outcome.StopReason = result.Loop.StopReason + } + trace.End(outcome, err) + return result, err +} + +func (r *Runner[T]) run(ctx context.Context, scope Scope, trace *tracing.Run) (Result[T], error) { + var zero Result[T] // The spec's budget.timeout bounds the whole run, not one model call. Only // pkg/cli applied it before, so every caller driving the Runner directly // (gavel's `pr status --ai-fix`) ran unbounded and a wedged turn could hang @@ -78,10 +104,6 @@ func (r *Runner[T]) Run(ctx context.Context) (Result[T], error) { ctx, cancel = context.WithTimeout(ctx, timeout) defer cancel() } - scope := r.Scope - if scope == "" { - scope = ScopeAll - } resp := &ai.Response{Workspace: &api.Workspace{Repo: r.Repo, Cwd: r.Cwd}} hc := &HookContext{ Context: ctx, @@ -92,11 +114,13 @@ func (r *Runner[T]) Run(ctx context.Context) (Result[T], error) { Response: resp, Scope: scope, Hooks: r.Hooks, + trace: trace, } // Hook notices join the model's own events on one stream, attributed to the // iteration whose boundary the hook is standing on — hc.Iteration still names // the turn that just completed when PhaseTurn dispatches. hc.emit = func(ev ai.Event) { + trace.Observe(ev) if r.OnEvent != nil { r.OnEvent(hc.Iteration, ev) } @@ -276,6 +300,9 @@ func (r *Runner[T]) runLoop(ctx context.Context, hc *HookContext, result *Result }) result.Loop = loop if loopErr != nil { + if loop != nil && len(loop.Iterations) > 0 { + return errors.Join(loopErr, r.updateResponse(hc, loop.Iterations[len(loop.Iterations)-1])) + } return loopErr } if loop != nil && loop.StopReason == "max-cost" { @@ -341,31 +368,39 @@ func (r *Runner[T]) updateResponse(hc *HookContext, prev *ai.LoopIteration) erro ws.SessionID = prev.SessionID } var text strings.Builder + var rejected string + var terminal ai.TerminalOutcomeTracker for _, ev := range prev.Events { - outcome, err := ai.TerminalOutcomeFromEvent(ev) - if err != nil { + if err := terminal.Observe(ev); err != nil { return fmt.Errorf("agent: invalid terminal outcome: %w", err) } - if outcome != nil { - hc.Response.TerminalOutcome = outcome - } switch ev.Kind { case ai.EventText: - text.WriteString(ev.Text) + if ev.Rejected { + rejected = ev.Text + } else { + text.WriteString(ev.Text) + } case ai.EventResult: if len(ev.StructuredData) > 0 { hc.Response.StructuredData = ev.StructuredData } } } + hc.Response.TerminalOutcome = terminal.Outcome() hc.Response.Text = text.String() + if prev.Err != nil && rejected != "" { + hc.Response.Text = rejected + } hc.Response.Usage = prev.Usage + hc.Response.CostUSD = prev.CostUSD return nil } // recordEvent updates the workspace from one streamed event: session id and the // set of files the agent changed (repo-relative). func (r *Runner[T]) recordEvent(hc *HookContext, ev ai.Event) { + hc.trace.Observe(ev) var phase observe.ProviderPhase switch ev.Kind { case ai.EventTurnStart: diff --git a/pkg/ai/agent/runner_tracing_ginkgo_test.go b/pkg/ai/agent/runner_tracing_ginkgo_test.go new file mode 100644 index 00000000..f1cd2bd9 --- /dev/null +++ b/pkg/ai/agent/runner_tracing_ginkgo_test.go @@ -0,0 +1,126 @@ +package agent + +import ( + "context" + "errors" + + "github.com/flanksource/captain/pkg/ai" + "github.com/flanksource/captain/pkg/api" + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/codes" + sdktrace "go.opentelemetry.io/otel/sdk/trace" + "go.opentelemetry.io/otel/sdk/trace/tracetest" +) + +// spanningProvider opens a span from the context it is called with, standing in +// for the tracing middleware so the run span's propagation is observable. +type spanningProvider struct{ fakeProvider } + +func (p *spanningProvider) ExecuteStream(ctx context.Context, req ai.Request) (<-chan ai.Event, error) { + _, span := otel.Tracer("test").Start(ctx, "model call") + span.End() + return p.fakeProvider.ExecuteStream(ctx, req) +} + +// emittingVerifier reports its verdict on the run's stream, as verify hooks do. +type emittingVerifier struct{ valid bool } + +func (emittingVerifier) Name() string { return "fixture" } +func (v emittingVerifier) Verify(hc *HookContext) (VerifyResult, error) { + kind := ai.EventVerifyFailed + if v.valid { + kind = ai.EventVerified + } + hc.Emit(ai.Event{Kind: kind, Tool: "fixture", Text: "report"}) + return VerifyResult{Valid: v.valid}, nil +} + +type failingPreRun struct{} + +func (failingPreRun) Name() string { return "setup" } +func (failingPreRun) PreRun(*HookContext) error { return errors.New("checkout failed") } + +var _ = Describe("Runner tracing", func() { + const ( + source = "review" + sessionID = "session-1" + costUSD = 0.25 + budgetUSD = 2.0 + ) + var recorder *tracetest.SpanRecorder + + BeforeEach(func() { + recorder = tracetest.NewSpanRecorder() + DeferCleanup(otel.SetTracerProvider, otel.GetTracerProvider()) + otel.SetTracerProvider(sdktrace.NewTracerProvider(sdktrace.WithSpanProcessor(recorder))) + }) + + request := ai.Request{ + Prompt: api.Prompt{User: "go", Source: source}, + Budget: api.Budget{Cost: budgetUSD}, + } + + ended := func(name string) sdktrace.ReadOnlySpan { + for _, s := range recorder.Ended() { + if s.Name() == name { + return s + } + } + Fail("no ended span named " + name) + return nil + } + attrs := func(s sdktrace.ReadOnlySpan) map[string]any { + out := map[string]any{} + for _, kv := range s.Attributes() { + out[string(kv.Key)] = kv.Value.AsInterface() + } + return out + } + + It("wraps the run in an invoke_agent span parenting each model call", func() { + prov := &spanningProvider{fakeProvider{events: func(int) []ai.Event { + return []ai.Event{ + {Kind: ai.EventSystem, SessionID: sessionID}, + {Kind: ai.EventResult, Success: true, CostUSD: costUSD}, + } + }}} + r := &Runner[string]{Provider: prov, Request: request, Hooks: []any{emittingVerifier{valid: true}}} + _, err := r.Run(context.Background()) + Expect(err).NotTo(HaveOccurred()) + + run := ended("invoke_agent " + source) + Expect(ended("model call").Parent().SpanID()).To(Equal(run.SpanContext().SpanID())) + Expect(attrs(run)).To(Equal(map[string]any{ + "gen_ai.operation.name": "invoke_agent", + "gen_ai.agent.name": source, + "gen_ai.conversation.id": sessionID, + "captain.scope": string(ScopeAll), + "captain.max_iterations": int64(1), + "captain.budget.cost_usd": budgetUSD, + "captain.verified": true, + "captain.iterations": int64(1), + "captain.cost_usd": costUSD, + "captain.stop_reason": "condition-met", + })) + Expect(run.Status().Code).To(Equal(codes.Unset)) + Expect(run.Events()).To(HaveLen(1)) + verify := run.Events()[0] + Expect(verify.Name).To(Equal("captain.verify")) + Expect(verify.Attributes).To(ConsistOf( + HaveField("Key", BeEquivalentTo("captain.verify.name")), + HaveField("Key", BeEquivalentTo("captain.verify.valid")), + )) + }) + + It("marks the run span failed when a PreRun hook fails", func() { + r := &Runner[string]{Provider: &fakeProvider{}, Request: request, Hooks: []any{failingPreRun{}}} + _, err := r.Run(context.Background()) + Expect(err).To(MatchError(ContainSubstring("checkout failed"))) + + run := ended("invoke_agent " + source) + Expect([]any{run.Status().Code, attrs(run)["captain.verified"], attrs(run)["captain.iterations"]}). + To(Equal([]any{codes.Error, true, int64(0)})) + }) +}) diff --git a/pkg/ai/agent/schema_rejection_ginkgo_test.go b/pkg/ai/agent/schema_rejection_ginkgo_test.go new file mode 100644 index 00000000..80ce178e --- /dev/null +++ b/pkg/ai/agent/schema_rejection_ginkgo_test.go @@ -0,0 +1,28 @@ +package agent + +import ( + "context" + + "github.com/flanksource/captain/pkg/ai" + "github.com/flanksource/captain/pkg/api" + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +var _ = Describe("Runner schema rejection", func() { + It("retains the rejected answer and spend when generation fails", func() { + response := "# Findings\n\n- Define a baseline." + provider := &fakeProvider{events: func(int) []ai.Event { + return []ai.Event{ + {Kind: ai.EventText, Text: response, Rejected: true}, + {Kind: ai.EventError, Error: ai.ErrSchemaValidation.Error(), Usage: &ai.Usage{OutputTokens: 30}, CostUSD: 0.75}, + } + }} + runner := Runner[string]{Provider: provider, Request: ai.Request{Prompt: api.Prompt{User: "Review the report."}}} + result, err := runner.Run(context.Background()) + Expect(err).To(MatchError(ContainSubstring(ai.ErrSchemaValidation.Error()))) + Expect(result.Response.Text).To(Equal(response)) + Expect(result.Response.Usage.OutputTokens).To(Equal(30)) + Expect(result.Response.CostUSD).To(Equal(0.75)) + }) +}) diff --git a/pkg/ai/agent/setup/setup.go b/pkg/ai/agent/setup/setup.go index 55151be4..8c75a203 100644 --- a/pkg/ai/agent/setup/setup.go +++ b/pkg/ai/agent/setup/setup.go @@ -24,6 +24,7 @@ import ( "github.com/flanksource/captain/pkg/api" dbcontext "github.com/flanksource/commons-db/context" "github.com/flanksource/commons-db/shell" + "github.com/flanksource/commons-db/workspace" ) // Apply prepares req.Setup and rewrites req to describe the prepared state: @@ -179,6 +180,14 @@ func (p *Plugin) PreRun(hc *agent.HookContext) error { p.prepared = res hc.Workspace().Cwd = res.Cwd if !Relocates(checkout) { + inspected, err := InspectWorkspace(res.Cwd) + if err != nil { + return err + } + if inspected.Worktree != nil { + hc.Workspace().Worktree = inspected.Worktree + hc.Workspace().Repo = inspected.Worktree.Repo + } return nil } p.relocation = &relocation{kind: "checkout", path: res.Cwd} @@ -190,12 +199,24 @@ func (p *Plugin) PreRun(hc *agent.HookContext) error { p.relocation.kind = "worktree" p.relocation.keep, p.relocation.existing = wt.Keep, wt.Mode == shell.WorktreeExisting p.relocation.existingBranch = wt.Mode == shell.WorktreeBranch - // Only a worktree setup created holds a copy of the source's work-in-progress; - // an existing one's uncommitted state is its owner's, and never committed here. - state, err := recordWorktree(res.Cwd, wt.Mode == shell.WorktreeNew) + if res.Workspace == nil { + return fmt.Errorf("setup: worktree %s was prepared without a workspace", res.Cwd) + } + state, err := recordWorktree(res.Cwd) if err != nil { return err } + // Only a worktree setup created holds a copy of the source's work-in-progress; + // an existing one's uncommitted state is its owner's, and never committed here. + if wt.Mode == shell.WorktreeNew { + gates, err := workspace.ResolveGates(hc.Request.Workflow.CommitGates()) + if err != nil { + return fmt.Errorf("setup: commit gates: %w", err) + } + if err := snapshotSetup(dbcontext.NewContext(hc), res.Workspace, state, gates); err != nil { + return err + } + } // Worktree is how later hooks tell an isolated tree from the caller's own // checkout — the commit hook stages the whole tree only when it is set — so a // worktree that does not record one reads as shared. @@ -221,10 +242,10 @@ func (p *Plugin) Post(hc *agent.HookContext, _ agent.Phase) error { if p.prepared == nil { return nil } - cleanup, moved, wt := p.prepared.Cleanup, p.relocation, p.worktree + cleanup, ws, moved, wt := p.prepared.Cleanup, p.prepared.Workspace, p.relocation, p.worktree p.prepared, p.relocation, p.worktree = nil, nil, nil if wt != nil { - if err := teardownWorktree(wt, moved, cleanup); err != nil { + if err := teardownWorktree(dbcontext.NewContext(hc), ws, wt, moved, cleanup); err != nil { return err } hc.Notify("%s", teardownNotice(wt)) diff --git a/pkg/ai/agent/setup/setup_suite_test.go b/pkg/ai/agent/setup/setup_suite_test.go index 9a99b878..1456fbf1 100644 --- a/pkg/ai/agent/setup/setup_suite_test.go +++ b/pkg/ai/agent/setup/setup_suite_test.go @@ -1,13 +1,20 @@ package setup_test import ( + "os" "testing" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) +// The developer's global git config (excludes such as .env, signing, hooks) +// must not change what the specs' repos report, so every git call sees only +// the repo-local config the specs write. func TestSetupSuite(t *testing.T) { + t.Setenv("GIT_CONFIG_GLOBAL", os.DevNull) + t.Setenv("GIT_CONFIG_NOSYSTEM", "1") + t.Setenv("XDG_CONFIG_HOME", t.TempDir()) RegisterFailHandler(Fail) RunSpecs(t, "setup") } diff --git a/pkg/ai/agent/setup/workspace.go b/pkg/ai/agent/setup/workspace.go new file mode 100644 index 00000000..f11e178c --- /dev/null +++ b/pkg/ai/agent/setup/workspace.go @@ -0,0 +1,50 @@ +package setup + +import ( + "fmt" + "os" + "path/filepath" + + "github.com/flanksource/captain/pkg/api" +) + +// InspectWorkspace records an explicitly supplied directory and its linked worktree. +func InspectWorkspace(cwd string) (*api.WorkspaceRecord, error) { + if _, err := os.Stat(cwd); err != nil { + return nil, fmt.Errorf("inspect workspace %s: %w", cwd, err) + } + workspace := &api.WorkspaceRecord{Cwd: cwd} + path, err := filepath.Abs(cwd) + if err != nil { + return nil, err + } + for { + marker, err := os.Stat(filepath.Join(path, ".git")) + if err == nil { + if marker.IsDir() { + return workspace, nil + } + gitDir, err := git(path, "rev-parse", "--absolute-git-dir") + if err != nil { + return nil, err + } + commonDir, err := git(path, "rev-parse", "--path-format=absolute", "--git-common-dir") + if err != nil { + return nil, err + } + if gitDir == commonDir { + return workspace, nil + } + workspace.Worktree, err = recordWorktree(path) + return workspace, err + } + if !os.IsNotExist(err) { + return nil, fmt.Errorf("inspect workspace %s: %w", cwd, err) + } + parent := filepath.Dir(path) + if parent == path { + return workspace, nil + } + path = parent + } +} diff --git a/pkg/ai/agent/setup/workspace_ginkgo_test.go b/pkg/ai/agent/setup/workspace_ginkgo_test.go new file mode 100644 index 00000000..e9596045 --- /dev/null +++ b/pkg/ai/agent/setup/workspace_ginkgo_test.go @@ -0,0 +1,41 @@ +package setup_test + +import ( + "path/filepath" + + "github.com/flanksource/captain/pkg/ai" + "github.com/flanksource/captain/pkg/ai/agent" + "github.com/flanksource/captain/pkg/ai/agent/setup" + "github.com/flanksource/captain/pkg/api" + "github.com/flanksource/commons-db/shell" + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +var _ = Describe("specified workspaces", func() { + It("records a linked worktree supplied as the execution directory without owning its cleanup", func() { + repo := sourceRepo() + path := filepath.Join(GinkgoT().TempDir(), "specified") + gitIn(repo, "worktree", "add", "-b", "feature/specified", path) + DeferCleanup(func() { gitIn(repo, "worktree", "remove", "--force", path) }) + path, err := filepath.EvalSymlinks(path) + Expect(err).NotTo(HaveOccurred()) + base := gitIn(path, "rev-parse", "HEAD") + plugin := &setup.Plugin{} + hc := &agent.HookContext{Request: &ai.Request{Setup: &shell.Setup{Cwd: path}}, Response: &ai.Response{}} + Expect(plugin.PreRun(hc)).To(Succeed()) + Expect(hc.Workspace().Worktree).To(Equal(&api.WorktreeState{ + Repo: repo, Path: path, Branch: "feature/specified", Base: base, Setup: base, + })) + Expect(plugin.Post(hc, agent.PhaseRun)).To(Succeed()) + Expect(path).To(BeADirectory()) + }) + + It("does not mark a primary checkout or a non-Git directory as an isolated worktree", func() { + for _, path := range []string{sourceRepo(), GinkgoT().TempDir()} { + workspace, err := setup.InspectWorkspace(path) + Expect(err).NotTo(HaveOccurred()) + Expect(workspace).To(Equal(&api.WorkspaceRecord{Cwd: path})) + } + }) +}) diff --git a/pkg/ai/agent/setup/worktree_state.go b/pkg/ai/agent/setup/worktree_state.go index a38b9966..3d9b6c25 100644 --- a/pkg/ai/agent/setup/worktree_state.go +++ b/pkg/ai/agent/setup/worktree_state.go @@ -1,11 +1,14 @@ package setup import ( + "errors" "fmt" "strings" "github.com/flanksource/captain/pkg/api" "github.com/flanksource/clicky/exec" + dbcontext "github.com/flanksource/commons-db/context" + "github.com/flanksource/commons-db/workspace" ) // setupSnapshotMessage marks the commit that carries work-in-progress copied @@ -24,31 +27,21 @@ const ( // git runs `git ` in dir and returns its trimmed stdout, failing loud // with the command, directory and stderr on any non-zero exit. func git(dir string, args ...string) (string, error) { - out, err := gitRaw(dir, args...) - return strings.TrimSpace(out), err -} - -// gitRaw is git without the trim, for output whose leading whitespace or NUL -// separators carry meaning. -func gitRaw(dir string, args ...string) (string, error) { res := exec.NewExec("git", args...).WithCwd(dir).Run().Result() if res.Error != nil || res.ExitCode != 0 { return "", fmt.Errorf("setup: git %s in %s: exit %d: %v: %s", strings.Join(args, " "), dir, res.ExitCode, res.Error, strings.TrimSpace(res.Stderr)) } - return res.Stdout, nil + return strings.TrimSpace(res.Stdout), nil } -// recordWorktree reads the state of a freshly prepared worktree: its branch, the -// repository it was added to, and the commit it was branched from. With -// snapshot set, work-in-progress the setup copied in is committed as a setup -// snapshot, so the agent starts from a clean tree and its own work is exactly -// Setup..Head. +// recordWorktree reads the state of a prepared worktree: its branch, the +// repository it was added to, and the commit it was branched from. // // Base is read from the worktree itself: `git worktree add` leaves HEAD on the // start point it resolved — the configured base, the checkout ref, or the // source's HEAD — and the copy of uncommitted work commits nothing. -func recordWorktree(path string, snapshot bool) (*api.WorktreeState, error) { +func recordWorktree(path string) (*api.WorktreeState, error) { branch, repo, err := inspectWorktree(path) if err != nil { return nil, err @@ -57,29 +50,29 @@ func recordWorktree(path string, snapshot bool) (*api.WorktreeState, error) { if err != nil { return nil, err } - state := &api.WorktreeState{Repo: repo, Path: path, Branch: branch, Base: base, Setup: base} - if !snapshot { - return state, nil + return &api.WorktreeState{Repo: repo, Path: path, Branch: branch, Base: base, Setup: base}, nil +} + +// snapshotSetup commits the work-in-progress the setup copied into a new +// worktree as a setup snapshot, so the agent starts from a clean tree and its +// own work is exactly Setup..Head. It commits through the workspace, so content +// cloned from the source's gitignored files never enters the snapshot even when +// the worktree's branch does not ignore it, and the run's configured commit +// gates apply. Nothing to commit leaves Setup at Base. +func snapshotSetup(ctx dbcontext.Context, ws *workspace.Workspace, state *api.WorktreeState, gates []workspace.Gate) error { + result, err := ws.Commit(ctx, workspace.CommitOptions{ + Message: setupSnapshotMessage, + Trailers: []string{setupSnapshotTrailer}, + Gates: gates, + }) + if errors.Is(err, workspace.ErrNothingStaged) { + return nil } - dirty, err := statusPaths(path) if err != nil { - return nil, err - } - if len(dirty) == 0 { - return state, nil - } - // `add -A` honours .gitignore, so ignored content the setup copied in stays - // on disk and out of the snapshot. - if _, err := git(path, "add", "-A"); err != nil { - return nil, err - } - if _, err := git(path, "commit", "--no-verify", "-m", setupSnapshotMessage, "-m", setupSnapshotTrailer); err != nil { - return nil, err - } - if state.Setup, err = git(path, "rev-parse", "HEAD"); err != nil { - return nil, err + return fmt.Errorf("setup: snapshot uncommitted changes in %s: %w", ws.Dir, err) } - return state, nil + state.Setup = result.SHA + return nil } // inspectWorktree reads the branch a worktree has checked out and the repository @@ -87,9 +80,12 @@ func recordWorktree(path string, snapshot bool) (*api.WorktreeState, error) { // `git worktree list` — rather than the checkout's path, which a remote checkout // does not have. func inspectWorktree(dir string) (branch, repo string, err error) { - if branch, err = git(dir, "symbolic-ref", "--short", "HEAD"); err != nil { + if branch, err = git(dir, "rev-parse", "--abbrev-ref", "HEAD"); err != nil { return "", "", err } + if branch == "HEAD" { + branch = "" + } list, err := git(dir, "worktree", "list", "--porcelain") if err != nil { return "", "", err @@ -102,45 +98,21 @@ func inspectWorktree(dir string) (branch, repo string, err error) { return branch, repo, nil } -// statusPaths lists the paths git reports as uncommitted in dir — modified, -// staged, deleted and untracked, but never ignored. -func statusPaths(dir string) ([]string, error) { - out, err := gitRaw(dir, "status", "--porcelain=v1", "-z", "--untracked-files=all") - if err != nil { - return nil, err - } - var paths []string - records := strings.Split(out, "\x00") - for i := 0; i < len(records); i++ { - record := records[i] - if record == "" { - continue - } - if len(record) < 4 { - return nil, fmt.Errorf("setup: git status in %s: malformed record %q", dir, record) - } - paths = append(paths, record[3:]) - // A rename or copy is followed by its source path as a record of its own. - if record[0] == 'R' || record[0] == 'C' { - i++ - } - } - return paths, nil -} - // teardownWorktree decides the worktree's fate from its real git state. A dirty // tree is kept — commons-db's cleanup force-removes, which would discard the // agent's uncommitted edits — and so is one the run was told to keep (retain). +// Dirty is the workspace's Changes: content cloned from the source's gitignored +// files is not the agent's work, so it never keeps a worktree. // A clean tree is removed, and its branch deleted when it holds nothing past // Setup: the setup snapshot alone is not work worth a branch — unless the run // continued on a branch that already existed, which is never the run's to delete. -func teardownWorktree(wt *api.WorktreeState, moved *relocation, cleanup func() error) error { +func teardownWorktree(ctx dbcontext.Context, ws *workspace.Workspace, wt *api.WorktreeState, moved *relocation, cleanup func() error) error { retain := moved.retainReason() head, err := git(wt.Path, "rev-parse", "HEAD") if err != nil { return err } - dirty, err := statusPaths(wt.Path) + dirty, err := ws.Changes(ctx) if err != nil { return err } diff --git a/pkg/ai/agent/setup/worktree_state_ginkgo_test.go b/pkg/ai/agent/setup/worktree_state_ginkgo_test.go index b19a3bfd..ab94af21 100644 --- a/pkg/ai/agent/setup/worktree_state_ginkgo_test.go +++ b/pkg/ai/agent/setup/worktree_state_ginkgo_test.go @@ -146,6 +146,30 @@ var _ = Describe("the setup plugin's worktree state", func() { Expect(gitIn(repo, "status", "--porcelain")).NotTo(BeEmpty(), "the source checkout is never touched") }) + It("never snapshots content the source ignores but the worktree's base branch does not", func() { + gitIn(repo, "branch", "old") + writeFile(repo, ".gitignore", "cache/\n.npmrc\n") + gitIn(repo, "commit", "-q", "-am", "chore: ignore .npmrc") + writeFile(repo, ".npmrc", "//registry.example.com/:_authToken=not-a-real-token\n") + base := gitIn(repo, "rev-parse", "old") + plugin, hc := worktreeHook(repo) + hc.Request.Setup.Checkout.Worktree.Base = "old" + hc.Request.Setup.Checkout.Worktree.Uncommitted = shell.CloneSkip + + wt := preRun(plugin, hc, repo) + + Expect(filepath.Join(wt.Path, ".npmrc")).To(BeARegularFile(), "ignored content is still cloned in") + Expect(wt.Setup).To(Equal(base), "the cloned .npmrc is not work to snapshot") + Expect(gitIn(wt.Path, "log", "--name-only", "--format=", base+"..HEAD")).To(BeEmpty()) + + Expect(plugin.Post(hc, agent.PhaseRun)).To(Succeed()) + + Expect(wt.Kept).To(BeFalse(), "a cloned .npmrc does not make the worktree dirty") + Expect(wt.Dirty).To(BeEmpty()) + Expect(wt.Removed).To(BeTrue()) + Expect(wt.Path).NotTo(BeADirectory()) + }) + It("no setup commit when the copied tree is clean", func() { base := gitIn(repo, "rev-parse", "HEAD") writeFile(repo, "cache/build.bin", "ignored output\n") diff --git a/pkg/ai/agent/verify/after.go b/pkg/ai/agent/verify/after.go index 8de3a5c9..a4af84e9 100644 --- a/pkg/ai/agent/verify/after.go +++ b/pkg/ai/agent/verify/after.go @@ -20,14 +20,19 @@ const afterErrorTail = 8 << 10 // `sh -c` through the same bounded process runner as a verify command, reports // on the run's stream under the verify verdict kinds, and the first failure // stops the step and fails the run. +// +// A tool or prompt step runs through Opts.Actions instead, with its `with` +// rendered over the lifecycle variables. Its output is recorded for later steps +// as steps[Index]; a skipped or commands step records null. type AfterHook struct { Index int Step api.AfterStep Opts Options + steps *[]any } // AfterHooksFor builds one AfterHook per workflow.after step, in declaration -// order. Nil when the workflow declares none. +// order, sharing one steps record. Nil when the workflow declares none. func AfterHooksFor(wf *api.Workflow, opts Options) ([]any, error) { if wf == nil || len(wf.After) == 0 { return nil, nil @@ -35,9 +40,14 @@ func AfterHooksFor(wf *api.Workflow, opts Options) ([]any, error) { if err := wf.Validate(); err != nil { return nil, err } + steps := make([]any, 0, len(wf.After)) hooks := make([]any, 0, len(wf.After)) for i, step := range wf.After { - hooks = append(hooks, &AfterHook{Index: i, Step: step, Opts: opts}) + if len(step.Commands) == 0 && opts.Actions == nil { + kind, _ := step.Kind() + return nil, fmt.Errorf("workflow.after[%d] runs a %s, but the run supplies no hook action runner", i, kind) + } + hooks = append(hooks, &AfterHook{Index: i, Step: step, Opts: opts, steps: &steps}) } return hooks, nil } @@ -47,10 +57,37 @@ func (h *AfterHook) Name() string { return fmt.Sprintf("after[%d]", h.Index) } func (h *AfterHook) Phases() []agent.Phase { return []agent.Phase{agent.PhaseRun} } func (h *AfterHook) Post(hc *agent.HookContext, _ agent.Phase) error { + output, err := h.post(hc) + if h.steps != nil { + *h.steps = append(*h.steps, output) + } + return err +} + +func (h *AfterHook) post(hc *agent.HookContext) (any, error) { if reason := h.skipReason(hc); reason != "" { hc.Notify("[post-run] %s skipped: %s", h.Name(), reason) - return nil + return nil, nil + } + vars, err := h.variables(hc) + if err != nil { + return nil, err } + run, err := h.Step.EvalIf(api.HookEnvLifecycle, vars) + if err != nil { + return nil, fmt.Errorf("workflow.after[%d]: %w", h.Index, err) + } + if !run { + hc.Notify("[post-run] %s skipped: if %s is false", h.Name(), h.Step.If) + return nil, nil + } + if len(h.Step.Commands) == 0 { + return h.runAction(hc, vars) + } + return nil, h.runCommands(hc) +} + +func (h *AfterHook) runCommands(hc *agent.HookContext) error { dir, err := h.dir(hc) if err != nil { return err diff --git a/pkg/ai/agent/verify/after_actions.go b/pkg/ai/agent/verify/after_actions.go new file mode 100644 index 00000000..69002807 --- /dev/null +++ b/pkg/ai/agent/verify/after_actions.go @@ -0,0 +1,68 @@ +package verify + +import ( + "errors" + "fmt" + "maps" + "slices" + + "github.com/flanksource/captain/pkg/ai/agent" + "github.com/flanksource/captain/pkg/api" + "github.com/flanksource/captain/pkg/hookaction" +) + +// variables are what an after step's `if` and `with` read: the run's +// structured output and text, the prompt's vars and metadata, the outcome, and +// the outputs of the steps before this one. +func (h *AfterHook) variables(hc *agent.HookContext) (map[string]any, error) { + output, err := hookaction.Native(hc.Response.StructuredData) + if err != nil { + return nil, fmt.Errorf("workflow.after[%d]: structured output: %w", h.Index, err) + } + steps, err := hookaction.Native(h.previousSteps()) + if err != nil { + return nil, fmt.Errorf("workflow.after[%d]: earlier step outputs: %w", h.Index, err) + } + vars := map[string]any{} + metadata := map[string]string{} + if hc.Request != nil { + maps.Copy(vars, hc.Request.Prompt.Variables) + maps.Copy(metadata, hc.Request.Prompt.Metadata) + } + return map[string]any{ + "output": output, "result": hc.Response.Text, "vars": vars, "metadata": metadata, + "outcome": map[string]bool{"failed": hc.Failed, "verified": hc.Verified}, "steps": steps, + }, nil +} + +func (h *AfterHook) previousSteps() []any { + if h.steps == nil { + return []any{} + } + return slices.Clone(*h.steps) +} + +// runAction dispatches a tool or prompt step and reports it on the run's stream. +func (h *AfterHook) runAction(hc *agent.HookContext, vars map[string]any) (any, error) { + kind, _ := h.Step.Kind() + target := h.Step.Tool + h.Step.Prompt + cwd := "" + if kind == api.HookActionPrompt { + dir, err := h.dir(hc) + if err != nil { + return nil, err + } + cwd = dir + } + out, err := hookaction.Run(hc, hookaction.Call{Action: h.Step.HookAction, Vars: vars, Cwd: cwd}, h.Opts.Actions) + var skip *hookaction.Skip + if kind == api.HookActionPrompt && errors.As(err, &skip) { + hc.Notify("[post-run] %s skipped: %s", h.Name(), skip.Reason) + return nil, nil + } + if err != nil { + return nil, fmt.Errorf("workflow.after[%d] %s %q: %w", h.Index, kind, target, err) + } + hc.Notify("[post-run] %s %s %s done", h.Name(), kind, target) + return out, nil +} diff --git a/pkg/ai/agent/verify/after_actions_ginkgo_test.go b/pkg/ai/agent/verify/after_actions_ginkgo_test.go new file mode 100644 index 00000000..90e8e885 --- /dev/null +++ b/pkg/ai/agent/verify/after_actions_ginkgo_test.go @@ -0,0 +1,122 @@ +package verify + +import ( + "context" + "errors" + "fmt" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + + "github.com/flanksource/captain/pkg/ai" + "github.com/flanksource/captain/pkg/ai/agent" + "github.com/flanksource/captain/pkg/api" + "github.com/flanksource/captain/pkg/hookaction" +) + +type actionCall struct { + Kind, Name, Cwd string + Input map[string]any +} + +// fakeActions records each dispatched action and answers from a table. +type fakeActions struct { + calls []actionCall + answers map[string]any + fail error +} + +func (f *fakeActions) RunTool(_ context.Context, name string, input map[string]any) (any, error) { + f.calls = append(f.calls, actionCall{Kind: "tool", Name: name, Input: input}) + return f.answers[name], f.fail +} + +func (f *fakeActions) RunPrompt(_ context.Context, path string, vars map[string]any, cwd string) (any, error) { + f.calls = append(f.calls, actionCall{Kind: "prompt", Name: path, Input: vars, Cwd: cwd}) + return f.answers[path], f.fail +} + +var _ = Describe("workflow.after actions", func() { + var actions *fakeActions + + BeforeEach(func() { actions = &fakeActions{answers: map[string]any{}} }) + + post := func(hc *agent.HookContext, steps ...api.AfterStep) error { + hooks, err := AfterHooksFor(&api.Workflow{After: steps}, Options{Actions: actions}) + Expect(err).NotTo(HaveOccurred()) + var errs []error + for _, hook := range hooks { + errs = append(errs, hook.(agent.Post).Post(hc, agent.PhaseRun)) + } + return errors.Join(errs...) + } + classified := func() *agent.HookContext { + return &agent.HookContext{ + Context: context.Background(), + Request: &ai.Request{Prompt: api.Prompt{Variables: map[string]any{"file": "/issues/KEY-1.md"}}}, + Response: &ai.Response{Text: "classified", StructuredData: map[string]any{"value": map[string]any{"product": "Annuity", "score": 3}}}, + Verified: true, + } + } + step := func(action api.HookAction) api.AfterStep { + return api.AfterStep{When: api.CommitWhenSuccess, HookAction: action} + } + + It("hands a tool step its with, binding a lone {{path}} to the native value", func() { + Expect(post(classified(), step(api.HookAction{Tool: "set_frontmatter", With: map[string]any{ + "file": "{{vars.file}}", "values": "{{output.value}}", "label": "{{output.value.product}} via {{result}}", + }}))).To(Succeed()) + + Expect(actions.calls).To(Equal([]actionCall{{Kind: "tool", Name: "set_frontmatter", Input: map[string]any{ + "file": "/issues/KEY-1.md", "values": map[string]any{"product": "Annuity", "score": float64(3)}, "label": "Annuity via classified", + }}})) + }) + + It("runs a step whose if holds and skips one whose if does not, saying why", func() { + hc := classified() + Expect(post(hc, + step(api.HookAction{If: `output.value.product == "unknown"`, Tool: "never"}), + step(api.HookAction{If: `output.value.product != "unknown" && outcome.verified`, Tool: "chosen"}), + )).To(Succeed()) + + Expect(actions.calls).To(HaveLen(1)) + Expect(actions.calls[0].Name).To(Equal("chosen")) + Expect(hc.Workspace().Notices[0].Text).To(Equal(`[post-run] after[0] skipped: if output.value.product == "unknown" is false`)) + }) + + It("feeds earlier steps' outputs forward to a child prompt alongside the run's output", func() { + actions.answers["stage1"] = map[string]any{"written": true} + hc := classified() + hc.Workspace().Cwd = "/work" + Expect(post(hc, + step(api.HookAction{Tool: "stage1"}), + step(api.HookAction{If: "steps[0].written", Prompt: "/prompts/transaction.prompt", With: map[string]any{ + "product": "{{output.value.product}}", "previous": "{{steps.0}}", + }}), + )).To(Succeed()) + + Expect(actions.calls[1]).To(Equal(actionCall{Kind: "prompt", Name: "/prompts/transaction.prompt", Cwd: "/work", Input: map[string]any{ + "product": "Annuity", "previous": map[string]any{"written": true}, + }})) + }) + + It("fails the run when an action fails, naming the step", func() { + actions.fail = errors.New("child prompt failed") + err := post(classified(), step(api.HookAction{Prompt: "/prompts/transaction.prompt"})) + Expect(err).To(MatchError(ContainSubstring(`workflow.after[0] prompt "/prompts/transaction.prompt": child prompt failed`))) + }) + + It("reports a child prompt its input hooks skip as a skipped step, not a failure", func() { + actions.fail = fmt.Errorf("child: %w", &hookaction.Skip{Hook: "input.hooks[0] (tool load)", Reason: "already classified"}) + hc := classified() + + Expect(post(hc, step(api.HookAction{Prompt: "/prompts/transaction.prompt"}))).To(Succeed()) + + Expect(hc.Workspace().Notices[0].Text).To(Equal("[post-run] after[0] skipped: already classified")) + }) + + It("refuses a tool or prompt step when the run supplies no action runner", func() { + _, err := AfterHooksFor(&api.Workflow{After: []api.AfterStep{step(api.HookAction{Tool: "t"})}}, Options{}) + Expect(err).To(MatchError(ContainSubstring("workflow.after[0] runs a tool, but the run supplies no hook action runner"))) + }) +}) diff --git a/pkg/ai/agent/verify/after_ginkgo_test.go b/pkg/ai/agent/verify/after_ginkgo_test.go index c5464987..729f0ce8 100644 --- a/pkg/ai/agent/verify/after_ginkgo_test.go +++ b/pkg/ai/agent/verify/after_ginkgo_test.go @@ -57,7 +57,7 @@ var _ = Describe("workflow.after", func() { It("runs after verification passed and reports each command on the run's stream", func() { _, err := run(&silentProvider{}, &api.Workflow{ Verify: &api.Verify{Commands: []string{"true"}}, - After: []api.AfterStep{{Commands: []string{"touch landed"}}}, + After: []api.AfterStep{{HookAction: api.HookAction{Commands: []string{"touch landed"}}}}, }) Expect(err).NotTo(HaveOccurred()) Expect(ran("landed")).To(BeTrue()) @@ -68,7 +68,7 @@ var _ = Describe("workflow.after", func() { It("is skipped when verification failed", func() { _, err := run(&silentProvider{}, &api.Workflow{ Verify: &api.Verify{Commands: []string{"false"}}, - After: []api.AfterStep{{Commands: []string{"touch landed"}}}, + After: []api.AfterStep{{HookAction: api.HookAction{Commands: []string{"touch landed"}}}}, }) Expect(err).NotTo(HaveOccurred()) Expect(ran("landed")).To(BeFalse()) @@ -76,15 +76,15 @@ var _ = Describe("workflow.after", func() { }) It("treats onVerify as onSuccess when the workflow declares no verification", func() { - _, err := run(&silentProvider{}, &api.Workflow{After: []api.AfterStep{{Commands: []string{"touch landed"}}}}) + _, err := run(&silentProvider{}, &api.Workflow{After: []api.AfterStep{{HookAction: api.HookAction{Commands: []string{"touch landed"}}}}}) Expect(err).NotTo(HaveOccurred()) Expect(ran("landed")).To(BeTrue()) }) It("fails the run at the first failing command, naming it and its output", func() { - _, err := run(&silentProvider{}, &api.Workflow{After: []api.AfterStep{{ + _, err := run(&silentProvider{}, &api.Workflow{After: []api.AfterStep{{HookAction: api.HookAction{ Commands: []string{"touch first", "echo merge conflict in main.go; exit 3", "touch never"}, - }}}) + }}}}) Expect(err).To(MatchError(And( ContainSubstring("echo merge conflict in main.go; exit 3"), ContainSubstring("merge conflict in main.go"), @@ -96,8 +96,8 @@ var _ = Describe("workflow.after", func() { It("runs an always step after the run itself failed, and skips onSuccess", func() { _, err := run(&failingProvider{}, &api.Workflow{After: []api.AfterStep{ - {When: api.CommitWhenSuccess, Commands: []string{"touch landed"}}, - {When: api.CommitWhenAlways, Commands: []string{"touch cleaned"}}, + {When: api.CommitWhenSuccess, HookAction: api.HookAction{Commands: []string{"touch landed"}}}, + {When: api.CommitWhenAlways, HookAction: api.HookAction{Commands: []string{"touch cleaned"}}}, }}) Expect(err).To(MatchError(ContainSubstring("provider exploded"))) Expect(ran("landed")).To(BeFalse()) @@ -105,7 +105,7 @@ var _ = Describe("workflow.after", func() { }) It("does not land when an earlier post hook of the run failed", func() { - _, err := run(&silentProvider{}, &api.Workflow{After: []api.AfterStep{{Commands: []string{"touch landed"}}}}, + _, err := run(&silentProvider{}, &api.Workflow{After: []api.AfterStep{{HookAction: api.HookAction{Commands: []string{"touch landed"}}}}}, &failingPost{}) Expect(err).To(MatchError(ContainSubstring("commit refused"))) Expect(ran("landed")).To(BeFalse()) @@ -113,14 +113,14 @@ var _ = Describe("workflow.after", func() { It("resolves a relative cwd against the run's working directory", func() { Expect(os.Mkdir(filepath.Join(cwd, "sub"), 0o755)).To(Succeed()) - _, err := run(&silentProvider{}, &api.Workflow{After: []api.AfterStep{{Cwd: "sub", Commands: []string{"touch here"}}}}) + _, err := run(&silentProvider{}, &api.Workflow{After: []api.AfterStep{{Cwd: "sub", HookAction: api.HookAction{Commands: []string{"touch here"}}}}}) Expect(err).NotTo(HaveOccurred()) Expect(ran(filepath.Join("sub", "here"))).To(BeTrue()) }) It("refuses an invalid declaration before anything runs", func() { - _, err := AfterHooksFor(&api.Workflow{After: []api.AfterStep{{When: "later", Commands: []string{"true"}}}}, Options{}) - Expect(err).To(MatchError(ContainSubstring("workflow.after[0].when"))) + _, err := AfterHooksFor(&api.Workflow{After: []api.AfterStep{{When: "later", HookAction: api.HookAction{Commands: []string{"true"}}}}}, Options{}) + Expect(err).To(MatchError(ContainSubstring("workflow.after[0]: when"))) }) }) diff --git a/pkg/ai/agent/verify/registry.go b/pkg/ai/agent/verify/registry.go index f577e0c0..3cad6315 100644 --- a/pkg/ai/agent/verify/registry.go +++ b/pkg/ai/agent/verify/registry.go @@ -11,6 +11,7 @@ import ( "github.com/flanksource/captain/pkg/ai" "github.com/flanksource/captain/pkg/ai/prompt" "github.com/flanksource/captain/pkg/api" + "github.com/flanksource/captain/pkg/hookaction" ) // Kind names a family of verifier — one field of api.Verify and the factory that @@ -60,6 +61,10 @@ type Options struct { // and grades outside the bounds the run declared. Nil when the checks are // driven with no run behind them. RunSpec *api.Spec + // Actions runs the tool and prompt actions of workflow.after steps. Nil is + // fine for a workflow whose steps are all commands; a tool or prompt step + // with no runner is refused when the hooks are built. + Actions hookaction.Runner } // Factory builds the hooks one kind contributes. It returns *Plugin rather than diff --git a/pkg/ai/attachment_capabilities_ginkgo_test.go b/pkg/ai/attachment_capabilities_ginkgo_test.go index 8f33db99..b43a7806 100644 --- a/pkg/ai/attachment_capabilities_ginkgo_test.go +++ b/pkg/ai/attachment_capabilities_ginkgo_test.go @@ -64,7 +64,7 @@ var _ = Describe("Attachment capabilities", func() { Entry("Gemini API", api.Google, api.ModeAPI, []string{"image/*", "audio/*", "video/*", "application/pdf"}), Entry("Anthropic API", api.Anthropic, api.ModeAPI, []string{"image/*"}), Entry("OpenAI API", api.OpenAI, api.ModeAPI, []string{"image/*"}), - Entry("DeepSeek API", api.DeepSeek, api.ModeAPI, []string{}), + Entry("DeepSeek API", api.DeepSeek, api.ModeAPI, []string{"image/png", "image/jpeg", "image/gif", "image/webp"}), Entry("Codex agent", api.OpenAI, api.ModeAgent, []string{"image/*"}), Entry("Codex CLI", api.OpenAI, api.ModeCLI, []string{"image/*"}), Entry("Claude Agent", api.Anthropic, api.ModeAgent, []string{"image/png", "image/jpeg", "image/gif", "image/webp", "application/pdf"}), diff --git a/pkg/ai/callertools/cli.go b/pkg/ai/callertools/cli.go index e0fdce67..8c0c4025 100644 --- a/pkg/ai/callertools/cli.go +++ b/pkg/ai/callertools/cli.go @@ -67,6 +67,14 @@ func StartCLI(ctx context.Context, cfg api.Config, req api.Spec) (*CLIRun, error return &CLIRun{endpoint: runtime.Endpoint(), tools: names, runtime: runtime}, nil } +// Endpoint is where the run's caller-tool server listens and the credential a +// client presents to it, for a run that relays it to an agent elsewhere. +func (r *CLIRun) Endpoint() api.CallerToolEndpoint { + endpoint := r.endpoint + endpoint.Headers = cloneHeaders(r.endpoint.Headers) + return endpoint +} + // Close revokes the runtime this run owns and removes the credential files it // wrote. It is safe on a nil run. func (r *CLIRun) Close() error { diff --git a/pkg/ai/callertools/forward.go b/pkg/ai/callertools/forward.go new file mode 100644 index 00000000..15f17020 --- /dev/null +++ b/pkg/ai/callertools/forward.go @@ -0,0 +1,97 @@ +package callertools + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "maps" + "strings" + + mcpclient "github.com/mark3labs/mcp-go/client" + "github.com/mark3labs/mcp-go/client/transport" + "github.com/mark3labs/mcp-go/mcp" + + "github.com/flanksource/captain/pkg/api" +) + +// Forward lists the tools another caller-tool server serves and returns a +// definition per tool, under its own name, whose handler calls it there. The +// forwarded server keeps every decision: its tools arrive as allow here because +// it gates each call itself, and its approval broker is the one that asks. The +// closer ends the session. +func Forward(ctx context.Context, endpoint api.CallerToolEndpoint) ([]api.ToolDefinition, func() error, error) { + channel, err := transport.NewStreamableHTTP(endpoint.URL, transport.WithHTTPHeaders(maps.Clone(endpoint.Headers))) + if err != nil { + return nil, nil, fmt.Errorf("forward caller tools: %w", err) + } + client := mcpclient.NewClient(channel) + if err := client.Start(ctx); err != nil { + return nil, nil, fmt.Errorf("forward caller tools: start: %w", err) + } + initialize := mcp.InitializeRequest{} + initialize.Params.ProtocolVersion = mcp.LATEST_PROTOCOL_VERSION + initialize.Params.ClientInfo = mcp.Implementation{Name: "captain-forwarder", Version: "1"} + if _, err := client.Initialize(ctx, initialize); err != nil { + return nil, nil, errors.Join(fmt.Errorf("forward caller tools: initialize: %w", err), client.Close()) + } + listed, err := client.ListTools(ctx, mcp.ListToolsRequest{}) + if err != nil { + return nil, nil, errors.Join(fmt.Errorf("forward caller tools: list: %w", err), client.Close()) + } + definitions := make([]api.ToolDefinition, 0, len(listed.Tools)) + for _, tool := range listed.Tools { + definition, err := forwardedDefinition(client, tool) + if err != nil { + return nil, nil, errors.Join(err, client.Close()) + } + definitions = append(definitions, definition) + } + return definitions, client.Close, nil +} + +func forwardedDefinition(client *mcpclient.Client, tool mcp.Tool) (api.ToolDefinition, error) { + encoded, err := json.Marshal(tool.InputSchema) + if err != nil { + return api.ToolDefinition{}, err + } + var schema map[string]any + if err := json.Unmarshal(encoded, &schema); err != nil { + return api.ToolDefinition{}, err + } + name := tool.Name + return api.ToolDefinition{ + Name: name, Description: tool.Description, InputSchema: schema, + ReadOnlyHint: tool.Annotations.ReadOnlyHint, DestructiveHint: tool.Annotations.DestructiveHint, + DefaultPermission: api.ToolPolicyAllow, + Handler: func(ctx context.Context, input map[string]any) (any, error) { + request := mcp.CallToolRequest{} + request.Params.Name = name + request.Params.Arguments = input + result, err := client.CallTool(ctx, request) + if err != nil { + return nil, fmt.Errorf("forwarded tool %s: %w", name, err) + } + return forwardedResult(name, result) + }, + }, nil +} + +// forwardedResult is the forwarded call's answer as a local handler gives one: +// its structured content when there is some, otherwise its text, and an error +// when the far side reported one. +func forwardedResult(name string, result *mcp.CallToolResult) (any, error) { + var text []string + for _, content := range result.Content { + if textContent, ok := mcp.AsTextContent(content); ok { + text = append(text, textContent.Text) + } + } + if result.IsError { + return nil, fmt.Errorf("forwarded tool %s: %s", name, strings.Join(text, "\n")) + } + if result.StructuredContent != nil { + return result.StructuredContent, nil + } + return strings.Join(text, "\n"), nil +} diff --git a/pkg/ai/callertools/runtime.go b/pkg/ai/callertools/runtime.go index 706e9964..6bc69343 100644 --- a/pkg/ai/callertools/runtime.go +++ b/pkg/ai/callertools/runtime.go @@ -10,6 +10,7 @@ import ( "crypto/subtle" "encoding/base64" "encoding/json" + "errors" "fmt" "net" "net/http" @@ -204,6 +205,12 @@ func (r *Runtime) Close() error { ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second) defer cancel() r.closeErr = r.server.Shutdown(ctx) + // Shutdown counts a connection that never sent a request as busy for + // 5s (net/http closeIdleConns), longer than this drain. Revoke has + // already cancelled every call, so whatever is left is closed outright. + if errors.Is(r.closeErr, context.DeadlineExceeded) { + r.closeErr = r.server.Close() + } }) return r.closeErr } diff --git a/pkg/ai/callertools/runtime_ginkgo_test.go b/pkg/ai/callertools/runtime_ginkgo_test.go index 52a1be26..5f13f099 100644 --- a/pkg/ai/callertools/runtime_ginkgo_test.go +++ b/pkg/ai/callertools/runtime_ginkgo_test.go @@ -3,7 +3,9 @@ package callertools_test import ( "context" "errors" + "net" "net/http" + "net/url" "sync/atomic" "time" @@ -223,6 +225,27 @@ var _ = Describe("Authenticated caller-tool runtime", func() { Expect(hiddenCalls.Load()).To(BeZero()) }) + It("closes without error while a client holds a connection that never sent a request", func(ctx SpecContext) { + runtime, err := callertools.New(callertools.Options{ + Context: ctx, + Definitions: []api.ToolDefinition{{ + Name: "lookup", DefaultPermission: api.ToolPolicyAllow, + Handler: func(context.Context, map[string]any) (any, error) { return "ok", nil }, + }}, + SessionID: "idle-connection-session", + }) + Expect(err).NotTo(HaveOccurred()) + endpoint, err := url.Parse(runtime.Endpoint().URL) + Expect(err).NotTo(HaveOccurred()) + // An HTTP transport can dial a spare connection it never uses; the + // server sees it in StateNew, which Shutdown does not treat as idle. + idle, err := net.Dial("tcp", endpoint.Host) + Expect(err).NotTo(HaveOccurred()) + DeferCleanup(idle.Close) + + Expect(runtime.Close()).To(Succeed()) + }, SpecTimeout(10*time.Second)) + It("brokers ask tools and applies updated input", func(ctx SpecContext) { var calls atomic.Int32 runtime, err := callertools.New(callertools.Options{ diff --git a/pkg/ai/client.go b/pkg/ai/client.go index eeee1a18..5c02fc0a 100644 --- a/pkg/ai/client.go +++ b/pkg/ai/client.go @@ -48,7 +48,7 @@ func newResolvedProvider(cfg Config) (Provider, error) { if err != nil { return nil, err } - return withModelErrorRecommendations(withEffortValidation(p, cfg.Model.Effort)), nil + return withModelErrorRecommendations(withAccess(withEffortValidation(p, cfg.Model.Effort))), nil } // suggestModelName appends the closest catalog model ids to an unresolvable-model diff --git a/pkg/ai/deepseek_attachments_ginkgo_test.go b/pkg/ai/deepseek_attachments_ginkgo_test.go new file mode 100644 index 00000000..b2ca4eb3 --- /dev/null +++ b/pkg/ai/deepseek_attachments_ginkgo_test.go @@ -0,0 +1,65 @@ +package ai_test + +import ( + "github.com/flanksource/captain/pkg/ai" + "github.com/flanksource/captain/pkg/api" + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +var _ = Describe("DeepSeek attachments", func() { + imageTypes := []string{"image/png", "image/jpeg", "image/gif", "image/webp"} + + DescribeTable("accepts supported images on Flash models", func(name string) { + model := resolved(api.Model{Name: name, Mode: api.ModeAPI}) + Expect(model.MediaTypes).To(ConsistOf(imageTypes)) + for _, mediaType := range imageTypes { + Expect(ai.ValidateAttachmentCompatibility([]api.Model{model}, []api.AttachmentRef{{MediaType: mediaType}})).To(Succeed()) + } + }, + Entry("rolling Flash", "deepseek-flash"), + Entry("V4 Flash alias", "deepseek-v4-flash"), + Entry("vision experiment alias", "deepseek-v4-flash-vision-exp"), + ) + + It("keeps Pro text-only even when the API adapter can carry images", func() { + model := resolved(api.Model{Name: "deepseek-v4-pro", Mode: api.ModeAPI}) + Expect(model.MediaTypes).To(BeEmpty()) + for _, mediaType := range imageTypes { + Expect(ai.ValidateAttachmentCompatibility([]api.Model{model}, []api.AttachmentRef{{MediaType: mediaType}})).To(MatchError(ContainSubstring("does not accept " + mediaType))) + } + }) + + DescribeTable("rejects unsupported attachment formats", func(mediaType string) { + model := resolved(api.Model{Name: "deepseek-flash", Mode: api.ModeAPI}) + Expect(ai.ValidateAttachmentCompatibility([]api.Model{model}, []api.AttachmentRef{{MediaType: mediaType}})).To(MatchError(ContainSubstring("does not accept " + mediaType))) + }, + Entry("SVG", "image/svg+xml"), + Entry("PDF", "application/pdf"), + Entry("audio", "audio/mpeg"), + Entry("video", "video/mp4"), + ) + + It("publishes matching static and live catalog capabilities", func() { + static := ai.CatalogInfo([]string{"deepseek"}) + live := ai.CatalogInfoFromAdapters([]ai.AdapterStatus{{ + Provider: "deepseek", Mode: "api", + ModelDetails: []ai.ModelDef{ + {ID: "deepseek-flash", Provider: "deepseek", Mode: api.ModeAPI}, + {ID: "deepseek-v4-pro", Provider: "deepseek", Mode: api.ModeAPI}, + }, + }}) + for _, catalog := range [][]ai.ModelInfo{static, live} { + Expect(catalog).To(ContainElement(And( + HaveField("ID", "deepseek/deepseek-flash"), + HaveField("InputMediaTypes", ConsistOf(imageTypes)), + HaveField("Runtime.MediaTypes", ConsistOf(imageTypes)), + ))) + Expect(catalog).To(ContainElement(And( + HaveField("ID", "deepseek/deepseek-v4-pro"), + HaveField("InputMediaTypes", BeEmpty()), + HaveField("Runtime.MediaTypes", BeEmpty()), + ))) + } + }) +}) diff --git a/pkg/ai/event_observer.go b/pkg/ai/event_observer.go new file mode 100644 index 00000000..18f56e62 --- /dev/null +++ b/pkg/ai/event_observer.go @@ -0,0 +1,16 @@ +package ai + +import "context" + +type eventObserverKey struct{} + +// WithEventObserver observes diagnostic events from buffered execution. +func WithEventObserver(ctx context.Context, observer func(Event)) context.Context { + return context.WithValue(ctx, eventObserverKey{}, observer) +} + +func ReportEvent(ctx context.Context, event Event) { + if observer, ok := ctx.Value(eventObserverKey{}).(func(Event)); ok && observer != nil { + observer(event) + } +} diff --git a/pkg/ai/fixture/runner.go b/pkg/ai/fixture/runner.go index a0bb9776..ed667046 100644 --- a/pkg/ai/fixture/runner.go +++ b/pkg/ai/fixture/runner.go @@ -15,8 +15,9 @@ import ( "strings" "time" - "github.com/flanksource/captain/pkg/ai/fixture/kubeproxy" "github.com/flanksource/captain/pkg/ai/fixture/mcpproxy" + "github.com/flanksource/captain/pkg/credproxy" + "github.com/flanksource/captain/pkg/credproxy/kubeproxy" // Side-effect import: pkg/ai's init populates the pricing registry with the // built-in model catalog so resolveCost works offline (no OpenRouter fetch @@ -155,12 +156,16 @@ func setupKubernetesProxy(f *Fixture, opts Options) (*kubeproxy.Proxy, string, s if !f.CaptureKubernetesProxy { return nil, "", "", func() {}, nil } - p, err := kubeproxy.Start(f.Kubeconfig) + token, err := credproxy.NewSecret() + if err != nil { + return nil, "", "", func() {}, err + } + p, err := kubeproxy.Start(kubeproxy.Options{Kubeconfig: f.Kubeconfig, Token: token}) if err != nil { return nil, "", "", func() {}, fmt.Errorf("starting kubernetes proxy: %w", err) } proxyDir := filepath.Join(opts.ArtifactDir, ".proxy") - kc, err := p.WriteKubeconfig(proxyDir) + kc, err := kubeproxy.WriteKubeconfig(proxyDir, p.Endpoint()) if err != nil { p.Close() return nil, "", "", func() {}, fmt.Errorf("writing proxy kubeconfig: %w", err) diff --git a/pkg/ai/fixture/runner_test.go b/pkg/ai/fixture/runner_test.go index bb858308..37a63f6d 100644 --- a/pkg/ai/fixture/runner_test.go +++ b/pkg/ai/fixture/runner_test.go @@ -458,7 +458,8 @@ set -eu # Pull the proxy URL out of KUBECONFIG and hit it once to simulate kubectl # making an API call. Emit a stream-json with a Bash tool_use referencing kubectl. proxy_url=$(grep "server:" "$KUBECONFIG" | head -1 | awk '{print $2}') -curl -sk -o /dev/null "$proxy_url/api/v1/namespaces/prod/pods?limit=10" || true +proxy_token=$(grep "token:" "$KUBECONFIG" | head -1 | awk '{print $2}') +curl -sk -o /dev/null -H "Authorization: Bearer $proxy_token" "$proxy_url/api/v1/namespaces/prod/pods?limit=10" || true cat <<'EOF2' {"type":"system","subtype":"init","session_id":"sess-kc"} diff --git a/pkg/ai/history/codex_parser.go b/pkg/ai/history/codex_parser.go index 680ae5ed..b2a0f899 100644 --- a/pkg/ai/history/codex_parser.go +++ b/pkg/ai/history/codex_parser.go @@ -3,12 +3,12 @@ package history import ( "io" "os" - "path/filepath" "sort" "strings" "time" "github.com/flanksource/captain/pkg/api" + "github.com/flanksource/captain/pkg/codexhome" "github.com/flanksource/captain/pkg/jsonl" "github.com/segmentio/encoding/json" ) @@ -400,23 +400,22 @@ func sortedCodexPendingCalls(pending map[string]codexPendingCall) []codexPending return calls } +// FindCodexSessionFiles lists the rollouts under every home codex writes to: +// the user's, and the isolated one captain starts read-only runs in. func FindCodexSessionFiles() ([]string, error) { - home, err := os.UserHomeDir() + roots, err := codexhome.SessionRoots() if err != nil { return nil, err } - sessionsDir := filepath.Join(home, ".codex", "sessions") - if _, err := os.Stat(sessionsDir); os.IsNotExist(err) { - return nil, nil + rollouts, err := walkCodexRollouts(roots, time.Time{}) + if err != nil { + return nil, err } - var files []string - err = filepath.Walk(sessionsDir, func(path string, info os.FileInfo, err error) error { - if err == nil && !info.IsDir() && strings.HasSuffix(path, ".jsonl") { - files = append(files, path) - } - return nil - }) - return files, err + files := make([]string, 0, len(rollouts)) + for _, rollout := range rollouts { + files = append(files, rollout.Path) + } + return files, nil } func IsCodexSession(path string) bool { diff --git a/pkg/ai/history/codex_session_roots_ginkgo_test.go b/pkg/ai/history/codex_session_roots_ginkgo_test.go new file mode 100644 index 00000000..e9193ffe --- /dev/null +++ b/pkg/ai/history/codex_session_roots_ginkgo_test.go @@ -0,0 +1,29 @@ +package history + +import ( + "os" + "path/filepath" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +var _ = Describe("Codex session discovery", func() { + It("finds rollouts written by a read-only run in captain's isolated CODEX_HOME", func() { + root := GinkgoT().TempDir() + GinkgoT().Setenv("CODEX_HOME", filepath.Join(root, "user-codex")) + GinkgoT().Setenv("XDG_CONFIG_HOME", filepath.Join(root, "config")) + user := filepath.Join(root, "user-codex", "sessions", "2026", "10", "22", "rollout-a.jsonl") + readOnly := filepath.Join(root, "config", "captain", "codex-read-only", "sessions", "2026", "10", "22", "rollout-b.jsonl") + for _, path := range []string{user, readOnly} { + Expect(os.MkdirAll(filepath.Dir(path), 0o755)).To(Succeed()) + Expect(os.WriteFile(path, []byte("{}\n"), 0o600)).To(Succeed()) + } + + files, err := FindCodexSessionFiles() + + Expect(err).NotTo(HaveOccurred()) + Expect(files).To(ConsistOf(user, readOnly)) + Expect(IsCodexSession(readOnly)).To(BeTrue()) + }) +}) diff --git a/pkg/ai/history/transcripts.go b/pkg/ai/history/transcripts.go new file mode 100644 index 00000000..b829dbdf --- /dev/null +++ b/pkg/ai/history/transcripts.go @@ -0,0 +1,129 @@ +package history + +import ( + "fmt" + "io/fs" + "os" + "path/filepath" + "strings" + "time" + + "github.com/flanksource/captain/pkg/claude" + "github.com/flanksource/captain/pkg/codexhome" +) + +const ( + TranscriptSourceClaude = "claude" + TranscriptSourceCodex = "codex" +) + +// TranscriptKind says whether a transcript is a session's own or one of its sub-agents'. +type TranscriptKind string + +const ( + TranscriptRoot TranscriptKind = "root" + TranscriptAgent TranscriptKind = "agent" +) + +// TranscriptQuery selects agent transcripts on disk. +type TranscriptQuery struct { + // Home is the home directory the agents wrote under. Empty means the + // user's: ~/.claude/projects plus every codex session root (CODEX_HOME and + // captain's read-only home). + Home string + // ModifiedSince keeps only transcripts whose mtime is at or after it. Zero + // keeps every transcript. + ModifiedSince time.Time +} + +// Transcript is one agent transcript file found on disk. +type Transcript struct { + Source string + Kind TranscriptKind + Path string + Info fs.FileInfo +} + +// FindTranscripts lists the Claude and codex transcripts the query selects. +// The ModifiedSince filter runs on file metadata only: no transcript is +// opened. Codex rollouts sit under the day their session started, so a +// resumed session is found by its mtime, not its folder. +func FindTranscripts(query TranscriptQuery) ([]Transcript, error) { + projectsDir, codexRoots, err := transcriptRoots(query.Home) + if err != nil { + return nil, err + } + var found []Transcript + for _, kind := range []TranscriptKind{TranscriptRoot, TranscriptAgent} { + find := claude.FindSessionFiles + if kind == TranscriptAgent { + find = claude.FindAgentTranscripts + } + paths, err := find(projectsDir, "", true) + if err != nil { + return nil, fmt.Errorf("find claude %s transcripts under %s: %w", kind, projectsDir, err) + } + for _, path := range paths { + info, err := os.Stat(path) + if os.IsNotExist(err) { + continue + } + if err != nil { + return nil, err + } + if !info.ModTime().Before(query.ModifiedSince) { + found = append(found, Transcript{Source: TranscriptSourceClaude, Kind: kind, Path: path, Info: info}) + } + } + } + codex, err := walkCodexRollouts(codexRoots, query.ModifiedSince) + if err != nil { + return nil, err + } + return append(found, codex...), nil +} + +func transcriptRoots(home string) (projectsDir string, codexRoots []string, err error) { + if home != "" { + return filepath.Join(home, ".claude", "projects"), []string{filepath.Join(home, ".codex", "sessions")}, nil + } + codexRoots, err = codexhome.SessionRoots() + return claude.GetProjectsDir(), codexRoots, err +} + +// walkCodexRollouts lists the *.jsonl rollouts under each root modified at or +// after since. A rollout that disappears mid-walk is skipped. +func walkCodexRollouts(roots []string, since time.Time) ([]Transcript, error) { + var found []Transcript + for _, root := range roots { + if _, err := os.Stat(root); os.IsNotExist(err) { + continue + } + err := filepath.WalkDir(root, func(path string, entry fs.DirEntry, err error) error { + if err != nil { + if os.IsNotExist(err) { + return nil + } + return err + } + if entry.IsDir() || !strings.HasSuffix(path, ".jsonl") { + return nil + } + info, err := entry.Info() + if os.IsNotExist(err) { + return nil + } + if err != nil { + return err + } + if !info.ModTime().Before(since) { + found = append(found, Transcript{Source: TranscriptSourceCodex, Kind: TranscriptRoot, Path: path, Info: info}) + } + return nil + }) + if err != nil { + return nil, fmt.Errorf("walk codex sessions under %s: %w", root, err) + } + } + return found, nil +} diff --git a/pkg/ai/history/transcripts_ginkgo_test.go b/pkg/ai/history/transcripts_ginkgo_test.go new file mode 100644 index 00000000..045b84ba --- /dev/null +++ b/pkg/ai/history/transcripts_ginkgo_test.go @@ -0,0 +1,104 @@ +package history + +import ( + "os" + "path/filepath" + "time" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +var _ = Describe("FindTranscripts", func() { + var ( + home string + oldRoot, newRoot, newAgent, resumed string + oldCodex string + lastWeek, yesterday, now time.Time + ) + + write := func(path string, modTime time.Time) string { + Expect(os.MkdirAll(filepath.Dir(path), 0o755)).To(Succeed()) + Expect(os.WriteFile(path, []byte("{}\n"), 0o600)).To(Succeed()) + Expect(os.Chtimes(path, modTime, modTime)).To(Succeed()) + return path + } + + BeforeEach(func() { + home = GinkgoT().TempDir() + now = time.Now().Truncate(time.Second) + yesterday = now.Add(-24 * time.Hour) + lastWeek = now.Add(-7 * 24 * time.Hour) + projects := filepath.Join(home, ".claude", "projects", "-work-repo") + sessions := filepath.Join(home, ".codex", "sessions") + oldRoot = write(filepath.Join(projects, "old-session.jsonl"), lastWeek) + newRoot = write(filepath.Join(projects, "new-session.jsonl"), now) + newAgent = write(filepath.Join(projects, "new-session", "subagents", "agent-a1.jsonl"), now) + oldCodex = write(filepath.Join(sessions, "2026", "10", "01", "rollout-2026-10-01T00-00-00-old.jsonl"), lastWeek) + // A resumed codex session stays under the folder of the day it started. + resumed = write(filepath.Join(sessions, "2026", "10", "01", "rollout-2026-10-01T01-00-00-resumed.jsonl"), now) + write(filepath.Join(sessions, "2026", "10", "01", "notes.txt"), now) + }) + + paths := func(found []Transcript) []Transcript { + for i := range found { + found[i].Info = nil + } + return found + } + + It("returns every transcript under the home when no time is given", func() { + found, err := FindTranscripts(TranscriptQuery{Home: home}) + + Expect(err).NotTo(HaveOccurred()) + Expect(paths(found)).To(ConsistOf( + Transcript{Source: TranscriptSourceClaude, Kind: TranscriptRoot, Path: oldRoot}, + Transcript{Source: TranscriptSourceClaude, Kind: TranscriptRoot, Path: newRoot}, + Transcript{Source: TranscriptSourceClaude, Kind: TranscriptAgent, Path: newAgent}, + Transcript{Source: TranscriptSourceCodex, Kind: TranscriptRoot, Path: oldCodex}, + Transcript{Source: TranscriptSourceCodex, Kind: TranscriptRoot, Path: resumed}, + )) + }) + + It("returns only the transcripts modified at or after ModifiedSince, wherever their day folder is", func() { + found, err := FindTranscripts(TranscriptQuery{Home: home, ModifiedSince: yesterday}) + + Expect(err).NotTo(HaveOccurred()) + Expect(paths(found)).To(ConsistOf( + Transcript{Source: TranscriptSourceClaude, Kind: TranscriptRoot, Path: newRoot}, + Transcript{Source: TranscriptSourceClaude, Kind: TranscriptAgent, Path: newAgent}, + Transcript{Source: TranscriptSourceCodex, Kind: TranscriptRoot, Path: resumed}, + )) + }) + + It("keeps a transcript modified exactly at ModifiedSince", func() { + found, err := FindTranscripts(TranscriptQuery{Home: home, ModifiedSince: lastWeek}) + + Expect(err).NotTo(HaveOccurred()) + Expect(found).To(HaveLen(5)) + }) + + It("returns nothing when every transcript is older than ModifiedSince", func() { + found, err := FindTranscripts(TranscriptQuery{Home: home, ModifiedSince: now.Add(time.Hour)}) + + Expect(err).NotTo(HaveOccurred()) + Expect(found).To(BeEmpty()) + }) + + It("carries the file info the filter used", func() { + found, err := FindTranscripts(TranscriptQuery{Home: home, ModifiedSince: yesterday}) + + Expect(err).NotTo(HaveOccurred()) + for _, transcript := range found { + Expect(transcript.Info).NotTo(BeNil(), transcript.Path) + Expect(transcript.Info.ModTime()).To(Equal(now), transcript.Path) + } + }) + + It("returns nothing for a home without agent transcripts", func() { + found, err := FindTranscripts(TranscriptQuery{Home: GinkgoT().TempDir()}) + + Expect(err).NotTo(HaveOccurred()) + Expect(found).To(BeEmpty()) + }) +}) diff --git a/pkg/ai/internal/gen-model-registry/patches.json b/pkg/ai/internal/gen-model-registry/patches.json index f13dffa7..3415bbeb 100644 --- a/pkg/ai/internal/gen-model-registry/patches.json +++ b/pkg/ai/internal/gen-model-registry/patches.json @@ -1,6 +1,26 @@ { - "claude-fable-5-1": { + "claude-fable-5-2": { + "provider": "anthropic", + "family": "fable", + "version": "5.2", + "label": "Claude Fable 5.2", + "releaseDate": "2026-11-09", + "reasoning": true, + "contextWindow": 1000000, + "cost": { + "input": 8, + "output": 40, + "cacheRead": 0.2, + "cacheWrite": 10 + }, + "inputMediaTypes": ["image/*", "application/pdf"], "preferred": true, + "adaptiveThinking": true, + "supportedEfforts": ["low", "medium", "high", "xhigh", "max"], + "defaultEffort": "high" + }, + "claude-fable-5-1": { + "preferred": false, "defaultEffort": "high" }, "claude-opus-5-5": { @@ -53,6 +73,13 @@ "priority": 0, "aliases": null }, + "gpt-6.1-terra": { + "preferred": true, + "availability": ["api", "cli", "agent", "cmux"], + "priority": 4, + "defaultEffort": "medium", + "aliases": ["terra"] + }, "gpt-6-luna": { "preferred": true, "availability": ["api", "cli", "agent", "cmux"], @@ -99,9 +126,7 @@ "max", "ultra" ], - "aliases": [ - "terra" - ] + "aliases": null }, "gpt-5.6-luna": { "preferred": false, diff --git a/pkg/ai/middleware/construct.go b/pkg/ai/middleware/construct.go index 5abbecc6..3d1581c1 100644 --- a/pkg/ai/middleware/construct.go +++ b/pkg/ai/middleware/construct.go @@ -5,13 +5,15 @@ import ( "github.com/flanksource/captain/pkg/ai/cache" ) -// DefaultOptions is captain's standard middleware stack for a Config: response -// logging is always applied, and response caching is added when cfg configures -// it (a cache TTL or DB path, with NoCache unset). This lives in middleware, not +// DefaultOptions is captain's standard middleware stack for a Config: tracing +// and response logging are always applied, and response caching is added when +// cfg configures it (a cache TTL or DB path, with NoCache unset). Tracing wraps +// the bare provider, so each span is one real model call: a schema-repair +// retry gets its own span and a cache hit gets none. This lives in middleware, not // ai.NewProvider, because middleware imports ai (wrapping ai.Provider) and the // reverse import would be a cycle. func DefaultOptions(cfg ai.Config, runtime ai.Runtime) []Option { - opts := []Option{WithLogging(), WithObservers()} + opts := []Option{WithTracing(), WithLogging(), WithObservers()} if runtime.Provider != "jev" { opts = append(opts, WithSchemaValidation(cfg)) } diff --git a/pkg/ai/middleware/jev_ginkgo_test.go b/pkg/ai/middleware/jev_ginkgo_test.go index 766835e7..2d096f7f 100644 --- a/pkg/ai/middleware/jev_ginkgo_test.go +++ b/pkg/ai/middleware/jev_ginkgo_test.go @@ -3,7 +3,6 @@ package middleware import ( "context" "encoding/json" - "testing" "github.com/flanksource/captain/pkg/ai" "github.com/flanksource/captain/pkg/api" @@ -11,11 +10,6 @@ import ( . "github.com/onsi/gomega" ) -func TestJevConversion(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Jev Conversion Suite") -} - type jevRecordingProvider struct { request ai.Request } diff --git a/pkg/ai/middleware/logging.go b/pkg/ai/middleware/logging.go index f2f3511a..07c46882 100644 --- a/pkg/ai/middleware/logging.go +++ b/pkg/ai/middleware/logging.go @@ -3,6 +3,7 @@ package middleware import ( "context" "encoding/json" + "errors" "fmt" "time" @@ -48,12 +49,24 @@ func (l *loggingProvider) Execute(ctx context.Context, req ai.Request) (*ai.Resp resp, err := l.provider.Execute(ctx, req) duration := time.Since(start) - if err != nil { - log.Errorf("%v", clicky.Text(""). - Add(icons.Error). - Append(" "+identity, "text-red-600 font-medium"). - Append(fmt.Sprintf(" failed after %v: %v", duration.Round(time.Millisecond), err), "text-red-500")) + if errors.Is(err, ai.ErrSchemaValidation) { + log.Debugf("%s response rejected after %v: %v", identity, duration.Round(time.Millisecond), err) + } else { + log.Errorf("%v", clicky.Text(""). + Add(icons.Error). + Append(" "+identity, "text-red-600 font-medium"). + Append(fmt.Sprintf(" failed after %v: %v", duration.Round(time.Millisecond), err), "text-red-500")) + } + // A reply rejected as unparseable rides back with the error; the parse + // error names only the first bad byte, so show the reply itself. + if log.IsDebugEnabled() && resp != nil && resp.Text != "" { + log.Debugf("%v", clicky.Text(""). + Add(icons.ArrowDown). + Append(" rejected response", "text-gray-500"). + NewLine(). + Append(resp.Text, "text-gray-600")) + } return resp, err } diff --git a/pkg/ai/middleware/logging_test.go b/pkg/ai/middleware/logging_test.go index 1f929653..1f4bd26a 100644 --- a/pkg/ai/middleware/logging_test.go +++ b/pkg/ai/middleware/logging_test.go @@ -4,6 +4,8 @@ import ( "bytes" "context" "encoding/json" + "errors" + "fmt" "regexp" "strings" "testing" @@ -20,10 +22,13 @@ type sampleOut struct { Note string `json:"note,omitempty"` } -type stubProvider struct{ resp *ai.Response } +type stubProvider struct { + resp *ai.Response + err error +} func (s stubProvider) Execute(context.Context, ai.Request) (*ai.Response, error) { - return s.resp, nil + return s.resp, s.err } func (s stubProvider) GetModel() string { return "test-model" } func (s stubProvider) GetRuntime() ai.Runtime { return ai.RuntimeOf(ai.Anthropic, ai.ModeAPI) } @@ -88,6 +93,45 @@ func TestLoggingProvider_UsesEffortQualifiedRuntimeIdentity(t *testing.T) { } } +// TestLoggingProvider_LogsRejectedReplyOnError covers a reply the provider +// rejected as invalid JSON: the parse error names only the first bad byte, so +// the reply itself must be visible under -v to diagnose the failure. +func TestLoggingProvider_LogsRejectedReplyOnError(t *testing.T) { + const reply = "I found three style issues in report.mdx" + for _, tt := range []struct { + level string + wantReply bool + }{ + {"info", false}, + {"debug", true}, + } { + t.Run(tt.level, func(t *testing.T) { + prev := logger.GetOutput() + t.Cleanup(func() { logger.SetOutput(prev) }) + var buf bytes.Buffer + logger.SetOutput(&buf) + logger.GetLogger("ai").SetLogLevel(tt.level) + + p, err := WithLogging()(stubProvider{ + resp: &ai.Response{Text: reply}, + err: fmt.Errorf("%w: data is not valid JSON: invalid character 'I'", ai.ErrSchemaValidation), + }) + if err != nil { + t.Fatalf("WithLogging: %v", err) + } + if _, err := p.Execute(context.Background(), ai.Request{}); !errors.Is(err, ai.ErrSchemaValidation) { + t.Fatalf("Execute error = %v, want ErrSchemaValidation", err) + } + + got := ansi.ReplaceAllString(buf.String(), "") + if strings.Contains(got, reply) != tt.wantReply || strings.Contains(got, "rejected response") != tt.wantReply { + t.Errorf("at %s level, rejected reply logged = %v, want %v\n--- output ---\n%s", + tt.level, strings.Contains(got, reply), tt.wantReply, got) + } + }) + } +} + func TestLoggingProvider_StreamOmitsEmptyEffort(t *testing.T) { prev := logger.GetOutput() t.Cleanup(func() { logger.SetOutput(prev) }) diff --git a/pkg/ai/middleware/middleware_suite_test.go b/pkg/ai/middleware/middleware_suite_test.go new file mode 100644 index 00000000..892cc8cb --- /dev/null +++ b/pkg/ai/middleware/middleware_suite_test.go @@ -0,0 +1,13 @@ +package middleware + +import ( + "testing" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +func TestMiddleware(t *testing.T) { + RegisterFailHandler(Fail) + RunSpecs(t, "Middleware Suite") +} diff --git a/pkg/ai/middleware/repair_ginkgo_test.go b/pkg/ai/middleware/repair_ginkgo_test.go new file mode 100644 index 00000000..44ca7de3 --- /dev/null +++ b/pkg/ai/middleware/repair_ginkgo_test.go @@ -0,0 +1,116 @@ +package middleware + +import ( + "context" + "encoding/json" + "fmt" + + "github.com/flanksource/captain/pkg/ai" + "github.com/flanksource/captain/pkg/api" + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +const rejectedMarkdown = "I recorded 11 findings in `report.mdx`.\n\n- **Goals:** define a baseline.\n- **Owners:** name the team." + +type repairScript struct { + requests []ai.Request + replies []string + repairError error +} + +func (p *repairScript) GetModel() string { return "test-model" } +func (p *repairScript) GetRuntime() ai.Runtime { return ai.RuntimeOf(ai.Anthropic, ai.ModeAPI) } +func (p *repairScript) Execute(context.Context, ai.Request) (*ai.Response, error) { + return nil, fmt.Errorf("stream only") +} +func (p *repairScript) ExecuteStream(_ context.Context, req ai.Request) (<-chan ai.Event, error) { + if len(p.requests) > 0 && p.repairError != nil { + return nil, p.repairError + } + body := p.replies[min(len(p.requests), len(p.replies)-1)] + p.requests = append(p.requests, req) + out := make(chan ai.Event, 1) + if json.Valid([]byte(body)) { + out <- ai.Event{Kind: ai.EventResult, Success: true, StructuredData: json.RawMessage(body), Usage: &ai.Usage{OutputTokens: 10}, CostUSD: streamCostUSD} + } else { + out <- ai.Event{Kind: ai.EventError, Text: body, Error: ai.ErrSchemaValidation.Error() + ": expected JSON", Usage: &ai.Usage{OutputTokens: 10}, CostUSD: streamCostUSD} + } + close(out) + return out, nil +} + +var _ = Describe("Schema repair responses", func() { + It("preserves the rejected turn's spend when a repair cannot start", func() { + inner := &repairScript{replies: []string{rejectedMarkdown}, repairError: fmt.Errorf("provider unavailable")} + provider, err := WithSchemaValidation()(inner) + Expect(err).NotTo(HaveOccurred()) + events, err := provider.(ai.StreamingProvider).ExecuteStream(context.Background(), capRequest(api.SchemaStrictnessRepair)) + Expect(err).NotTo(HaveOccurred()) + var terminal ai.Event + for event := range events { + terminal = event + } + Expect(terminal.Error).To(ContainSubstring("provider unavailable")) + Expect(terminal.CostUSD).To(Equal(streamCostUSD)) + Expect(terminal.Usage).To(Equal(&ai.Usage{OutputTokens: 10})) + }) + + DescribeTable("shows rejected Markdown before repair or terminal failure", func(policy string, replies []string, calls int, success bool) { + inner := &repairScript{replies: replies} + provider, err := WithSchemaValidation()(inner) + Expect(err).NotTo(HaveOccurred()) + events, err := provider.(ai.StreamingProvider).ExecuteStream(context.Background(), capRequest(api.SchemaStrictness(policy))) + Expect(err).NotTo(HaveOccurred()) + var received []ai.Event + for event := range events { + received = append(received, event) + } + Expect(inner.requests).To(HaveLen(calls)) + rejectedCount := calls + if success { + rejectedCount-- + } + Expect(eventsOfKind(received, ai.EventText)).To(HaveLen(rejectedCount)) + Expect(received[0].Kind).To(Equal(ai.EventText)) + Expect(received[0].Text).To(Equal(rejectedMarkdown)) + if success { + Expect(eventsOfKind(received, ai.EventError)).To(BeEmpty()) + Expect(received[len(received)-1].StructuredData).To(MatchJSON(validJSON)) + } else { + Expect(eventsOfKind(received, ai.EventError)).To(HaveLen(1)) + } + Expect(received[len(received)-1].Usage.OutputTokens).To(Equal(calls * 10)) + }, Entry("repair", "repair", []string{rejectedMarkdown, validJSON}, 2, true), + Entry("retry alias", "retry", []string{rejectedMarkdown, validJSON}, 2, true), + Entry("error", "error", []string{rejectedMarkdown}, 1, false), + Entry("exhausted", "repair", []string{rejectedMarkdown}, 3, false)) + + It("repairs malformed JSON and preserves the final rejected buffered response", func() { + inner := &scriptedProvider{responses: []string{rejectedMarkdown}} + provider, err := WithSchemaValidation()(inner) + Expect(err).NotTo(HaveOccurred()) + response, err := provider.Execute(context.Background(), capRequest(api.SchemaStrictness("repair"))) + Expect(err).To(MatchError(ContainSubstring(ai.ErrSchemaValidation.Error()))) + Expect(inner.calls).To(Equal(3)) + Expect(response).NotTo(BeNil()) + Expect(response.Text).To(Equal(rejectedMarkdown)) + }) + + It("appends repair feedback to canonical messages and disables caller tools", func() { + provider := &validatingProvider{provider: &scriptedProvider{}} + parent := capRequest(api.SchemaStrictnessRepair) + parent.Messages = []api.Message{{Role: api.RoleUser, Parts: []api.Part{{Type: api.PartText, Text: "Review the report."}}}} + parent.ToolApproval = &api.ToolApprovalResume{} + repaired, _, _, err := provider.repairRequest(parent, json.RawMessage(capSchema), "expected JSON", &ai.Response{Text: rejectedMarkdown}, 1) + Expect(err).NotTo(HaveOccurred()) + Expect(repaired.Messages).To(HaveLen(2)) + Expect(repaired.Messages[1].Parts[0].Text).To(ContainSubstring(rejectedMarkdown)) + Expect(parent.Messages).To(HaveLen(1)) + Expect(repaired.ToolApproval).To(BeNil()) + Expect(repaired.ToolPolicy.Validate()).To(Succeed()) + policy, matched := repaired.ToolPolicy.Resolve(api.ToolInfo{Name: "report_violation"}) + Expect(matched).To(BeTrue()) + Expect(policy).To(Equal(api.ToolPolicyDeny)) + }) +}) diff --git a/pkg/ai/middleware/schema_repair.go b/pkg/ai/middleware/schema_repair.go index 06060ec7..1ecc7e8b 100644 --- a/pkg/ai/middleware/schema_repair.go +++ b/pkg/ai/middleware/schema_repair.go @@ -80,6 +80,13 @@ func (v *validatingProvider) repairRequest(parent ai.Request, schema json.RawMes req.Prompt.SchemaJSON = parent.Prompt.SchemaJSON req.Prompt.SchemaStrictness = api.SchemaStrictnessDisabled req.Workflow = nil + req.ToolApproval = nil + if len(parent.Messages) > 0 { + req.Messages = append(append([]api.Message(nil), parent.Messages...), api.Message{ + Role: api.RoleUser, Parts: []api.Part{{Type: api.PartText, Text: renderedReq.Prompt.System + "\n\n" + renderedReq.Prompt.User}}, + }) + } + req.ToolPolicy = parent.ToolPolicy.Append(api.PermissionPolicy{{ToolMatch: api.ToolMatch{Name: api.MatchPatterns{"*"}}, Policy: api.ToolPolicyDeny}}) cfg := v.cfg cfg.Model = model diff --git a/pkg/ai/middleware/tracing.go b/pkg/ai/middleware/tracing.go new file mode 100644 index 00000000..fb0e76a7 --- /dev/null +++ b/pkg/ai/middleware/tracing.go @@ -0,0 +1,78 @@ +package middleware + +import ( + "context" + "fmt" + + "github.com/flanksource/captain/pkg/ai" + "github.com/flanksource/captain/pkg/ai/tracing" +) + +type tracingProvider struct { + provider ai.Provider +} + +func (t *tracingProvider) GetModel() string { return t.provider.GetModel() } +func (t *tracingProvider) GetRuntime() ai.Runtime { return t.provider.GetRuntime() } +func (t *tracingProvider) Unwrap() ai.Provider { return t.provider } + +func (t *tracingProvider) chatOptions(req ai.Request) tracing.ChatOptions { + mode, model := logRuntime(t.provider, req) + return tracing.ChatOptions{ + Model: model, + Provider: t.provider.GetRuntime().Provider, + Mode: mode, + Source: req.Prompt.Source, + } +} + +func (t *tracingProvider) Execute(ctx context.Context, req ai.Request) (*ai.Response, error) { + ctx, chat := tracing.StartChat(ctx, t.chatOptions(req)) + resp, err := t.provider.Execute(ctx, req) + chat.Response(resp) + chat.End(err) + return resp, err +} + +// ExecuteStream forwards every event unchanged, folding each into the call's +// span, and ends the span when the inner stream closes. Once ctx is done the +// consumer may have stopped reading, so the rest of the stream is drained +// rather than forwarded, letting the provider finish closing it. +func (t *tracingProvider) ExecuteStream(ctx context.Context, req ai.Request) (<-chan ai.Event, error) { + streamer, ok := t.provider.(ai.StreamingProvider) + if !ok { + return nil, fmt.Errorf("provider %s/%s does not support streaming", t.provider.GetRuntime(), t.provider.GetModel()) + } + ctx, chat := tracing.StartChat(ctx, t.chatOptions(req)) + in, err := streamer.ExecuteStream(ctx, req) + if err != nil { + chat.End(err) + return nil, err + } + out := make(chan ai.Event, cap(in)) + go func() { + defer close(out) + forwarding := true + for ev := range in { + chat.Observe(ev) + if !forwarding { + continue + } + select { + case out <- ev: + case <-ctx.Done(): + forwarding = false + } + } + chat.End(ctx.Err()) + }() + return out, nil +} + +// WithTracing opens an OpenTelemetry span per model call, with a child span per +// tool call the model makes. +func WithTracing() Option { + return func(p ai.Provider) (ai.Provider, error) { + return &tracingProvider{provider: p}, nil + } +} diff --git a/pkg/ai/middleware/tracing_ginkgo_test.go b/pkg/ai/middleware/tracing_ginkgo_test.go new file mode 100644 index 00000000..21d96204 --- /dev/null +++ b/pkg/ai/middleware/tracing_ginkgo_test.go @@ -0,0 +1,193 @@ +package middleware + +import ( + "context" + "fmt" + + "github.com/flanksource/captain/pkg/ai" + "github.com/flanksource/captain/pkg/api" + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/codes" + sdktrace "go.opentelemetry.io/otel/sdk/trace" + "go.opentelemetry.io/otel/sdk/trace/tracetest" +) + +// eventStubProvider streams a fixed event sequence. +type eventStubProvider struct { + stubProvider + events []ai.Event +} + +func (s eventStubProvider) ExecuteStream(context.Context, ai.Request) (<-chan ai.Event, error) { + ch := make(chan ai.Event) + go func() { + defer close(ch) + for _, ev := range s.events { + ch <- ev + } + }() + return ch, nil +} + +type spanSummary struct { + Name, Parent string + Status codes.Code + Attrs map[string]any +} + +// summarize flattens recorded spans into name, parent name, status and every +// attribute, so a whole span tree compares in one assertion. +func summarize(spans []sdktrace.ReadOnlySpan) []spanSummary { + names := map[string]string{} + for _, s := range spans { + names[s.SpanContext().SpanID().String()] = s.Name() + } + out := make([]spanSummary, 0, len(spans)) + for _, s := range spans { + attrs := map[string]any{} + for _, kv := range s.Attributes() { + attrs[string(kv.Key)] = kv.Value.AsInterface() + } + out = append(out, spanSummary{ + Name: s.Name(), + Parent: names[s.Parent().SpanID().String()], + Status: s.Status().Code, + Attrs: attrs, + }) + } + return out +} + +func recordSpans() *tracetest.SpanRecorder { + recorder := tracetest.NewSpanRecorder() + previous := otel.GetTracerProvider() + otel.SetTracerProvider(sdktrace.NewTracerProvider(sdktrace.WithSpanProcessor(recorder))) + DeferCleanup(otel.SetTracerProvider, previous) + return recorder +} + +func drain(ch <-chan ai.Event) []ai.Event { + var events []ai.Event + for ev := range ch { + events = append(events, ev) + } + return events +} + +var _ = Describe("WithTracing", func() { + const ( + source = "review" + sessionID = "session-1" + respModel = "test-model-2026" + costUSD = 0.25 + ) + stub := stubProvider{} + provider := stub.GetRuntime().Provider + mode := string(stub.GetRuntime().Mode) + request := ai.Request{Prompt: api.Prompt{Source: source}} + + chatAttrs := func(extra map[string]any) map[string]any { + attrs := map[string]any{ + "gen_ai.operation.name": "chat", + "gen_ai.request.model": "test-model", + "gen_ai.provider.name": provider, + "captain.mode": mode, + "captain.prompt.source": source, + } + for k, v := range extra { + attrs[k] = v + } + return attrs + } + toolAttrs := func(name, id string, extra map[string]any) map[string]any { + attrs := map[string]any{ + "gen_ai.operation.name": "execute_tool", + "gen_ai.tool.name": name, + "gen_ai.tool.call.id": id, + } + for k, v := range extra { + attrs[k] = v + } + return attrs + } + usageAttrs := map[string]any{ + "gen_ai.response.model": respModel, + "gen_ai.conversation.id": sessionID, + "gen_ai.usage.input_tokens": int64(10), + "gen_ai.usage.output_tokens": int64(5), + "gen_ai.usage.reasoning_tokens": int64(0), + "gen_ai.usage.cache_read.input_tokens": int64(3), + "gen_ai.usage.cache_creation.input_tokens": int64(0), + "captain.cost_usd": costUSD, + } + + It("streams a chat span with nested tool spans and forwards every event", func() { + recorder := recordSpans() + events := []ai.Event{ + {Kind: ai.EventSystem, SessionID: sessionID}, + {Kind: ai.EventToolUse, Tool: "Agent", ToolCallID: "a"}, + {Kind: ai.EventToolUse, Tool: "Bash", ToolCallID: "b", ParentToolCallID: "a"}, + {Kind: ai.EventToolResult, ToolCallID: "b", Success: true}, + {Kind: ai.EventToolResult, ToolCallID: "a", Success: false}, + {Kind: ai.EventToolUse, Tool: "Read", ToolCallID: "c"}, + {Kind: ai.EventResult, Model: respModel, Usage: &api.Usage{InputTokens: 10, OutputTokens: 5, CacheReadTokens: 3}, CostUSD: costUSD}, + } + p, err := WithTracing()(eventStubProvider{events: events}) + Expect(err).NotTo(HaveOccurred()) + ch, err := p.(ai.StreamingProvider).ExecuteStream(context.Background(), request) + Expect(err).NotTo(HaveOccurred()) + + Expect(drain(ch)).To(Equal(events)) + Expect(summarize(recorder.Ended())).To(Equal([]spanSummary{ + {Name: "execute_tool Bash", Parent: "execute_tool Agent", Status: codes.Unset, Attrs: toolAttrs("Bash", "b", nil)}, + {Name: "execute_tool Agent", Parent: "chat test-model", Status: codes.Error, Attrs: toolAttrs("Agent", "a", nil)}, + {Name: "execute_tool Read", Parent: "chat test-model", Status: codes.Unset, Attrs: toolAttrs("Read", "c", map[string]any{"captain.incomplete": true})}, + {Name: "chat test-model", Status: codes.Unset, Attrs: chatAttrs(usageAttrs)}, + })) + }) + + It("marks a stream that reports an error as failed", func() { + recorder := recordSpans() + p, err := WithTracing()(eventStubProvider{events: []ai.Event{{Kind: ai.EventError, Error: "rate limited"}}}) + Expect(err).NotTo(HaveOccurred()) + ch, err := p.(ai.StreamingProvider).ExecuteStream(context.Background(), request) + Expect(err).NotTo(HaveOccurred()) + drain(ch) + + spans := recorder.Ended() + Expect(spans).To(HaveLen(1)) + Expect([]any{spans[0].Status().Code, spans[0].Status().Description}).To(Equal([]any{codes.Error, "rate limited"})) + }) + + It("drains and closes the stream once the caller's context is cancelled", func() { + recorder := recordSpans() + p, err := WithTracing()(eventStubProvider{events: []ai.Event{{Kind: ai.EventText, Text: "one"}, {Kind: ai.EventText, Text: "two"}}}) + Expect(err).NotTo(HaveOccurred()) + ctx, cancel := context.WithCancel(context.Background()) + ch, err := p.(ai.StreamingProvider).ExecuteStream(ctx, request) + Expect(err).NotTo(HaveOccurred()) + cancel() + + Eventually(recorder.Ended).Should(HaveLen(1)) + Expect(recorder.Ended()[0].Status().Code).To(Equal(codes.Error)) + Eventually(ch).Should(BeClosed()) + }) + + It("records a buffered call's usage and its schema-validation failure", func() { + recorder := recordSpans() + resp := &ai.Response{Model: respModel, Usage: api.Usage{InputTokens: 10, OutputTokens: 5, CacheReadTokens: 3}, CostUSD: costUSD} + p, err := WithTracing()(stubProvider{resp: resp, err: fmt.Errorf("reply: %w", ai.ErrSchemaValidation)}) + Expect(err).NotTo(HaveOccurred()) + _, err = p.Execute(context.Background(), request) + Expect(err).To(MatchError(ai.ErrSchemaValidation)) + + attrs := chatAttrs(usageAttrs) + delete(attrs, "gen_ai.conversation.id") + attrs["error.type"] = "schema_validation" + Expect(summarize(recorder.Ended())).To(Equal([]spanSummary{ + {Name: "chat test-model", Status: codes.Error, Attrs: attrs}, + })) + }) +}) diff --git a/pkg/ai/middleware/validation.go b/pkg/ai/middleware/validation.go index 370c894e..722ce665 100644 --- a/pkg/ai/middleware/validation.go +++ b/pkg/ai/middleware/validation.go @@ -62,7 +62,9 @@ func (v *validatingProvider) Execute(ctx context.Context, req ai.Request) (*ai.R return resp, err } - if strictness == api.SchemaStrictnessNone { + // TypeSafe questions carry no JSON Schema; the jev provider validates its + // native answers itself. + if strictness == api.SchemaStrictnessNone || req.Prompt.OutputSchemaType == api.SchemaTypeTypeSafe { return resp, nil } schema, err := ai.SchemaJSONFor(req.Prompt) @@ -118,8 +120,23 @@ func (v *validatingProvider) effectiveStrictness(req ai.Request) api.SchemaStric // none). A response that is // still invalid after the last attempt is a hard error. func (v *validatingProvider) retryWithFeedback(ctx context.Context, req ai.Request, schema json.RawMessage, verrs string, prev *ai.Response) (*ai.Response, error) { + var usage ai.Usage + var cost float64 + if prev != nil { + usage, cost = prev.Usage, prev.CostUSD + } for attempt := 1; attempt <= maxSchemaRetries; attempt++ { + if prev != nil && prev.Text != "" { + ai.ReportEvent(ctx, ai.Event{Kind: ai.EventText, Text: prev.Text, Model: prev.Model, Rejected: true}) + } + ai.ReportEvent(ctx, ai.Event{Kind: ai.EventSystem, Text: fmt.Sprintf("schema validation failed; repairing response (%d/%d): %s", attempt, maxSchemaRetries, verrs)}) resp, err := v.executeRepair(ctx, req, schema, verrs, prev, attempt) + if resp != nil { + usage, cost = usage.Add(resp.Usage), cost+resp.CostUSD + resp.Usage, resp.CostUSD = usage, cost + } else if err != nil { + resp = prev + } if err != nil { // The provider rejected the corrected output too; feed the new errors // back and keep trying until the retry budget is exhausted. @@ -139,7 +156,7 @@ func (v *validatingProvider) retryWithFeedback(ctx context.Context, req ai.Reque } prev = resp } - return nil, fmt.Errorf("%w: still invalid after %d retries: %s", ai.ErrSchemaValidation, maxSchemaRetries, verrs) + return prev, fmt.Errorf("%w: still invalid after %d repair attempts: %s", ai.ErrSchemaValidation, maxSchemaRetries, verrs) } // responseJSON extracts the raw structured JSON a provider returned: the decoded @@ -163,7 +180,15 @@ func responseJSON(resp *ai.Response) string { // returns a human-readable joined error string (empty when the response conforms), // plus a hard error only when the schema or document could not be loaded/parsed. func validateResponse(schema json.RawMessage, resp *ai.Response) (string, error) { - return ai.ValidateStructuredJSON(schema, responseJSON(resp)) + violations, err := ai.ValidateStructuredJSON(schema, responseJSON(resp)) + var syntax *json.SyntaxError + if errors.As(err, &syntax) && json.Valid(schema) { + if ai.IsMarkdown(responseJSON(resp)) { + return "expected JSON matching the schema, received Markdown: " + err.Error(), nil + } + return err.Error(), nil + } + return violations, err } func (v *validatingProvider) validateResponse(schema json.RawMessage, resp *ai.Response) (string, error) { diff --git a/pkg/ai/middleware/validation_stream.go b/pkg/ai/middleware/validation_stream.go index 7e233fdd..33f0984f 100644 --- a/pkg/ai/middleware/validation_stream.go +++ b/pkg/ai/middleware/validation_stream.go @@ -26,6 +26,7 @@ type streamedTurn struct { // repair turn follows; the rejected answer is the turn's text. rejection *ai.Event failed bool + textShown bool } func (t *streamedTurn) response() *ai.Response { @@ -44,6 +45,7 @@ func forwardTurn(events <-chan ai.Event, out chan<- ai.Event) *streamedTurn { switch ev.Kind { case ai.EventText: turn.text.WriteString(ev.Text) + turn.textShown = true case ai.EventSystem: if ev.SessionID != "" { turn.sessionID = ev.SessionID @@ -52,7 +54,9 @@ func forwardTurn(events <-chan ai.Event, out chan<- ai.Event) *streamedTurn { if strings.HasPrefix(ev.Error, ai.ErrSchemaValidation.Error()) { held := ev turn.rejection = &held - turn.text.WriteString(ev.Text) + if turn.text.Len() == 0 { + turn.text.WriteString(ev.Text) + } continue } turn.failed = true @@ -71,12 +75,12 @@ func forwardTurn(events <-chan ai.Event, out chan<- ai.Event) *streamedTurn { } // ExecuteStream forwards the stream and validates the terminal result against -// the request schema before releasing it. Under "retry" strictness a +// the request schema before releasing it. Under "repair" strictness a // non-conforming result is repaired in further turns that resume the turn's // provider session, so an agent corrects its answer with the context its work // was done in; the released result carries the cost and usage of every turn. -// "error" strictness, and "retry" once its budget is spent, follow the result -// with an EventError that fails the iteration; "warning" only logs. +// "error" strictness, and "repair" once its budget is spent, emit an EventError +// instead of accepting the result; "warning" only logs. func (v *validatingProvider) ExecuteStream(ctx context.Context, req ai.Request) (<-chan ai.Event, error) { streamer, ok := v.provider.(ai.StreamingProvider) if !ok { @@ -84,11 +88,17 @@ func (v *validatingProvider) ExecuteStream(ctx context.Context, req ai.Request) } strictness := v.effectiveStrictness(req) - if v.provider.GetRuntime().Provider == "jev" && strictness == api.SchemaStrictnessRetry { + if v.provider.GetRuntime().Provider == "jev" && strictness == api.SchemaStrictnessRepair { return nil, fmt.Errorf("jev does not support schema repair retries") } + if req.Prompt.OutputSchemaType == api.SchemaTypeTypeSafe { + return streamer.ExecuteStream(ctx, req) + } schema, serr := ai.SchemaJSONFor(req.Prompt) - if strictness == api.SchemaStrictnessNone || serr != nil || len(schema) == 0 { + if serr != nil { + return nil, serr + } + if strictness == api.SchemaStrictnessNone || len(schema) == 0 { return streamer.ExecuteStream(ctx, req) // nothing to validate; forward as-is } @@ -109,6 +119,13 @@ func (v *validatingProvider) validateStream(ctx context.Context, req ai.Request, var cost float64 var usage ai.Usage sawUsage := false + fail := func(message string) { + failure := ai.Event{Kind: ai.EventError, Error: message, CostUSD: cost} + if sawUsage { + failure.Usage = new(usage) + } + out <- failure + } for attempt := 1; ; attempt++ { spent := turn.result if turn.rejection != nil { @@ -121,10 +138,11 @@ func (v *validatingProvider) validateStream(ctx context.Context, req ai.Request, } } if turn.rejection != nil { - if strictness == api.SchemaStrictnessRetry && attempt <= maxSchemaRetries { + turn.showRejected(out) + if strictness == api.SchemaStrictnessRepair && attempt <= maxSchemaRetries { next, err := v.streamRepair(ctx, req, schema, turn.rejection.Error, turn, attempt, out) if err != nil { - out <- ai.Event{Kind: ai.EventError, Error: fmt.Sprintf("%s: repair attempt %d: %v", ai.ErrSchemaValidation, attempt, err)} + fail(fmt.Sprintf("%s: repair attempt %d: %v", ai.ErrSchemaValidation, attempt, err)) return } turn = next @@ -140,19 +158,21 @@ func (v *validatingProvider) validateStream(ctx context.Context, req ai.Request, } verrs, err := v.validateResponse(schema, turn.response()) if err != nil { - out <- ai.Event{Kind: ai.EventError, Error: err.Error()} + turn.showRejected(out) + fail(err.Error()) return } - if verrs != "" && !turn.failed && strictness == api.SchemaStrictnessRetry && attempt <= maxSchemaRetries { + if verrs != "" && !turn.failed && strictness == api.SchemaStrictnessRepair && attempt <= maxSchemaRetries { + turn.showRejected(out) next, err := v.streamRepair(ctx, req, schema, verrs, turn, attempt, out) if err != nil { - out <- ai.Event{Kind: ai.EventError, Error: fmt.Sprintf("%s: repair attempt %d: %v", ai.ErrSchemaValidation, attempt, err)} + fail(fmt.Sprintf("%s: repair attempt %d: %v", ai.ErrSchemaValidation, attempt, err)) return } turn = next continue } - if turn.result != nil { + if turn.result != nil && (verrs == "" || strictness == api.SchemaStrictnessWarning) { result := *turn.result result.CostUSD = cost if sawUsage { @@ -165,7 +185,8 @@ func (v *validatingProvider) validateStream(ctx context.Context, req ai.Request, case strictness == api.SchemaStrictnessWarning: log.Warnf("schema validation failed (%s/%s): %s", v.provider.GetRuntime(), v.provider.GetModel(), verrs) default: - out <- ai.Event{Kind: ai.EventError, Error: fmt.Sprintf("%s: %s", ai.ErrSchemaValidation, verrs)} + turn.showRejected(out) + fail(fmt.Sprintf("%s: %s", ai.ErrSchemaValidation, verrs)) } return } @@ -175,6 +196,7 @@ func (v *validatingProvider) validateStream(ctx context.Context, req ai.Request, // session the rejected turn ran in; a repair routed to another runtime cannot // share that session and runs standalone on the repair prompt alone. func (v *validatingProvider) streamRepair(ctx context.Context, parent ai.Request, schema json.RawMessage, verrs string, prev *streamedTurn, attempt int, out chan<- ai.Event) (*streamedTurn, error) { + out <- ai.Event{Kind: ai.EventSystem, Text: fmt.Sprintf("schema validation failed; repairing response (%d/%d): %s", attempt, maxSchemaRetries, verrs)} req, cfg, useParent, err := v.repairRequest(parent, schema, verrs, prev.response(), attempt) if err != nil { return nil, err @@ -204,3 +226,13 @@ func (v *validatingProvider) streamRepair(ctx context.Context, parent ai.Request } return forwardTurn(events, out), nil } + +func (t *streamedTurn) showRejected(out chan<- ai.Event) { + if !t.textShown && t.text.Len() > 0 { + out <- ai.Event{Kind: ai.EventText, Text: t.text.String(), Rejected: true} + t.textShown = true + } + if t.rejection != nil { + t.rejection.Text = "" + } +} diff --git a/pkg/ai/middleware/validation_stream_test.go b/pkg/ai/middleware/validation_stream_test.go index b05bda88..f5dabfa8 100644 --- a/pkg/ai/middleware/validation_stream_test.go +++ b/pkg/ai/middleware/validation_stream_test.go @@ -148,6 +148,31 @@ func TestValidationStream_RetryRepairsAnAnswerTheProviderRejected(t *testing.T) } } +func TestValidationStream_ForwardsTypeSafeQuestionsUnvalidated(t *testing.T) { + inner := &streamingProvider{results: []string{`{"value":{"product":"Group Life"}}`}} + p, err := WithSchemaValidation()(inner) + if err != nil { + t.Fatalf("WithSchemaValidation: %v", err) + } + req := ai.Request{Prompt: api.Prompt{ + User: "classify", OutputSchemaType: api.SchemaTypeTypeSafe, + TypeSafeQuestions: json.RawMessage(`{"product":{"type":"choice","instructions":"Which?","criteria":{"a":"A","unknown":"U"}}}`), + }} + events, err := p.(ai.StreamingProvider).ExecuteStream(context.Background(), req) + if err != nil { + t.Fatalf("a TypeSafe request has no JSON Schema to validate and must stream as-is: %v", err) + } + var results []ai.Event + for ev := range events { + if ev.Kind == ai.EventResult { + results = append(results, ev) + } + } + if len(results) != 1 || len(inner.requests) != 1 { + t.Fatalf("want one forwarded turn with one result, got %d turns, %d results", len(inner.requests), len(results)) + } +} + func TestValidationStream_RetryFailsAfterTheBudget(t *testing.T) { inner := &streamingProvider{results: []string{overCapJSON}} events := streamWith(t, inner) diff --git a/pkg/ai/middleware/validation_test.go b/pkg/ai/middleware/validation_test.go index b14e6718..9826724e 100644 --- a/pkg/ai/middleware/validation_test.go +++ b/pkg/ai/middleware/validation_test.go @@ -116,6 +116,24 @@ func TestValidation_NoStrictnessSkipsValidation(t *testing.T) { } } +func TestValidation_TypeSafeQuestionsPassThroughUnderStrictness(t *testing.T) { + inner := &scriptedProvider{responses: []string{`{"value":{"product":"Group Life"}}`}} + p, err := WithSchemaValidation()(inner) + if err != nil { + t.Fatalf("WithSchemaValidation: %v", err) + } + req := ai.Request{Prompt: api.Prompt{ + User: "classify", OutputSchemaType: api.SchemaTypeTypeSafe, SchemaStrictness: api.SchemaStrictnessError, + TypeSafeQuestions: json.RawMessage(`{"product":{"type":"choice","instructions":"Which?","criteria":{"a":"A","unknown":"U"}}}`), + }} + if _, err := p.Execute(context.Background(), req); err != nil { + t.Fatalf("a TypeSafe request has no JSON Schema to validate: %v", err) + } + if inner.calls != 1 { + t.Errorf("want 1 provider call, got %d", inner.calls) + } +} + func TestValidation_AnthropicNoStrictnessDefaultsToRetry(t *testing.T) { inner := &scriptedProvider{runtime: ai.RuntimeOf(ai.Anthropic, ai.ModeAPI), responses: []string{overCapJSON, validJSON}} p, err := WithSchemaValidation()(inner) diff --git a/pkg/ai/model_parse_conformance_test.go b/pkg/ai/model_parse_conformance_test.go index 7bb259b0..896349de 100644 --- a/pkg/ai/model_parse_conformance_test.go +++ b/pkg/ai/model_parse_conformance_test.go @@ -58,7 +58,7 @@ var agreedCases = []parseCase{ // Family aliases resolve to the exact current registry model. {in: "sonnet", want: model("claude-sonnet-5-5", api.Anthropic, api.ModeAgent, "")}, {in: "opus", want: model("claude-opus-5-5", api.Anthropic, api.ModeAgent, "")}, - {in: "fable", want: model("claude-fable-5-1", api.Anthropic, api.ModeAgent, "")}, + {in: "fable", want: model("claude-fable-5-2", api.Anthropic, api.ModeAgent, "")}, // A superseded exact id is rewritten to its successor. {in: "claude-sonnet-4-5", want: model("claude-sonnet-4-6", api.Anthropic, api.ModeAgent, "")}, @@ -83,7 +83,7 @@ var agreedCases = []parseCase{ // the bare path went through an alias-blind claim — an accident of which // parser ran, not a decision. {in: "sol", want: model("gpt-6.1-sol", api.OpenAI, api.ModeAgent, "")}, - {in: "terra", want: model("gpt-5.6-terra", api.OpenAI, api.ModeAgent, "")}, + {in: "terra", want: model("gpt-6.1-terra", api.OpenAI, api.ModeAgent, "")}, {in: "luna", want: model("gpt-6-luna", api.OpenAI, api.ModeAgent, "")}, {in: "astra", want: model("gpt-6-astra", api.OpenAI, api.ModeAgent, "")}, {in: "api:astra:high", want: model("gpt-6-astra", api.OpenAI, api.ModeAPI, api.EffortHigh)}, @@ -188,7 +188,7 @@ var _ = Describe("model parse conformance", func() { Expect(err).NotTo(HaveOccurred()) modes := make([]api.RuntimeMode, 0, len(models)) for _, m := range models { - Expect(m.Name).To(Equal("claude-fable-5-1")) + Expect(m.Name).To(Equal("claude-fable-5-2")) Expect(m.Provider).To(Equal(api.Anthropic)) modes = append(modes, m.Mode) } diff --git a/pkg/ai/model_registry_test.go b/pkg/ai/model_registry_test.go index 7b66ef68..340aba2e 100644 --- a/pkg/ai/model_registry_test.go +++ b/pkg/ai/model_registry_test.go @@ -7,13 +7,13 @@ func TestRegistryModelDefsIncludeFableCapabilities(t *testing.T) { defs := RegistryModelDefs(Anthropic, mode) var fable *ModelDef for i := range defs { - if defs[i].ID == "claude-fable-5-1" { + if defs[i].ID == "claude-fable-5-2" { fable = &defs[i] break } } if fable == nil { - t.Fatalf("anthropic %s registry models omit claude-fable-5-1: %+v", mode, defs) + t.Fatalf("anthropic %s registry models omit claude-fable-5-2: %+v", mode, defs) } if !fable.CapabilitiesKnown || !fable.Reasoning || fable.Temperature { t.Fatalf("anthropic %s fable capabilities = %+v", mode, *fable) diff --git a/pkg/ai/prompt/README.md b/pkg/ai/prompt/README.md index bbc86b1e..8aad6fa2 100644 --- a/pkg/ai/prompt/README.md +++ b/pkg/ai/prompt/README.md @@ -26,3 +26,15 @@ Run the focused rendering and transport examples/tests from the Captain checkout go test ./pkg/ai/prompt -run '^TestPromptDocuments$' -ginkgo.focus='Declared prompt rendering' -count=1 go test ./pkg/ai -run '^TestAttachmentCapabilities$' -ginkgo.focus='Named prompt Spec transport' -count=1 ``` + +## DeepSeek image attachments + +`deepseek-flash` accepts PNG, JPEG, GIF, and WebP images. The `deepseek-v4-flash` and `deepseek-v4-flash-vision-exp` names accept the same formats. `deepseek-v4-pro` is text-only; PDF, SVG, audio, and video attachments are rejected. + +Set `DEEPSEEK_API_KEY`, then attach an existing image to a prompt: + +```sh +captain prompt run --model api:deepseek-flash --attach chart.png -p "Describe this chart." +``` + +For Go callers, put references in `Spec.Prompt.Attachments` or user-message attachment parts and resolve them with the attachment store before execution. Captain sends prepared images inline through the existing OpenAI-compatible Chat Completions endpoint; it does not upload them to DeepSeek's Files API. diff --git a/pkg/ai/prompt/document.go b/pkg/ai/prompt/document.go index 23f60575..61cf5dde 100644 --- a/pkg/ai/prompt/document.go +++ b/pkg/ai/prompt/document.go @@ -37,16 +37,52 @@ type Document struct { Warnings []string // Body is the unrendered Handlebars template body. Body string + // Templated reports that the authored frontmatter is a template, so + // Frontmatter and Spec are its rendered view rather than its text. + Templated bool + // RawFrontmatter is the authored frontmatter text, verbatim. + RawFrontmatter string + + // header is the authored source up to the body; declaredYAML is the + // rendered view as Parse decoded it. String re-emits header for a templated + // document whose Frontmatter is unchanged. + header string + declaredYAML string } // Parse splits a .prompt source into frontmatter and body WITHOUT rendering the -// body, then decodes the spec-native frontmatter into Spec. It fails loud on -// malformed YAML or on a spec-native key the spec does not model — the opposite -// of the dotprompt library's ParseDocument, which prints and swallows YAML -// errors. +// body, then decodes the spec-native frontmatter into Spec. A frontmatter whose +// YAML structure is templated is read as declared (see declaredSource). It +// fails loud on a broken frontmatter template, malformed YAML or a spec-native +// key the spec does not model — the opposite of the dotprompt library's +// ParseDocument, which prints and swallows YAML errors. func Parse(source string) (*Document, error) { - frontmatter, body, hasFrontmatter := splitFrontmatter(source) - doc := &Document{Body: body} + declared, err := declaredSource(source) + if err != nil { + return nil, fmt.Errorf("parse prompt frontmatter: %w", err) + } + return parseRendered(source, declared) +} + +// declaredSource is source with its frontmatter as declared before any runtime +// data. Expressions inside YAML values render at run time and stay as +// authored. A frontmatter that is YAML only once rendered — its structure is +// templated, e.g. a `{{#if x}}` line adding a key — is rendered with no +// variables, so such blocks drop out and `{{x}}` renders empty. +func declaredSource(source string) (string, error) { + authored, _, _ := splitFrontmatter(source) + if !strings.Contains(authored, "{{") || yaml.Unmarshal([]byte(authored), new(any)) == nil { + return source, nil + } + return RenderFrontmatter(source, map[string]any{}) +} + +// parseRendered decodes rendered, the source with its frontmatter already +// rendered, keeping the authored text of source for reserialization. +func parseRendered(source, rendered string) (*Document, error) { + authored, body, _ := splitFrontmatter(source) + frontmatter, _, hasFrontmatter := splitFrontmatter(rendered) + doc := &Document{Body: body, RawFrontmatter: authored, header: source[:len(source)-len(body)]} if !hasFrontmatter || strings.TrimSpace(frontmatter) == "" { return doc, nil } @@ -55,6 +91,13 @@ func Parse(source string) (*Document, error) { return nil, fmt.Errorf("parse prompt frontmatter: %w", err) } doc.Frontmatter = raw + if frontmatter != authored { + declaredYAML, err := yaml.Marshal(raw) + if err != nil { + return nil, fmt.Errorf("marshal declared prompt frontmatter: %w", err) + } + doc.Templated, doc.declaredYAML = true, string(declaredYAML) + } runtimes, err := decodePromptRuntimes(raw) if err != nil { return nil, fmt.Errorf("decode prompt runtimes: %w", err) @@ -164,15 +207,23 @@ func decodePromptRuntimes(raw map[string]any) ([]api.Model, error) { // String reserializes the document to .prompt text: "---\n\n---\n", // or the body alone when there is no frontmatter. The output satisfies the -// dotprompt frontmatter grammar so Parse can read it back. +// dotprompt frontmatter grammar so Parse can read it back. A templated +// document re-emits its authored frontmatter; once its Frontmatter is edited it +// cannot be reserialized without losing the template, which is an error. func (d *Document) String() (string, error) { - if len(d.Frontmatter) == 0 { + if len(d.Frontmatter) == 0 && !d.Templated { return d.Body, nil } y, err := yaml.Marshal(d.Frontmatter) if err != nil { return "", fmt.Errorf("marshal prompt frontmatter: %w", err) } + if d.Templated { + if string(y) != d.declaredYAML { + return "", fmt.Errorf("cannot reserialize edited templated frontmatter without losing its template; edit RawFrontmatter instead") + } + return d.header + d.Body, nil + } return "---\n" + string(y) + "---\n" + d.Body, nil } diff --git a/pkg/ai/prompt/document_test.go b/pkg/ai/prompt/document_test.go index e015ab5b..e403b220 100644 --- a/pkg/ai/prompt/document_test.go +++ b/pkg/ai/prompt/document_test.go @@ -153,3 +153,39 @@ func TestRender_RuntimeProfilePin(t *testing.T) { assert.Equal(t, "claude-sonnet-4-6", req.Model.Name) assert.Equal(t, "hello", req.Prompt.User) } + +// A templated frontmatter parses to its declared view (rendered with no +// variables) and, unedited, reserializes to the authored source byte-for-byte. +func TestParse_TemplatedFrontmatter(t *testing.T) { + src := "---\nmodel: claude-sonnet-4-6\n" + templatedSchema + "\n---\n{{role \"user\"}}\nGroup {{table}}.\n" + + doc, err := Parse(src) + require.NoError(t, err) + assert.True(t, doc.Templated) + assert.Equal(t, "claude-sonnet-4-6", doc.Spec.Model.Name) + assert.Equal(t, map[string]any{"schema": map[string]any{"type": "array", "minItems": 1}}, doc.Frontmatter["output"]) + + out, err := doc.String() + require.NoError(t, err) + assert.Equal(t, src, out) + + doc.Frontmatter["model"] = "claude-haiku-4-5" + _, err = doc.String() + assert.ErrorContains(t, err, "templated frontmatter") +} + +// Expressions inside YAML values render at run time, so Parse keeps them as +// authored instead of rendering them away. +func TestParse_KeepsExpressionsInsideValues(t *testing.T) { + src := "---\nprompt:\n system: >-\n Review #{{number}} in {{workDir}}.\n {{#if linters}}Linters: {{linters}}.{{/if}}\n---\nbody\n" + + doc, err := Parse(src) + require.NoError(t, err) + assert.False(t, doc.Templated) + assert.Equal(t, "Review #{{number}} in {{workDir}}. {{#if linters}}Linters: {{linters}}.{{/if}}", doc.Spec.Prompt.System) +} + +func TestParse_TemplatedFrontmatterRenderError(t *testing.T) { + _, err := Parse("---\nmodel: x\n{{#if open}}\n---\nbody\n") + assert.ErrorContains(t, err, "frontmatter template") +} diff --git a/pkg/ai/prompt/hook.go b/pkg/ai/prompt/hook.go index 4c840e3e..658320fa 100644 --- a/pkg/ai/prompt/hook.go +++ b/pkg/ai/prompt/hook.go @@ -55,8 +55,14 @@ type HookSpec struct { } // Hook returns the template's `hook:` frontmatter, or nil when it declares none. +// It reads the declared frontmatter (declaredSource), so a prompt that +// templates other keys is not mistaken for a broken one. func (t *Template) Hook() (*HookSpec, error) { - loc := frontmatterRe.FindStringSubmatch(t.source) + declared, err := declaredSource(t.source) + if err != nil { + return nil, &HookParseError{Prompt: t.name, Err: err} + } + loc := frontmatterRe.FindStringSubmatch(declared) if loc == nil { return nil, nil } @@ -64,7 +70,7 @@ func (t *Template) Hook() (*HookSpec, error) { Hook *HookSpec `yaml:"hook"` } if err := yaml.Unmarshal([]byte(loc[1]), &fm); err != nil { - return nil, fmt.Errorf("parse prompt %s frontmatter: %w", t.name, err) + return nil, &HookParseError{Prompt: t.name, Err: err} } if fm.Hook == nil || fm.Hook.Disabled { return fm.Hook, nil diff --git a/pkg/ai/prompt/hook_discover.go b/pkg/ai/prompt/hook_discover.go new file mode 100644 index 00000000..bf661966 --- /dev/null +++ b/pkg/ai/prompt/hook_discover.go @@ -0,0 +1,80 @@ +package prompt + +import ( + "fmt" + "io/fs" + "maps" + "path" + "slices" + "strings" +) + +// HookSource is one place hook prompts are discovered from; Label names it in +// errors and provenance. +type HookSource struct { + FS fs.FS + Label string +} + +// HookFile is one discovered hook prompt for an event, before the event owner +// validates and compiles it. +type HookFile struct { + // Name is the prompt file's base name without .prompt. + Name string + // Source is where the hook was loaded from: "