Pi Integration
Tauren runs Pi in-process through the bundled Pi SDK runtime.
Why SDK instead of RPC
Tauren originally used an external pi process in RPC mode. The project moved to the SDK because advanced Tauren features need live access to Pi runtime state, session tree navigation, model metadata, and extension UI hooks.
See ADR 0001 for the full decision.
Runtime ownership
Pi owns:
- provider and model state,
- session state,
- tool execution,
- skills, prompts, themes, and extensions,
- tree navigation,
- runtime settings.
Tauren owns:
- VS Code integration,
- webview rendering,
- session switching UI,
- local slash commands,
- prompt context attachment,
- session diff tracking,
- diagnostics presentation.
SDK bridge files
Key areas:
src/sdk/piSdkClient.tssrc/sdk/piSdkLoader.tssrc/sdk/piSdkEventMapper.tssrc/sdk/extensionUiBridge.tssrc/pi/eventMapper.tssrc/pi/messageContent.tssrc/pi/types.ts
The bundled SDK build is produced by:
npm run compile:sdkStartup behavior
Tauren starts Pi in the background when the sidebar opens, the webview becomes ready, the view receives focus, or the view becomes visible. This keeps model and context metadata available before the first prompt.
The first VS Code workspace folder is used as the runtime working directory.
Event mapping
Pi runtime events are mapped into Tauren UI actions. Important event expectations include:
agent_startmeans the session is busy.agent_endmeans the session is idle.- assistant text streams through
message_updatetext deltas.
Extension UI bridge
Pi extensions call Pi UI APIs. Tauren maps those calls into sidebar surfaces through the extension UI bridge.
Pi extension intent
→ Pi ctx/ui API
→ Tauren bridge
→ VS Code/webview surfaceThe bridge should keep Pi extensions runtime-agnostic. Avoid making plugins depend on VS Code-specific behavior.