The public surface

This page is the 1.0 public-surface freeze (#701, #280): everything that crosses the install boundary of the @gadhs/pi distribution, its tier, and the rule governing changes to it (Stability from 1.0).

  • stable: bound by SemVer from @gadhs/pi 1.0.0. Covers config files and their keys, slash commands and tools, environment variables an operator sets, the bus channels a sibling extension consumes, the versioned wires, and @gadhs/pi’s own exports (@gadhs/pi/bus-rules.json` and @gadhs/pi/package.json). Breaking changes require a major version of @gadhs/pi and a === Breaking section in CHANGELOG.adoc.

  • internal: may change in any release with no semver promise. Covers all ten private sibling workspace packages and their exports (they are not published standalone, #836), names pi sets for a child process, facts read from the environment, and the records below.

  • upstream: owned elsewhere and pinned: pi’s own settings, tools and variables, `@gotgenes/pi-permission-system’s events, and the pivot wire.

tools/lib/test/public-surface.test.mjs holds this page and the code in step during validate (tools/lib/public-surface.mjs):

  • Names: each kind is read from shipped root-level .ts and .mjs files and compared against this page; any item missing on either side fails validate.

  • Tools and slash commands: each package that registers stable tools or commands holds their names, parameter schemas (prose descriptions stripped) and command descriptions against a committed test/fixtures/surface.json record; validate checks that the recorded sets match the page’s stable rows.

  • Bus channels and wires: every stable bus channel and wire constant has a contract: <item> test asserting its payload shape or version refusal; validate fails when a stable row has none.

  • Package exports: every .ts file targeted by a package’s exports map carries the internal-export notice in its header comment; validate fails when a target omits it.

The records at the end are listed, not checked.

Configuration files

Per-user files under the agent dir (~/.pi/agent, or $PI_CODING_AGENT_DIR).

Item Defined in Documented in Tier

gadhs-pi-modes.json

pi-modes/config.ts (resolveOverlayPath)

modes, tuning

stable

gadhs-pi-workflow.json

pi-workflow/workflow-config.ts

tuning

stable

gadhs-pi-agents.json

pi-agents/index.ts (loadAgentOverrides)

tuning

stable

gadhs-pi-remote.json

pi-remote/config.ts

remote

stable

pi-ssh.json

pi-ssh/config.ts

ssh

stable

gadhs-pi-shellcheck.json

pi-shellcheck/config.ts

shell guard

stable

vertex-models.json

pi-vertex/config.ts

vertex

stable

subagents.json

pi-subagents' own; read by pi-modes/helper-retention.ts

tuning

upstream

gadhs-memory.json

pi-modes/memory-wiring.ts; written by remember and /memory

modes

internal

The modes overlay’s keys are the two summary tables in Workflow Modes (ModesConfig, ModeDescriptor), which this check holds to OVERLAY_KEYS in pi-modes/config.ts. Every block with a fixed key set refuses an unknown key by name; modelRoles refuses unknown role names (accepting the known roles, mode:<id> for a declared mode, and helper:<name>, #1040); and the two maps keyed by the operator’s own names (permission, subagentPolicy.profiles) take any key. The other files' keys:

gadhs-pi-workflow.json

reviewTimeoutMs, reviewContextMaxFileBytes, reviewContextMaxTotalBytes, reviewContextMaxFiles, reviewSnapshotMaxCalls, reviewSnapshotMaxBytes, planReviewSnapshotMaxCalls, planReviewSnapshotMaxBytes, reviewThinking, commitReviewer, planSecondReviewer, coAuthorEmail, reviewDataPaths.

gadhs-pi-agents.json

models, maxTurns.

gadhs-pi-remote.json

relay, boxName, spaces (allow), agent.

pi-ssh.json

autoForward, node.

gadhs-pi-shellcheck.json

enabled, block, warn, ignore, timeoutMs, binary.

vertex-models.json

models, defaults (contextWindow, maxTokens, input, cost), adcRetry (intervalMs, maxWaitMs), project.

subagents.json

consumedSessionRetentionMinutes, the one key pi-modes reads.

Slash commands

Item Defined in Documented in Tier

/mode

pi-modes/command-wiring.ts

modes

stable

/diag

pi-modes/command-wiring.ts

diagnostics

stable

/gadhs-reset

pi-modes/command-wiring.ts

modes

stable

/remember

pi-modes/memory-wiring.ts

modes

stable

/memory

pi-modes/memory-wiring.ts

modes

stable

/hub

pi-modes/hub-wiring.ts

judge

stable

/pending

pi-modes/judge-wiring.ts

judge

stable

/ssh

pi-ssh/extension.ts

ssh

stable

/gadhs-init

pi-guidance/index.ts

session

stable

/remote-control

pi-remote/index.ts

remote

stable

Tools

Item Defined in Documented in Tier

ask

pi-modes/command-wiring.ts

plan mode

stable

count

pi-modes/command-wiring.ts

tools

stable

generate_image

pi-modes/command-wiring.ts

tools

stable

enter_plan_mode

pi-modes/plan-tools.ts

plan mode

stable

exit_plan_mode

pi-modes/plan-tools.ts

plan mode

stable

pending_withdraw

pi-modes/judge-wiring.ts

judge

stable

queue_question

pi-modes/question-wiring.ts

judge

stable

remember

pi-modes/memory-wiring.ts

modes

stable

forget

pi-modes/memory-wiring.ts

modes

stable

monitor

pi-modes/monitor-tools.ts

tools

stable

monitor_stop

pi-modes/monitor-tools.ts

tools

stable

monitor_list

pi-modes/monitor-tools.ts

tools

stable

monitor_restore

pi-modes/monitor-tools.ts

tools

stable

job

pi-modes/job-tools.ts

tools

stable

job_stop

pi-modes/job-tools.ts

tools

stable

job_list

pi-modes/job-tools.ts

tools

stable

yield

pi-modes/subagent-wiring.ts

helpers

stable

msg_channels

pi-remote/msg-tools.ts

remote

stable

msg_handle

pi-remote/msg-tools.ts

remote

stable

msg_subscribe

pi-remote/msg-tools.ts

remote

stable

msg_post

pi-remote/msg-tools.ts

remote

stable

msg_read

pi-remote/msg-tools.ts

remote

stable

read

pi’s own, re-registered by pi-ssh/extension.ts to switch local or remote

ssh

upstream

write

pi’s own, re-registered by pi-ssh/extension.ts

ssh

upstream

edit

pi’s own, re-registered by pi-ssh/extension.ts

ssh

upstream

ls

pi’s own, re-registered by pi-ssh/extension.ts

ssh

upstream

grep

pi’s own, re-registered by pi-ssh/extension.ts

ssh

upstream

find

pi’s own, re-registered by pi-ssh/extension.ts

ssh

upstream

bash

pi’s own, re-registered sequential by pi-ssh/extension.ts, or by pi-workflow/batch-order.ts when pi-ssh is off, its output capped (#717)

ssh, modes

upstream

powershell

pi’s own, re-registered by pi-ssh/extension.ts with its output capped (#717); local only, and active only where pi’s defaultTools names it

ssh

upstream

Environment variables

Every variable a shipped source reads. A row ending in * is a family read through one template.

Item Defined in Documented in Tier

GADHS_PI_MODES_CONFIG

pi-modes/config.ts: the modes overlay’s path

modes

stable

GADHS_PI_DIAGNOSTICS

pi-modes/diagnostics.ts: the diagnostics stream’s path, or off

diagnostics

stable

GADHS_PI_TUI_PATCH

pi-modes/lone-escape.ts: off leaves pi-tui unpatched

session

stable

GADHS_PI_SHELL_TIMEOUT_S

pi-modes/shell-timeout.ts: the default timeout for a bash or powershell call that passes none

modes

stable

PI_CACHE_RETENTION

pi-modes/cache-retention.ts: pi-ai’s own switch, set to long when the overlay’s cacheRetention asks for the hour tier; one already set wins

tuning

stable

GADHS_PI_SSH

pi-ssh/extension.ts: off registers no pi-ssh

ssh

stable

GADHS_PI_SSH_*

pi-ssh/helper.mjs: the helper’s IDLE_MS, RESUME_BYTES, FINISHED_KEEP_MS, DAEMON_START_MS

ssh

stable

GADHS_PIVOT_RELAY

pi-remote/config.ts: the relay’s URL

remote

stable

VERTEX_CONFIG

pi-vertex/config.ts: the Vertex catalogue’s path

vertex

stable

ANTHROPIC_VERTEX_PROJECT_ID

pi-vertex/config.ts: the Google Cloud project

vertex

stable

GOOGLE_CLOUD_PROJECT

pi-vertex/config.ts: the project, next in line

vertex

stable

GCLOUD_PROJECT

pi-vertex/config.ts: the project, last in line

vertex

stable

PROJECT

pi-vertex/probe.mjs: the probe’s project, before the three above

this page

stable

GOOGLE_APPLICATION_CREDENTIALS

pi-vertex/adc-client.ts: the ADC file

vertex

stable

CLOUDSDK_CONFIG

pi-vertex/adc-client.ts: gcloud’s moved config dir

vertex

stable

GITLAB_TOKEN

pi-modes/time-spent.ts, pi-workflow/glab-ambient.ts: the forge token

workflow guards

stable

GITLAB_ACCESS_TOKEN

the same two: the token’s other name

workflow guards

stable

GLAB_CONFIG_DIR

pi-workflow/glab-ambient.ts: glab’s config dir

workflow guards

stable

OTEL_SDK_DISABLED

pi-modes/otel-export.ts

diagnostics

stable

OTEL_EXPORTER_OTLP_ENDPOINT

pi-modes/otel-export.ts

diagnostics

stable

OTEL_EXPORTER_OTLP_TRACES_ENDPOINT

pi-modes/otel-export.ts

diagnostics

stable

OTEL_EXPORTER_OTLP_PROTOCOL

pi-modes/otel-export.ts

diagnostics

stable

OTEL_EXPORTER_OTLP_TRACES_PROTOCOL

pi-modes/otel-export.ts

diagnostics

stable

OTEL_EXPORTER_OTLP_HEADERS

pi-modes/otel-export.ts

diagnostics

stable

OTEL_EXPORTER_OTLP_TRACES_HEADERS

pi-modes/otel-export.ts

diagnostics

stable

OTEL_INSTRUMENTATION_GENAI_CAPTURE_CONTENT

pi-modes/otel-export.ts

diagnostics

stable

OTEL_SERVICE_NAME

pi-modes/otel-export.ts

diagnostics

stable

PI_CODING_AGENT_DIR

pi’s own: the agent dir

pi’s docs

upstream

XDG_CONFIG_HOME

read only to find where pi-web-access keeps web-search.json, by its own rule (pi-agents/web-search-seed.ts)

tuning

upstream

XDG_RUNTIME_DIR

pi-modes/authorize-paths.ts: when absolute on POSIX, treated as a temp home the outside-write row stands back for so the judge decides (#943)

modes

upstream

PI_OFFLINE

pi’s own: no downloads (pi-ssh/remote-tools.ts, pi-shellcheck/extension.ts)

pi’s docs

upstream

PI_SESSION_ID

set by pi for its bash; forwarded to a remote by pi-workspace/env.ts

ssh

internal

PI_PROVIDER

set by pi; forwarded by pi-workspace/env.ts

ssh

internal

PI_MODEL

set by pi; forwarded by pi-workspace/env.ts

ssh

internal

PI_REASONING_LEVEL

set by pi; forwarded by pi-workspace/env.ts

ssh

internal

PIP_INDEX_URL

pi-modes/registry-facts.ts: a private PyPI index, read as a fact

modes

internal

UV_INDEX_URL

pi-modes/registry-facts.ts: the same, for uv

modes

internal

UV_DEFAULT_INDEX

pi-modes/registry-facts.ts: the same, uv’s newer name

this page

internal

PYTHON_BASIC_REPL

pi-workspace/command-file.ts: set to 1 for each Windows bash command unless the caller set it, so a python - with nothing to read exits (#711); pi-modes/monitor-process.ts likewise for monitors and jobs (#713)

ssh, tools

internal

WSLENV

pi-modes/monitor-registry.ts: extended so a WSL monitor sees its markers

tools

internal

VTE_VERSION

pi-modes/session-wiring.ts: picks the desktop notification’s escape

this page

internal

TERM

pi-modes/diagnostics.ts: a terminal fact for the stream

diagnostics

internal

TMUX

pi-modes/diagnostics.ts: a terminal fact

this page

internal

STY

pi-modes/diagnostics.ts: a terminal fact (screen)

this page

internal

ZELLIJ

pi-modes/diagnostics.ts: a terminal fact

this page

internal

SSH_TTY

pi-modes/diagnostics.ts: a terminal fact

this page

internal

SSH_CONNECTION

pi-modes/diagnostics.ts, pi-ssh/helper.mjs

this page

internal

HOME

the home directory, where the platform gives it so

this page

internal

APPDATA

pi-vertex/adc-client.ts: gcloud’s Windows dir

vertex

internal

PATH

extended and read where pi’s own bin dir is placed

this page

internal

GADHS_CONTRACT

pi-workspace/contract.ts: set by the workspace contract suite for its own child program; pi reads nothing from it

this page

internal

Bus channels

pi’s event bus, pi.events: one per extension runtime, synchronous.

Item Defined in Documented in Tier

gadhs:status

pi-modes/status.ts (STATUS_EVENT); pi-remote listens

diagnostics

stable

gadhs:mode

pi-modes/status.ts (MODE_EVENT)

diagnostics

stable

gadhs:title

pi-modes/title.ts (TITLE_EVENT); pi-remote listens

diagnostics

stable

gadhs:pending

pi-modes/pending-event.ts (PENDING_EVENT); pi-remote listens

diagnostics

stable

gadhs:hub

pi-modes/hub-publish.ts (HUB_EVENT); pi-remote forwards it to the phone

remote

stable

gadhs-hub:ask

pi-modes/hub-facts.ts (HUB_ASK_EVENT)

diagnostics

stable

gadhs-hub:facts

pi-modes/hub-facts.ts (HUB_FACTS_EVENT); pi-ssh and pi-remote answer

diagnostics

stable

gadhs-msg:received

pi-modes/hub-facts.ts (MSG_RECEIVED_EVENT); pi-remote emits

diagnostics

stable

gadhs-msg:read

pi-modes/hub-facts.ts (MSG_READ_EVENT)

diagnostics

stable

gadhs:hub-wanted

pi-modes/hub-publish.ts (HUB_WANTED_EVENT): pi-remote asks pi-modes for every hub part

this page

internal

gadhs:agents-seeded

pi-agents/index.ts (AGENTS_SEEDED_EVENT): pi-agents re-rendered the helpers' files at session start; pi-modes reads them again (#715)

modes

internal

gadhs:bash-owner

pi-workspace/bash.ts: which package registered bash

this page

internal

permissions:ready

@gotgenes/pi-permission-system; pi-modes listens (judge-wiring.ts)

this page

upstream

permissions:ui_prompt

@gotgenes/pi-permission-system; pi-modes listens (hub-wiring.ts)

this page

upstream

permissions:decision

@gotgenes/pi-permission-system; pi-modes listens (hub-wiring.ts)

this page

upstream

Wires

Item Defined in Documented in Tier

PROTOCOL_VERSION = 4

pi-ssh/protocol.ts: pi to its SSH helper (Hello, Request, Reply, StreamEvent)

ssh

stable

HUB_PROTOCOL = 2

pi-remote/hub.ts: a session to its box’s local hub (ToHub, ToMember)

remote

stable

@gadhs/pivot-wire 0.12.1

pi-remote/package.json; the phone’s and the relay’s wire, owned by its own repository

remote

upstream

A change to a wire frame that a peer on the previous version does not read bumps the constant; the row above and the constant’s comment record each version.

Package exports

Only @gadhs/pi is published (#836). Its exports map exposes ./bus-rules.json (stable, pinned by pivot-msg) and ./package.json, and its pi.extensions list the built shims of the workspace extensions below and of the three vendored upstream extensions.

The ten sibling packages are private to the workspace (private: true) and move in lockstep with @gadhs/pi’s version. Siblings import from one another only inside the workspace, checked by `tsc, and every exported .ts target carries the internal-export notice in its header comment (checked by validate).

Item Defined in Documented in Tier

@gadhs/pi/bus-rules.json @gadhs/pi/package.json

pi/package.json

remote, packages

stable: bus-rules.json (pinned by pivot-msg) and package.json.

@gadhs/pi-modes @gadhs/pi-modes/ask-broker @gadhs/pi-modes/config @gadhs/pi-modes/diagnostics @gadhs/pi-modes/drop @gadhs/pi-modes/bus-rules.json @gadhs/pi-modes/hub-facts @gadhs/pi-modes/hub-publish @gadhs/pi-modes/msg-wake @gadhs/pi-modes/pending-event @gadhs/pi-modes/status @gadhs/pi-modes/title

pi-modes/package.json

packages

internal: private workspace package (bundled into @gadhs/pi; not published).

@gadhs/pi-workspace @gadhs/pi-workspace/contract @gadhs/pi-workspace/process-start @gadhs/pi-workspace/windows-kill

pi-workspace/package.json

packages

internal: private workspace package (bundled into @gadhs/pi; not published).

@gadhs/pi-bash

pi-bash/package.json

packages

internal: private workspace package (bundled into @gadhs/pi; not published).

@gadhs/pi-guidance

pi-guidance/package.json

packages

internal: private workspace package (bundled into @gadhs/pi; not published).

@gadhs/pi-workflow @gadhs/pi-workflow/git-guard

pi-workflow/package.json

packages

internal: private workspace package (bundled into @gadhs/pi; not published).

@gadhs/pi-ssh @gadhs/pi-ssh/extension

pi-ssh/package.json

packages

internal: private workspace package (bundled into @gadhs/pi; not published).

@gadhs/pi-shellcheck

pi-shellcheck/package.json

packages

internal: private workspace package (bundled into @gadhs/pi; not published).

@gadhs/pi-remote

pi-remote/package.json

packages

internal: private workspace package (bundled into @gadhs/pi; not published).

@gadhs/pi-agents

pi-agents/package.json

packages

internal: private workspace package (bundled into @gadhs/pi; not published).

@gadhs/pi-vertex

pi-vertex/package.json

packages

internal: private workspace package (bundled into @gadhs/pi; not published).

Records

What pi and these packages write for a person to read back. They are named so a reader of a session file or a log knows what wrote a line, not as a promise, and they are not checked: they change with every feature. All internal.

Session entries

gadhs-recap (the turn recap), gadhs-adjudication (a non-allow decision’s trace), gadhs-subagent (a helper’s trace), gadhs-pi-modes (the mode a session was in), gadhs-monitor-record, gadhs-question-record, gadhs-time-posted; and the message types gadhs-detach-hint, gadhs-poll-hint, gadhs-job, gadhs-monitor, gadhs-monitor-lost, gadhs-msg-wake, gadhs-msg-notice, gadhs-question-renumbered, gadhs-repeat-warning, gadhs-yield-reminder.

The review log

the gadhs_* records node tools/task.mjs verdicts reads, for example gadhs_mode_rule.verdict, gadhs_mode_judge.verdict, gadhs_mode_registry.verdict, gadhs_pending.answered.

The diagnostics stream

the debugLog event names (session.start, run.settled, tool.ran, git_guard., pi_remote. and the rest); /diag reads them.

Edit this page · latest