import { type ModelInfo, type RpcEventListener, type RpcSessionState } from "@earendil-works/pi-coding-agent"; export interface PiRpcOptions { /** Absolute path to pi's dist/cli.js (default: PI_CLI_PATH env, local node_modules, or `which pi` resolved) */ cliPath?: string; /** Working directory for the agent (affects bash tool, project context) */ cwd?: string; /** Extra CLI args, e.g. ["--session-dir", "/path"] */ args?: string[]; } /** Minimal shape of a slash command returned by get_commands (duck-typed, not exported by the package) */ export interface RpcSlashCommandInfo { name: string; description?: string; source: "extension" | "prompt" | "skill"; location?: string; path?: string; } export declare class PiRpc { private client?; private commandsCache?; private options; /** Listeners registered before start() — attached once the client connects */ private listeners; constructor(options?: PiRpcOptions); get isConnected(): boolean; /** Locate the pi CLI entry point. */ static resolveCliPath(): Promise; private startPromise; start(): Promise; private doStart; stop(): Promise; /** * Restart the pi process. Keeps registered event listeners attached to the * new process. The session persists on disk, so the same session is resumed. * Useful after installing new extensions/skills or changing provider config. */ restart(): Promise; /** * Send a user prompt. If the agent is streaming, the RPC server rejects a * plain prompt — retry as a steering message (queued, delivered after the * current tool calls finish). */ prompt(text: string): Promise; /** Subscribe to agent events. Safe to call before start(). Returns an unsubscribe function. */ onEvent(listener: RpcEventListener): () => void; newSession(): Promise<{ cancelled: boolean; }>; compact(customInstructions?: string): Promise<{ summary: string; tokensBefore: number; }>; abort(): Promise; getState(): Promise; getAvailableModels(): Promise; setModel(provider: string, modelId: string): Promise; setThinkingLevel(level: string): Promise; setSessionName(name: string): Promise; getSessionStats(): Promise<{ sessionId: string; totalMessages: number; cost: number; tokens: { total: number; }; }>; exportHtml(outputPath?: string): Promise<{ path: string; }>; bash(command: string): Promise<{ output: string; exitCode: number | undefined; }>; switchSession(sessionPath: string): Promise<{ cancelled: boolean; }>; /** Get available commands (extension commands, prompt templates, skills) with a short cache. */ getCommands(): Promise; private requireClient; } //# sourceMappingURL=pi-rpc.d.ts.map