skip to content
$registry / workers

pi

v0.1.35

pi coding agent as an iii worker — pi::run drives headless turns and pi::terminal::* runs the same agent in a shell::pty session on its own console page. Both publish raw events on the pi::raw-event trigger type and AgentEvent frames on pi::agent-event.

worker
iiiverified
79 installs0 in 7d0 today
install
$iii trigger compose::add worker=pi

exact versions are immutable; binary and bundle artifacts are digest-pinned.

functions

14

pi::auth::status

function

Check which providers a pi terminal on this host can use. Reports the credential kind, a subscription login or an API key, read from `pi auth check`; never returns the credential itself.

request
empty object
response
  • billingstringrequiredenum: subscription, api-key, none, unknown
  • detailstringrequired
  • labelstringrequired
  • providerstring
  • providersobject[]
    • kindstringenum: , subscription, api-key
    • providerstring
    • readyboolean
    • reasonstring
  • readyboolean
  • reasonstring

pi::follow_up

function

Queue a follow-up message for a live Pi run; processed after the agent would otherwise stop.

request
  • promptstringrequired

    Instruction to inject into the live run

  • session_idstringrequired

    iii session id of a live run

response
  • queuedbooleanrequired
  • reasonstring
  • session_idstringrequired

pi::on-config-change

function

Internal: reload pi configuration when it changes.

request
empty object
response
valuenull

pi::run

function

Run one Pi coding-agent turn and wait for the result. Accepts `prompt` or a `messages` array; publishes raw Pi events on the pi::raw-event trigger type and AgentEvent frames on pi::agent-event (bind with { session_id }), and returns {session_id, result, usage, total_cost_usd}.

request
  • cwdstring

    Working directory the turn runs in

  • iii_contextboolean

    Prepend the iii runtime discovery context (engine catalog via the iii CLI)

  • messagesobject[]

    Alternative to prompt: role/content messages; the last user entry becomes the prompt

    • contentany ofrequired
      any of (2)
      variant 1
      valuestring
      variant 2
      itemsobject[]
      • typestringrequired
    • rolestringrequired
  • modelstring

    Model as "provider/modelId"; empty = Pi settings default

  • parent_session_idstring

    The session delegating this run. Written to the child session metadata, which is what nests it under its parent in the console — the same link a harness sub-agent carries.

  • promptstring

    The user prompt for this turn

  • session_idstring

    iii session id; reuse to resume the same Pi conversation

  • thinking_levelstringenum: off, minimal, low, medium, high, xhigh

    Reasoning depth for this turn

  • timeout_msintegermax 9007199254740991

    Reserved for callers; not forwarded

  • toolsstring[]

    Tool allowlist; empty = Pi defaults (read, bash, edit, write)

response
  • busyboolean
  • is_errorboolean
  • num_turnsnumber
  • pi_session_idany of
    any of (2)
    variant 1
    valuestring
    variant 2
    valuenull
  • reasonstring
  • resultstring
  • session_idstringrequired
  • stop_reasonstring
  • total_cost_usdnumber
  • usageany of
    any of (2)
    variant 1
    • cache_read_tokensnumber
    • cache_write_tokensnumber
    • input_tokensnumberrequired
    • output_tokensnumberrequired
    variant 2
    valuenull

pi::sessions::list

function

List every Pi session this worker has run.

request
empty object
response
  • sessionsobject[]required
    • cwdstringrequired
    • modelstringrequired
    • pi_session_idany ofrequired
      any of (2)
      variant 1
      valuestring
      variant 2
      valuenull
    • session_fileany ofrequired
      any of (2)
      variant 1
      valuestring
      variant 2
      valuenull
    • session_idstringrequired
    • statusstringrequiredenum: working, done, error
    • total_cost_usdnumberrequired
    • turnsnumberrequired
    • updated_at_msnumberrequired
    • usageany ofrequired
      any of (2)
      variant 1
      • cache_read_tokensnumber
      • cache_write_tokensnumber
      • input_tokensnumberrequired
      • output_tokensnumberrequired
      variant 2
      valuenull

