Documentation
¶
Overview ¶
Package pig exposes build-time-embedded resources for the pig binary.
This is the only file at module root; runtime code lives in cmd/, internal/, coding/. Its sole purpose is to host `//go:embed` directives that need access to files at the repo root (Go embed cannot traverse to parent directories from a sub-package).
Currently embeds: - CHANGELOG.md, surfaced via the `/changelog` slash command.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Changelog string
Changelog is the bundled CHANGELOG.md, embedded at build time. Read by internal/codingagent's `/changelog` slash handler. Empty when the file is missing at build time (which would fail the embed and the build).
Functions ¶
This section is empty.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package agent provides the core agent loop and message types.
|
Package agent provides the core agent loop and message types. |
|
harness
Package harness holds the shared declarations of Pi's durable agent harness: tool, resource, stream-option, execution-environment, and shell-output contracts consumed by the session, execution, runtime, and utility packages beneath it.
|
Package harness holds the shared declarations of Pi's durable agent harness: tool, resource, stream-option, execution-environment, and shell-output contracts consumed by the session, execution, runtime, and utility packages beneath it. |
|
harness/agentharness
Package agentharness holds the public durable AgentHarness data contracts of packages/agent/src/harness/agent-harness.ts, the passive HarnessEventBus of harness/events.ts and the ordered HookRegistry of harness/hooks.ts.
|
Package agentharness holds the public durable AgentHarness data contracts of packages/agent/src/harness/agent-harness.ts, the passive HarnessEventBus of harness/events.ts and the ordered HookRegistry of harness/hooks.ts. |
|
harness/env
Package env provides NodeExecutionEnv, the host-OS filesystem and shell implementation of the harness execution environment.
|
Package env provides NodeExecutionEnv, the host-OS filesystem and shell implementation of the harness execution environment. |
|
harness/execution
Package execution provides effect admission for the durable agent harness.
|
Package execution provides effect admission for the durable agent harness. |
|
harness/pico3
Package pico3 is the experimental Pico3 agent kernel: durable records, commit-granular documents, a single-writer Session line, a task scheduler, the built-in turn kinds, and the watch view protocol.
|
Package pico3 is the experimental Pico3 agent kernel: durable records, commit-granular documents, a single-writer Session line, a task scheduler, the built-in turn kinds, and the watch view protocol. |
|
harness/runtime
Package runtime holds the durable AgentHarness runtime declarations of packages/agent/src/harness/runtime/types.ts: the process-local configuration, the lane state projection, lane/operation command decisions and the Drive pass with its effect gate.
|
Package runtime holds the durable AgentHarness runtime declarations of packages/agent/src/harness/runtime/types.ts: the process-local configuration, the lane state projection, lane/operation command decisions and the Drive pass with its effect gate. |
|
harness/session
Package session implements the durable harness session: the write-once entry tree, bound values and lists, the usage ledger, the storage contract, the Session mutation line, Branch capabilities, forks, and the in-memory backend.
|
Package session implements the durable harness session: the write-once entry tree, bound values and lists, the usage ledger, the storage contract, the Session mutation line, Branch capabilities, forks, and the in-memory backend. |
|
harness/session/testing
Package sessiontesting holds runner-independent session test fixtures and storage decorators shared by every backend's conformance and benchmarks.
|
Package sessiontesting holds runner-independent session test fixtures and storage decorators shared by every backend's conformance and benchmarks. |
|
harness/session/testing/benchmark
Package benchmark holds the deterministic session workloads shared by every backend's storage and repository benchmarks.
|
Package benchmark holds the deterministic session workloads shared by every backend's storage and repository benchmarks. |
|
harness/session/testing/conformance
Package conformance holds the runner-independent Storage and SessionRepo conformance suites every session backend must pass.
|
Package conformance holds the runner-independent Storage and SessionRepo conformance suites every session backend must pass. |
|
harness/utils
Package utils holds the harness usage arithmetic, adaptive publication, and bounded shell-output capture helpers.
|
Package utils holds the harness usage arithmetic, adaptive publication, and bounded shell-output capture helpers. |
|
search
Package search defines the session and entry search contracts exported by the agent package.
|
Package search defines the session and entry search contracts exported by the agent package. |
|
Package ai provides provider abstractions, model definitions, and auth storage for pig.
|
Package ai provides provider abstractions, model definitions, and auth storage for pig. |
|
automation
|
|
|
ci/divguard
command
Command divguard fails CI on hidden, arbitrary divergences from Pi: invented limits, timeouts and defaults, silent exits, swallowed errors and dropped events that no DIVERGENCES.md entry records.
|
Command divguard fails CI on hidden, arbitrary divergences from Pi: invented limits, timeouts and defaults, silent exits, swallowed errors and dropped events that no DIVERGENCES.md entry records. |
|
ci/slopmetrics
command
Command slopmetrics measures two code-quality signals from SlopCodeBench (arXiv:2603.24755) over the repository's hand-written Go code:
|
Command slopmetrics measures two code-quality signals from SlopCodeBench (arXiv:2603.24755) over the repository's hand-written Go code: |
|
cmd
|
|
|
gen-image-models
command
Command gen-image-models imports the exact published Pi image catalog and emits ai/image_models_generated.go in deterministic provider/model order.
|
Command gen-image-models imports the exact published Pi image catalog and emits ai/image_models_generated.go in deterministic provider/model order. |
|
gen-models
command
Command gen-models reads upstream pi's `packages/ai/src/models.generated.ts` and emits `ai/models_generated.go` with a parallel registry.
|
Command gen-models reads upstream pi's `packages/ai/src/models.generated.ts` and emits `ai/models_generated.go` with a parallel registry. |
|
pig
command
Command pig provides the PiG coding agent CLI.
|
Command pig provides the PiG coding agent CLI. |
|
Package coding is the public SDK for embedding the pig coding agent as a Go library.
|
Package coding is the public SDK for embedding the pig coding agent as a Go library. |
|
extension
Package extension defines the contract every pig extension speaks.
|
Package extension defines the contract every pig extension speaks. |
|
extension/extensiontest
Package extensiontest provides test doubles for the extension.API surface.
|
Package extensiontest provides test doubles for the extension.API surface. |
|
extension/host/cellpack
Package cellpack is the Piglet-Binary-side counterpart to the host's prebuilt-cell seam (runtimecell.PrebuiltResolver).
|
Package cellpack is the Piglet-Binary-side counterpart to the host's prebuilt-cell seam (runtimecell.PrebuiltResolver). |
|
extension/host/fusepack
Package fusepack holds Go extensions fused into a Piglet Binary.
|
Package fusepack holds Go extensions fused into a Piglet Binary. |
|
extension/host/inproc
Package inproc implements the in-process Go dispatch runner for extensions.
|
Package inproc implements the in-process Go dispatch runner for extensions. |
|
extension/host/runtimecell
Package runtimecell builds and resolves packed extension runtime cells.
|
Package runtimecell builds and resolves packed extension runtime cells. |
|
extension/host/subprocess
Package subprocess implements pig's out-of-process extension transport: extensions communicate over a local stream socket with length-prefixed JSON framing.
|
Package subprocess implements pig's out-of-process extension transport: extensions communicate over a local stream socket with length-prefixed JSON framing. |
|
extension/installresolver
Package installresolver is Pig's product-neutral seam for contributed package-source behavior.
|
Package installresolver is Pig's product-neutral seam for contributed package-source behavior. |
|
extension/pigsdk
Package pigsdk stages Pig's extension SDKs (Go, Python, and Rust) into the config root so out-of-tree extension builds and packed runtime cells can use the API that matches the running binary.
|
Package pigsdk stages Pig's extension SDKs (Go, Python, and Rust) into the config root so out-of-tree extension builds and packed runtime cells can use the API that matches the running binary. |
|
extension/source
Package source resolves an authorized extension path into one conventional factory or exact isolated standalone definition.
|
Package source resolves an authorized extension path into one conventional factory or exact isolated standalone definition. |
|
hookconfig
Package hookconfig parses and validates command hook files shared by Package validation and the runtime hook bridge.
|
Package hookconfig parses and validates command hook files shared by Package validation and the runtime hook bridge. |
|
packagecontent
Package packagecontent discovers resources exposed by Pi packages and cross-harness plugin manifests.
|
Package packagecontent discovers resources exposed by Pi packages and cross-harness plugin manifests. |
|
piglet
Package piglet provides piglet-based capability scoping for pig sessions.
|
Package piglet provides piglet-based capability scoping for pig sessions. |
|
piglet/artifact
Package artifact defines executable Piglet component plans and artifact records.
|
Package artifact defines executable Piglet component plans and artifact records. |
|
piglet/release
Package release verifies and installs signed Piglet Binary releases.
|
Package release verifies and installs signed Piglet Binary releases. |
|
piglet/signature
Package signature signs and verifies Piglet Binaries.
|
Package signature signs and verifies Piglet Binaries. |
|
pigletbuild
Package pigletbuild validates Piglet closure and builds source or binary Piglet artifacts.
|
Package pigletbuild validates Piglet closure and builds source or binary Piglet artifacts. |
|
pigletbuild/binarypiglet
Package binarypiglet holds the Piglet and resolution record embedded in a Piglet Binary.
|
Package binarypiglet holds the Piglet and resolution record embedded in a Piglet Binary. |
|
pigversion
Package pigversion provides PiG and upstream Pi version pins to packages that cannot import coding.
|
Package pigversion provides PiG and upstream Pi version pins to packages that cannot import coding. |
|
rpcclient
Package rpcclient is a Go client for `pig --mode rpc`: it spawns the agent in RPC mode and provides a typed API for all operations.
|
Package rpcclient is a Go client for `pig --mode rpc`: it spawns the agent in RPC mode and provides a typed API for all operations. |
|
secretresolver
Package secretresolver provides the product-neutral resolver seam for typed Piglet secret refs.
|
Package secretresolver provides the product-neutral resolver seam for typed Piglet secret refs. |
|
source
Package source parses the source-reference vocabulary shared by package installation and Pig piglet resource origins.
|
Package source parses the source-reference vocabulary shared by package installation and Pig piglet resource origins. |
|
examples
|
|
|
sdk
command
Command sdk-example is a minimal demonstration of embedding the pig coding agent as a Go library via the public `coding` package.
|
Command sdk-example is a minimal demonstration of embedding the pig coding agent as a Go library via the public `coding` package. |
|
extensions
|
|
|
sdk-py
Package pysdk carries the Python extension SDK sources so an installed pig can stage a buildable copy to disk.
|
Package pysdk carries the Python extension SDK sources so an installed pig can stage a buildable copy to disk. |
|
sdk-rs
Package rssdk carries the Rust extension SDK sources so an installed pig can stage a buildable copy to disk.
|
Package rssdk carries the Rust extension SDK sources so an installed pig can stage a buildable copy to disk. |
|
sdk
module
|
|
|
internal
|
|
|
buildprogress
Package buildprogress reports product-neutral diagnostics for explicit builds.
|
Package buildprogress reports product-neutral diagnostics for explicit builds. |
|
chord
Package chord is the local Go runtime for the subset of Pi 0.87.1's packages/chord that the experimental service graph consumes: replicated state, the remote service provider and its endpoint, the operation-stream replica binding, and JSON-copy transports.
|
Package chord is the local Go runtime for the subset of Pi 0.87.1's packages/chord that the experimental service graph consumes: replicated state, the remote service provider and its endpoint, the operation-stream replica binding, and JSON-copy transports. |
|
codingagent
Model picker auth-filter scope toggle.
|
Model picker auth-filter scope toggle. |
|
codingagent/compaction
Branch summarization for tree navigation.
|
Branch summarization for tree navigation. |
|
codingagent/export
Package export provides HTML session export.
|
Package export provides HTML session export. |
|
codingagent/frontmatter
Package frontmatter parses YAML frontmatter blocks from markdown files.
|
Package frontmatter parses YAML frontmatter blocks from markdown files. |
|
codingagent/llama
Package llama ports Pi's built-in llama.cpp extension (packages/coding-agent/src/extensions/llama/): the router HTTP/SSE client, Hugging Face search and download, the dynamic provider, the manager UI, and the /llama command.
|
Package llama ports Pi's built-in llama.cpp extension (packages/coding-agent/src/extensions/llama/): the router HTTP/SSE client, Hugging Face search and download, the dynamic provider, the manager UI, and the /llama command. |
|
codingagent/prompts
Package prompts builds the default coding-agent system prompt.
|
Package prompts builds the default coding-agent system prompt. |
|
codingagent/tools
tools/bash_executor.go: user bash execution (!cmd, RPC bash, SDK ExecuteBash).
|
tools/bash_executor.go: user bash execution (!cmd, RPC bash, SDK ExecuteBash). |
|
configvalue
Package configvalue mirrors upstream pi's packages/coding-agent/src/core/resolve-config-value.ts (v0.78.1).
|
Package configvalue mirrors upstream pi's packages/coding-agent/src/core/resolve-config-value.ts (v0.78.1). |
|
crossspawn
Package crossspawn starts a program the way upstream's spawnProcess does (coding-agent utils/child-process.ts): Node's spawn on Unix, and on Windows the cross-spawn package, which runs a command that is not a .exe or .com file -- such as npm.cmd -- through cmd.exe with every argument escaped for cmd.exe.
|
Package crossspawn starts a program the way upstream's spawnProcess does (coding-agent utils/child-process.ts): Node's spawn on Unix, and on Windows the cross-spawn package, which runs a command that is not a .exe or .com file -- such as npm.cmd -- through cmd.exe with every argument escaped for cmd.exe. |
|
experimental
Package experimental implements the opt-in local process transport used by Pi's experimental server.
|
Package experimental implements the opt-in local process transport used by Pi's experimental server. |
|
experimental/mini/shared
Package shared implements mini's local service protocol and transports.
|
Package shared implements mini's local service protocol and transports. |
|
experimental/services
Package services contains the opt-in experimental presentation service contracts.
|
Package services contains the opt-in experimental presentation service contracts. |
|
imageprocessing
Image resize + re-encode policy for CLI/LLM image attachments, plus the EXIF orientation reader (upstream exif-orientation.ts).
|
Image resize + re-encode policy for CLI/LLM image attachments, plus the EXIF orientation reader (upstream exif-orientation.ts). |
|
latex
Package latex renders a basic subset of LaTeX math as terminal-friendly Unicode text.
|
Package latex renders a basic subset of LaTeX math as terminal-friendly Unicode text. |
|
managementhttp
Package managementhttp ports upstream coding-agent utils/management-http.ts: a bounded immediate retry for idempotent management requests (tool downloads, release lookups).
|
Package managementhttp ports upstream coding-agent utils/management-http.ts: a bounded immediate retry for idempotent management requests (tool downloads, release lookups). |
|
mermaid
Package mermaid renders Mermaid diagrams as Unicode box-drawing art for terminals.
|
Package mermaid renders Mermaid diagrams as Unicode box-drawing art for terminals. |
|
nativeplatform
Package nativeplatform provides the operating-system queries that upstream Pi loads from its per-platform N-API helpers (packages/tui/src/native-platform.ts).
|
Package nativeplatform provides the operating-system queries that upstream Pi loads from its per-platform N-API helpers (packages/tui/src/native-platform.ts). |
|
nodeurl
Package nodeurl ports the parts of Node's url module that PiG needs to match Pi: the WHATWG host parser for file URLs and url.fileURLToPath.
|
Package nodeurl ports the parts of Node's url module that PiG needs to match Pi: the WHATWG host parser for file URLs and url.fileURLToPath. |
|
ownerfile
Package ownerfile makes files accessible to their owner only and checks that they are: mode 0600 and no group or other bits on POSIX, and on Windows, which has no mode bits, a DACL (D68).
|
Package ownerfile makes files accessible to their owner only and checks that they are: mode 0600 and no group or other bits on POSIX, and on Windows, which has no mode bits, a DACL (D68). |
|
pigdocs
Package pigdocs materializes the reference documentation embedded in Stock Pig under the user's config root (`~/.pig/docs` by default).
|
Package pigdocs materializes the reference documentation embedded in Stock Pig under the user's config root (`~/.pig/docs` by default). |
|
pigsdklock
Package pigsdklock coordinates readers and writers of staged Pig extension SDKs within one configuration root.
|
Package pigsdklock coordinates readers and writers of staged Pig extension SDKs within one configuration root. |
|
profiling
Package profiling writes Go runtime profiles when PIG_PROFILE names them.
|
Package profiling writes Go runtime profiles when PIG_PROFILE names them. |
|
shellconfig
Package shellconfig resolves the bash shell PiG runs commands through, mirroring upstream packages/coding-agent/src/utils/shell.ts getShellConfig and getBashShellConfig.
|
Package shellconfig resolves the bash shell PiG runs commands through, mirroring upstream packages/coding-agent/src/utils/shell.ts getShellConfig and getBashShellConfig. |
|
testbudget
Package testbudget sizes the deadlines tests use to bound a hang.
|
Package testbudget sizes the deadlines tests use to bound a hang. |
|
testenv
Package testenv checks host capabilities a test needs, so a test runs wherever the host provides them and says why it skipped where the host does not.
|
Package testenv checks host capabilities a test needs, so a test runs wherever the host provides them and says why it skipped where the host does not. |
|
text
Package text ports upstream packages/coding-agent/src/utils/text.ts: the leading byte order mark helpers every Pi reader applies before parsing user-authored JSON, markdown, and text files.
|
Package text ports upstream packages/coding-agent/src/utils/text.ts: the leading byte order mark helpers every Pi reader applies before parsing user-authored JSON, markdown, and text files. |
|
toolchain
Package toolchain locates the build tools PiG uses for compiled extension cells and Piglet Binaries, and installs a PiG-managed Go toolchain for users who installed only the pig binary.
|
Package toolchain locates the build tools PiG uses for compiled extension cells and Piglet Binaries, and installs a PiG-managed Go toolchain for users who installed only the pig binary. |
|
parity
|
|
|
closure
Package closure stores and verifies the evidence graph used to assess PiG's correspondence with the pinned Pi source.
|
Package closure stores and verifies the evidence graph used to assess PiG's correspondence with the pinned Pi source. |
|
cmd/asynccheck
command
Command asynccheck proves that every upstream source file with Promise/async behavior has an explicit cross-language disposition and durable evidence.
|
Command asynccheck proves that every upstream source file with Promise/async behavior has an explicit cross-language disposition and durable evidence. |
|
cmd/behaviorcheck
command
|
|
|
cmd/checkparityran
command
Command checkparityran answers one question: did the parity suite actually compare pig against a real pi, or did it just skip?
|
Command checkparityran answers one question: did the parity suite actually compare pig against a real pi, or did it just skip? |
|
cmd/closure
command
|
|
|
cmd/correspondence
command
|
|
|
cmd/coverage
command
Command coverage produces a markdown report linking parity scenarios to PORT_MAP.md entries.
|
Command coverage produces a markdown report linking parity scenarios to PORT_MAP.md entries. |
|
cmd/customfactoryledger
command
Command customfactoryledger derives the internal custom-UI factory draft ledger from the pinned upstream public interface inventory.
|
Command customfactoryledger derives the internal custom-UI factory draft ledger from the pinned upstream public interface inventory. |
|
cmd/extensioncorpus
command
|
|
|
cmd/familygaps
command
Command familygaps reports, for one behavior family, which upstream PORT_MAP entries fall within its scope and which lack behavioral verification.
|
Command familygaps reports, for one behavior family, which upstream PORT_MAP entries fall within its scope and which lack behavioral verification. |
|
cmd/formatversions
command
|
|
|
cmd/gointerfaces
command
|
|
|
cmd/interfacedelta
command
|
|
|
cmd/interfaceinventory
command
|
|
|
cmd/interfacerecommend
command
|
|
|
cmd/lint
command
Command lint validates parity scenarios against quality rules that AGENTS.md declares.
|
Command lint validates parity scenarios against quality rules that AGENTS.md declares. |
|
cmd/newscenario
command
|
|
|
cmd/porter
command
|
|
|
cmd/portreconcile
command
Command portreconcile produces the honest gap ledger for the Pig port.
|
Command portreconcile produces the honest gap ledger for the Pig port. |
|
cmd/sourcehygiene
command
|
|
|
cmd/testinventorycheck
command
Command testinventorycheck validates the reviewed disposition mapping over the upstream-test inventory.
|
Command testinventorycheck validates the reviewed disposition mapping over the upstream-test inventory. |
|
cmd/upstreamdelta
command
Command upstreamdelta proves that every changed upstream source file in a version leap received an explicit disposition and durable evidence.
|
Command upstreamdelta proves that every changed upstream source file in a version leap received an explicit disposition and durable evidence. |
|
correspondence
Package correspondence compares pinned Pi source interfaces with PiG targets and produces deterministic review packets.
|
Package correspondence compares pinned Pi source interfaces with PiG targets and produces deterministic review packets. |
|
internal/gitsnapshot
Package gitsnapshot resolves and validates immutable Git tree identities for parity evidence.
|
Package gitsnapshot resolves and validates immutable Git tree identities for parity evidence. |
|
knowngaps
Package knowngaps loads parity/known-gaps.toml, the one ledger of parity gaps that gates tolerate against the pinned Pi version.
|
Package knowngaps loads parity/known-gaps.toml, the one ledger of parity gaps that gates tolerate against the pinned Pi version. |
|
porter
Package porter exposes the single deterministic process contract used by the direct Porter adapter and the Pig Porter extension.
|
Package porter exposes the single deterministic process contract used by the direct Porter adapter and the Pig Porter extension. |
|
tests
|
|
|
extension-conformance/testfixture
Command sdk-fixture is a minimal SDK-based extension for integration testing.
|
Command sdk-fixture is a minimal SDK-based extension for integration testing. |
|
extension-conformance/testfixture/cmd
command
Command sdk-fixture runs the canonical Go SDK conformance extension over a subprocess socket.
|
Command sdk-fixture runs the canonical Go SDK conformance extension over a subprocess socket. |
|
integration
Package integration holds end-to-end tests that drive the real `pig` binary through a tmux PTY and assert on captured pane output.
|
Package integration holds end-to-end tests that drive the real `pig` binary through a tmux PTY and assert on captured pane output. |
|
upstream-parity
Package parity parses upstream pi TypeScript declarations to drive parity tests.
|
Package parity parses upstream pi TypeScript declarations to drive parity tests. |
|
Package tui provides Pi-compatible terminal rendering, input, components, keybindings, and screen lifecycle management.
|
Package tui provides Pi-compatible terminal rendering, input, components, keybindings, and screen lifecycle management. |
|
parity
Package parity provides the test harness for TUI byte-level and visible-state parity against upstream pi-tui.
|
Package parity provides the test harness for TUI byte-level and visible-state parity against upstream pi-tui. |
|
termsim
Package termsim is a headless ANSI terminal simulator for byte-level parity testing.
|
Package termsim is a headless ANSI terminal simulator for byte-level parity testing. |
|
widthx
Package widthx implements upstream pi-tui's visibleWidth + ANSI escape extraction with byte-level fidelity to the TypeScript algorithm.
|
Package widthx implements upstream pi-tui's visibleWidth + ANSI escape extraction with byte-level fidelity to the TypeScript algorithm. |
Click to show internal directories.
Click to hide internal directories.