import { PiClient, PiContextUsage, PiHostUiRequest, PiHostUiResponse, PiRuntimeReadiness, PiThinkingLevel, PiThreadMetadata, PiThreadStatus } from "../types.js"; import { PiThreadState } from "./threadState.js"; import { PiInterruptAnswer } from "./hostUi.js"; import { PiThreadControllerLike } from "./ThreadController.js"; import { ExternalStoreAdapter, ExternalStoreSharedOptions, ThreadMessageLike } from "@assistant-ui/react"; //#region src/runtime/runtimeTypes.d.ts export type PiRuntimeOptions = ExternalStoreSharedOptions & { /** The transport-agnostic Pi client (HTTP/SSE, RPC, IPC). */ client: PiClient; /** Workspace scoping for the thread list. */ workspacePath?: string; includeArchived?: boolean; initialThreadId?: string; threadId?: string; /** Notified when the active thread's settled remote ID changes; `undefined` while still optimistic. */ onThreadIdChange?: ((threadId: string | undefined) => void) | undefined; onError?: (error: unknown) => void; adapters?: ExternalStoreAdapter["adapters"]; }; export interface PiRuntimeExtras { state: PiThreadState; metadata: PiThreadMetadata; status: PiThreadStatus; readiness: PiRuntimeReadiness | undefined; contextUsage: PiContextUsage | undefined; /** Pending side-channel (free-standing) host-UI requests — those not attached * to a tool call. Tool-associated requests render as the tool call's * approval instead. */ hostUiRequests: readonly PiHostUiRequest[]; /** All pending host-UI requests, including tool-associated ones. */ allHostUiRequests: readonly PiHostUiRequest[]; queue: PiThreadState["queue"]; compaction: PiThreadState["compaction"]; retry: PiThreadState["retry"]; lastError: string | undefined; cancel: () => Promise; refresh: () => Promise; /** Clear Pi's queued (steering + follow-up) messages; resolves with the * cleared text so it can be restored into the composer. */ clearQueue: () => Promise<{ steering: string[]; followUp: string[]; }>; setModel: (input: { provider: string; modelId: string; }) => Promise; setThinkingLevel: (level: PiThinkingLevel) => Promise; respondToHostUiRequest: (response: PiHostUiResponse) => Promise; respondToToolApproval: (id: string, approved: boolean) => Promise; resumeToolCall: (toolCallId: string, payload: PiInterruptAnswer) => Promise; } export type PiRuntimeExtrasInternal = PiRuntimeExtras & { controller: PiThreadControllerLike; }; //#endregion //# sourceMappingURL=runtimeTypes.d.ts.map