pi::start

function

Start a Pi turn and return immediately; bind pi::agent-event with { session_id } for progress and turn_end.

request
  • cwdstring

    Working directory the turn runs in

  • iii_contextboolean

    Prepend the iii runtime discovery context (engine catalog via the iii CLI)

  • messagesobject[]

    Alternative to prompt: role/content messages; the last user entry becomes the prompt

    • contentany ofrequired
      any of (2)
      variant 1
      valuestring
      variant 2
      itemsobject[]
      • typestringrequired
    • rolestringrequired
  • modelstring

    Model as "provider/modelId"; empty = Pi settings default

  • parent_session_idstring

    The session delegating this run. Written to the child session metadata, which is what nests it under its parent in the console — the same link a harness sub-agent carries.

  • promptstring

    The user prompt for this turn

  • session_idstring

    iii session id; reuse to resume the same Pi conversation

  • thinking_levelstringenum: off, minimal, low, medium, high, xhigh

    Reasoning depth for this turn

  • timeout_msintegermax 9007199254740991

    Reserved for callers; not forwarded

  • toolsstring[]

    Tool allowlist; empty = Pi defaults (read, bash, edit, write)

response
  • busyboolean
  • reasonstring
  • session_idstringrequired
  • startedbooleanrequired

pi::status

function

Check the status of a Pi session.

request
  • session_idstringrequired

    iii session id returned by pi::run / pi::start

response
  • livebooleanrequired
  • recordany ofrequired
    any of (2)
    variant 1
    • cwdstringrequired
    • modelstringrequired
    • pi_session_idany ofrequired
      … expand 2 nested
      any of (2)
      variant 1
      valuestring
      variant 2
      valuenull
    • session_fileany ofrequired
      … expand 2 nested
      any of (2)
      variant 1
      valuestring
      variant 2
      valuenull
    • session_idstringrequired
    • statusstringrequiredenum: working, done, error
    • total_cost_usdnumberrequired
    • turnsnumberrequired
    • updated_at_msnumberrequired
    • usageany ofrequired
      … expand 2 nested
      any of (2)
      variant 1
      • cache_read_tokensnumber
      • cache_write_tokensnumber
      • input_tokensnumberrequired
      • output_tokensnumberrequired
      variant 2
      valuenull
    variant 2
    valuenull
  • session_idstringrequired

pi::steer

function

Inject a steering instruction into a live Pi run; applied after the current tool calls finish.

request
  • promptstringrequired

    Instruction to inject into the live run

  • session_idstringrequired

    iii session id of a live run

response
  • reasonstring
  • session_idstringrequired
  • steeredbooleanrequired

pi::stop

function

Stop a live Pi run for a session.

request
  • session_idstringrequired

    iii session id returned by pi::run / pi::start

response
  • reasonstring
  • session_idstringrequired
  • stoppedbooleanrequired

pi::task

function

Delegate one task to Pi and return its session id immediately — the sub-agent shape: it never parks the caller. The outcome is written to state under scope `agent_tasks`, key the child session id, so bind a `state` trigger on that BEFORE calling and be woken by it; progress arrives on pi::agent-event (bind with { session_id }). Pass `parent_session_id` to nest the child under the session that delegated it.

request
  • cwdstring

    Working directory the turn runs in

  • iii_contextboolean

    Prepend the iii runtime discovery context (engine catalog via the iii CLI)

  • modelstring

    Model as "provider/modelId"; empty = Pi settings default

  • parent_session_idstring

    The session delegating this run. Written to the child session metadata, which is what nests it under its parent in the console — the same link a harness sub-agent carries.

  • session_idstring

    iii session id; reuse to resume the same Pi conversation

  • taskstringrequiredmin 1 chars

    The child's self-contained goal. It cannot see the caller's context, so name every resource it needs.

  • thinking_levelstringenum: off, minimal, low, medium, high, xhigh

    Reasoning depth for this turn

  • timeout_msintegermax 9007199254740991

    Reserved for callers; not forwarded

  • toolsstring[]

    Tool allowlist; empty = Pi defaults (read, bash, edit, write)

