PromptRunner.Config (PromptRunnerSDK v0.12.1)

Copy Markdown View Source

Loads and normalizes configuration for the prompt runner.

Summary

Types

t()

The settings that decide what a reader sees while a run is happening.

Functions

Builds the LLM configuration map for a specific prompt by deep-merging root-level defaults with per-prompt overrides.

The live view settings in force for this config.

Types

optional_path()

@type optional_path() :: String.t() | nil

repo_config()

@type repo_config() :: %{name: String.t(), path: String.t(), default: boolean()}

t()

@type t() :: %PromptRunner.Config{
  adapter_opts: map(),
  allowed_tools: list() | nil,
  amp_opts: map(),
  antigravity_opts: map(),
  append_system_prompt: String.t() | nil,
  claude_opts: map(),
  cli_confirmation: :off | :warn | :require,
  codex_opts: map(),
  codex_thread_opts: map(),
  commit_messages_file: optional_path(),
  config_dir: String.t(),
  cursor_opts: map(),
  events_mode: :compact | :full | :off,
  llm_sdk: PromptRunner.LLM.sdk(),
  log_dir: optional_path(),
  log_meta: :none | :full,
  max_turns: pos_integer() | nil,
  model: String.t(),
  permission_mode: atom() | nil,
  phase_names: map(),
  progress_file: optional_path(),
  project_dir: String.t() | nil,
  prompt_overrides: map(),
  prompts_file: optional_path(),
  repo_groups: map(),
  sdk_opts: map(),
  system_prompt: String.t() | map() | nil,
  target_repos: [repo_config()] | nil,
  timeout: pos_integer() | :unbounded | :infinity | nil,
  view: view()
}

view()

@type view() :: %{
  log_mode: :compact | :verbose | :studio,
  tool_output: :summary | :preview | :full,
  thinking: :show | :hide,
  diff: :none | :stat | :full
}

The settings that decide what a reader sees while a run is happening.

Grouped rather than spread across the struct because they are one concept: PromptRunner.Control.set_view/3 changes exactly these, live, and PromptRunner.Control.Snapshot reports exactly these back.

Functions

llm_for_prompt(config, prompt)

@spec llm_for_prompt(t(), map()) :: map()

Builds the LLM configuration map for a specific prompt by deep-merging root-level defaults with per-prompt overrides.

load(config_path)

@spec load(String.t()) :: {:ok, t()} | {:error, term()}

view(config)

@spec view(t()) :: view()

The live view settings in force for this config.

with_overrides(config, opts)

@spec with_overrides(
  t(),
  keyword()
) :: t()