Agent-directed control for a linear packet run.
A provider may request that Prompt Runner continue to the next prompt, repeat the current prompt in a fresh session, finish the selected sequence, or stop because progress is blocked. Requests are scoped to one prompt iteration and are consumed only after that iteration satisfies its ordinary verifier.
Successful early finish remains verifier-owned: the packet's
completion_verify contract must pass before the runner accepts finish.
Summary
Functions
Adds the invocation variables to the provider subprocess environment.
Runs the packet-level completion contract.
Returns the normalized packet configuration.
Reads and authenticates the request for one invocation.
Appends the linear-control instructions sent to the provider.
Whether the plan enables agent-directed execution.
Creates one fresh request scope for a prompt iteration.
Writes one directive from inside the provider subprocess.
Returns the explicit request or the configured default.
Types
@type action() :: :continue | :repeat | :finish | :blocked
@type config() :: %{ enabled?: boolean(), default_action: :continue | :repeat, max_iterations: pos_integer(), completion_verify: map() }
@type invocation() :: %{ request_file: String.t(), token: String.t(), run_id: String.t(), prompt_id: String.t(), iteration: pos_integer() }
Functions
@spec attach_llm(map(), invocation()) :: map()
Adds the invocation variables to the provider subprocess environment.
@spec completion_report(PromptRunner.Plan.t(), config()) :: PromptRunner.Verifier.report()
Runs the packet-level completion contract.
@spec config(PromptRunner.Plan.t() | map() | nil) :: {:ok, config()} | {:error, term()}
Returns the normalized packet configuration.
@spec consume(invocation()) :: {:ok, map() | nil} | {:error, term()}
Reads and authenticates the request for one invocation.
@spec decorate_prompt(String.t(), invocation(), config(), map() | nil) :: String.t()
Appends the linear-control instructions sent to the provider.
@spec enabled?(PromptRunner.Plan.t()) :: boolean()
Whether the plan enables agent-directed execution.
@spec prepare(String.t(), String.t(), String.t(), pos_integer()) :: {:ok, invocation()} | {:error, term()}
Creates one fresh request scope for a prompt iteration.
Writes one directive from inside the provider subprocess.
Returns the explicit request or the configured default.