response
  • busyboolean
  • reasonstring
  • session_idstringrequired
  • startedbooleanrequired

pi::terminal::activity

function

A pi lifecycle event from a terminal session (session_start, agent_start, tool_start, tool_end, agent_end, session_end), posted by the workspace extension. Translated into AgentEvent frames on the pi::agent-event feed.

request
  • argsobject
  • call_idstring
  • cwdstring
  • eventstring
  • is_errorboolean
  • promptstring
  • resultunknown
  • session_idstring
  • toolstring
response
  • eventstringrequired
  • okbooleanrequired

pi::terminal::describe

function

What a Pi terminal session runs: the pi binary, its argv, the workspace directory, and the session environment. The console page passes this straight to shell::pty::open.

request
empty object
response
  • activity_bridgestring

    The `iii` CLI on the terminal host that carries this session's activity to the bus. Empty means nothing will reach the pi::agent-event feed.

  • argsstring[]required
  • cwdstringrequired
  • detailstring

    Anything wrong that does not stop a session from opening.

  • envobjectrequired
  • programstringrequired

pi::ui-content

function

Console UI asset content (console plumbing).

request
  • pathstringrequired
response
  • contentstringrequired
  • content_typestring

run::start_and_wait

function

Alias for pi::run under the shared agent entrypoint: run a turn for {session_id, messages} and return when it ends.

request
  • cwdstring

    Working directory the turn runs in

  • iii_contextboolean

    Prepend the iii runtime discovery context (engine catalog via the iii CLI)

  • messagesobject[]

    Alternative to prompt: role/content messages; the last user entry becomes the prompt

    • contentany ofrequired
      any of (2)
      variant 1
      valuestring
      variant 2
      itemsobject[]
      • typestringrequired
    • rolestringrequired
  • modelstring

    Model as "provider/modelId"; empty = Pi settings default

  • parent_session_idstring

    The session delegating this run. Written to the child session metadata, which is what nests it under its parent in the console — the same link a harness sub-agent carries.

  • promptstring

    The user prompt for this turn

  • session_idstring

    iii session id; reuse to resume the same Pi conversation

  • thinking_levelstringenum: off, minimal, low, medium, high, xhigh

    Reasoning depth for this turn

  • timeout_msintegermax 9007199254740991

    Reserved for callers; not forwarded

  • toolsstring[]

    Tool allowlist; empty = Pi defaults (read, bash, edit, write)

response
  • busyboolean
  • is_errorboolean
  • num_turnsnumber
  • pi_session_idany of
    any of (2)
    variant 1
    valuestring
    variant 2
    valuenull
  • reasonstring
  • resultstring
  • session_idstringrequired
  • stop_reasonstring
  • total_cost_usdnumber
  • usageany of
    any of (2)
    variant 1
    • cache_read_tokensnumber
    • cache_write_tokensnumber
    • input_tokensnumberrequired
    • output_tokensnumberrequired
    variant 2
    valuenull

triggers

2

pi::agent-event

trigger

Translated AgentEvent frames of one Pi session (pi::run, pi::start, pi::task, run::start_and_wait and the console terminal). Config: { session_id, metadata? }. Payload: { session_id, event_id, seq, epoch, source, event }. Ephemeral: not stored or replayed.

invocation
valueunknown
return
valueunknown

pi::raw-event

trigger

Raw Pi AgentSession events (agent_start/end, turn_start/end, message_start/update/end, tool_execution_*, queue_update, compaction_*) of one session, verbatim. Config: { session_id, metadata? }. Payload: { session_id, event_id, seq, epoch, source, event }. Ephemeral: not stored or replayed.

invocation
valueunknown
return
valueunknown