Repository navigation
PiSharp 1.1.0.2
PiSharp 1.1.0.2
A C#-only patch on the Pi v1.1.0 baseline (commit
abe508e1b89912adde45528136c3221eb69acdd7). It ports the rest of Pi v1.1.0: the work
planned in full-parity-v1.1.0.md (packages IMPL-A1 to
IMPL-I and IMPL-E) and the deviation burn-down that followed. Each area is tracked, with
its test suites, in
sync-1.1.0-applicability.json
(rows gap.* and parity.*). The owner decisions are in
decision 0004.
The version still names the baseline. The Parity page lists
what differs from Pi.
Breaking and behaviour changes
pisharptakes Pi's command line. Plainpisharpopens the terminal UI.-p,
--mode json|rpc,@filearguments and every other flag in Pi'sargs.tswork as in
Pi. Scripts that usedpisharp session prompt --output print|jsonshould move to-p
and--mode json. Thepisharp session …commands still exist, with their explicit
paths and--allow-*grants.--user-settingsand--project-settingsbelong to those
commands only.- PiSharp uses Pi's folders. Settings come from
~/.pi/agent/settings.jsonand
.pi/settings.json.AGENTS.md/CLAUDE.md,SYSTEM.md,APPEND_SYSTEM.md, skills,
prompt templates, themes and extensions are discovered as in Pi. New sessions are saved
in~/.pi/agent/sessions. Project resources load only after you trust the project
(trust.json,/trust,-a/-na,defaultProjectTrust). - Tool policy defaults to Pi's. On the Pi command line (
pisharp,-p,
--mode json|rpc), file tools take any path andbashruns any command with your
environment and the discovered shell, as in Pi.--tool-policy explicit(or
"toolPolicy": "explicit") keeps the exact grants. Thesession …commands still
default toexplicit. Untrusted projects keep thepipolicy, as in Pi: trust gates
project resources, not tools. Session files, extension manifests, approvals and
snapshots stay protected under both policies. - Unknown tool names are ignored. Names in
--tools,defaultToolsor SDK initial
names that match no tool select nothing, with no error, as in Pi. !commandvalues run. A value starting with!inauth.json,models.json,
settings.jsonormcp.jsonruns as a shell command, as Pi resolves it. This includes
stored API keys for every provider, MCP OAuth client secrets and AWS
credential_process. 1.1.0.1 refused stored!commandkeys.- Extensions run as Pi runs them. Discovered TypeScript and JavaScript extensions run
in your Node with your permissions, gated only by project trust.pisharp installand
startup package resolution use your npm and git. Native C# extensions in the extension
folders load without the approval and preflight files thesession …loader needs. - Provider requests follow Pi's budgets. Images of about 4.5 MB reach the providers;
the old 1 MiB transport cap is gone. PiSharp-only count caps on prompts, tools, queues,
skills, MCP servers and stream events are removed on the Pi command line. - The model catalog refreshes at startup. Interactive mode fetches catalog updates
from pi.dev, as Pi does, unlessPI_OFFLINEis set or--offlineis passed.
New
Command line and configuration
- Every Pi v1.1.0 flag, including
--version,--api-key,--system-prompt,
--append-system-prompt,--thinking,--continue,--resume,--session,
--session-id,--fork,--session-dir,--no-session,--name,--models,
--list-models,--theme,--use-theme,--tui-mode,--offline,-eand
--no-extensions. pisharp install|remove|uninstall|update|list|configand
pisharp auth check|print-api-key|print-bearer-token.- Global and project
settings.jsonwith Pi's merge rules and migrations. - Project trust as in Pi.
rgandfdfrom<agentDir>/binorPATH, downloaded on first use when missing.
Providers and models
- Every chat API in Pi 1.1.0: Bedrock Converse (native SigV4, the AWS credential chain
and event-stream framing), OpenAI Codex with ChatGPT sign-in, GitHub Copilot, Cloudflare
Workers AI and AI Gateway, and Vertex with Application Default Credentials (user,
service account, impersonated and external accounts). - All 42 provider catalogs from pi-ai 1.1.0, byte for byte, each with a live route.
/loginfor every provider, with API keys or the provider's OAuth or device flow.--modelpatterns with:thinking,--models,enabledModels,models.json
(includingbaseUrloverrides of built-in providers), virtual models and
--list-models.- Classifier and image models: OpenAI decisions (with image input), TypeSafe and
Cloudflare system-one, llama.cpp classification and OpenRouter images.
Tools and codemode
readreturns images: type sniffing, EXIF orientation, resizing and re-encoding as Pi
does, on SkiaSharp.bashfinds its shell as Pi does, withshellPath,shellCommandPrefixanduser_bash
extension interception, on Windows, Linux and macOS.- Codemode on Jint: Pi's prelude, script API,
store(),models.*, output framing and
limits, the renderer, and codemode MCP servers. Each script runs in its own worker
process.
Sessions and events
- Sessions written with
JSON.stringifybytes in Pi's key order, compared with session
files captured from Pi 1.1.0. /name,/session,/fork,/clone,/resume,/import, HTML export
(/export,--export) and/share.- Every JSON and RPC event:
entry_appended,thinking_level_changed,extension_error,
auto_retry_*,summarization_retry_*;agent_end.willRetry; compaction retries. - SIGTERM and SIGHUP shut RPC and print mode down as in Pi.
- 39 of the 41 v1.1.0 extension events reach native C# extensions.
Interactive mode
- Pi's terminal UI on Windows, Linux and macOS, in fullscreen or regular mode.
- All 24 built-in slash commands, with Pi's names, descriptions and arguments, plus
/mcp. - Every
/settingsitem, includingtuiMode,quietStartupandoutputPad. - The
system,darkandlightthemes, custom theme files with live reload. - Inline images, Mermaid diagrams and highlight.js syntax highlighting.
- What's New and
/changelog, read from theCHANGELOG.mdshipped with the tool.
MCP
- Project
.pi/mcp.jsonin trusted projects. tool_searchalways registered and switched off, as in Pi; it waits for background
servers and its prompt snippet is rendered.- The 10-second startup wait for direct servers, resource tools, the
mcp_serversprompt
section on live routes,auth.providerservers, per-server refresh locks, and/mcp.
Extensions and packages
- Pi's TypeScript and JavaScript extensions from
~/.pi/agent/extensions,
.pi/extensions, settings, packages and-e. - The whole
ExtensionAPI, including shortcuts, flags, renderers, providers, virtual
models and every event. - Pi packages from npm, git and local folders.
- Native C# extensions: a folder with a
pisharp-extension.json
({"assembly": "...", "entryType": "..."}) loads from the same places, without Node.
Fixed
- Long sessions. Requests no longer fail once a session passes 256 messages
(Anthropic) or 1,024 (other routes), and sessions with more than 10,000 records open.
Pi has no message limit; requests are bounded by the model's context and compaction. - Prompting right after
agent_settledis accepted instead of refused as "settling". - Bash commands containing NUL are refused before they run on every platform, as
Node'sspawndoes. - Tool calls without a name or id (Gemini streams them) are recorded with an empty
name or id, as Pi does, instead of failing the stream. - Update check compares against the latest
PiSharp.Clion NuGet and suggests
dotnet tool update -g PiSharp.Cli; it never asks pi.dev.PI_SKIP_VERSION_CHECK,
PI_OFFLINEand--offlineturn it off.
New dependencies
- SkiaSharp 4.152.1 (MIT) with its native assets for Windows, macOS and Linux, in
PiSharp.Tools.Skia, forreadimages (decision 0004). - Jint 4.16.3 (BSD-2-Clause) and its parser Acornima 1.7.0 (BSD-3-Clause), in
PiSharp.Codemode(decision 0003). - Pi's npm packages (
@earendil-works/pi-coding-agent,pi-ai,pi-tui,
pi-agent-core1.1.0, withtypebox1.3.27 andjiti2.7.0) are installed with your
npm into~/.pi/agent/pisharp/pi-runtime/1.1.0the first time a TypeScript extension
loads, and checked against the npm registry's integrity. Node.js 22.13 or later is
needed for TypeScript extensions only.
PiSharp.Tools.Skia and PiSharp.Codemode are new NuGet packages.
Owner decisions that affect you
From decision 0004:
- The
--tool-policy pi|explicitoption and its defaults (above). - Project trust gates project resources only; tools keep the
pipolicy in untrusted
projects. !commandvalues run, for every provider and for AWScredential_process.- Vertex uses Application Default Credentials.
- Trusted extensions call classifier and image models with stored credentials.
- Interactive startup refreshes the model catalog from pi.dev unless
PI_OFFLINEis set. rgandfdare downloaded on first use when missing, unlessPI_OFFLINEis set.- Extensions run in your Node with your privileges; Pi's own npm packages are installed
on first extension use. - Native C# extensions are discovered like Pi extensions on every platform.
- The codemode deadline starts when the script starts running in its worker.
- Install telemetry is not ported.
Differences from Pi
Intentional:
- No install telemetry.
PI_TELEMETRYandenableInstallTelemetryare ignored. - Requests to Anthropic, Azure, Bedrock, Mistral, OpenAI-compatible endpoints and
OpenRouter images carry aPiSharpuser agent where Pi's SDKs send their own. - Codemode runs each script in a worker process (about 100 to 300 ms to start), and its
deadline starts with the script. On Jint, memory and recursion overruns end the script
instead of throwing, and engine error messages differ. - No zstd compression and no WebSocket transport for OpenAI Codex.
pisharp updatecan't update PiSharp itself. Usedotnet tool update -g PiSharp.Cli.
Still open:
- Lone surrogates. RPC input and tool-call arguments turn escaped lone surrogates
into U+FFFD, and a session line containing one is refused. - JSON depth. Session records, RPC input and tool-call arguments are limited to 64
levels of nesting. - Fractional token counts are refused (Bedrock reads them as 0).
- Memory bounds. 64 MiB per session line and file, 16 MiB per streamed event, 64 MiB
per response, 8 MiB per tool result, 32 MiB per RPC record. sendMessagewithtriggerTurnfrom inside an extension command runs after the
command returns, and is dropped if the command runs longer than about 30 seconds.- User bash start failures report a different error text from Node's spawn error.
- Linux X11 clipboard needs
xcliporxsel; Pi also has a built-in helper. - Packages loaded with
-eadd their extensions but not their skills, prompts or themes. - No llama.cpp router discovery and no
/llama. ctx.ui.setThemereturns an error./bugnever uploads reports to Pi's developers. It keeps Pi's prompts, zip and
summary, and its Open GitHub Issue choice writes the zip and opens a prefilled issue
at github.com/jkelly/PiSharp (description,
summary, PiSharp version, OS, runtime and model) for you to attach the zip to. Without a
browser it prints the zip's path and the issue link
(decision 0004, item 11).
Out of scope, unchanged from decision 0002:
pi-durable, pi-env, the experimental server and client modes, and Nix packaging.
Packages
All library packages and the PiSharp.Cli dotnet tool will be published as 1.1.0.2:
dotnet tool update -g PiSharp.Cli