/** * The HostApi is everything an extension may ask of the host, over RPC. * * These are CLEAN-ROOM shapes — deliberately NOT imported from the AGPL app. * They are a stable, minimal projection of host capabilities. The host adapts * its internal types to these at the gateway; the extension only ever sees this. */ export interface Disposable { dispose(): void; } export type AgentStatus = "running" | "idle" | "waiting" | "error" | "archived" | "unknown"; export interface AgentSummary { id: string; title: string | null; status: AgentStatus; serverId: string; cwd: string | null; /** ISO-8601 timestamp, or null if unknown. */ lastActivityAt: string | null; } export interface AgentDetail extends AgentSummary { provider: string | null; pendingPermissionCount: number; } export interface NotificationOptions { title?: string; body: string; } export interface HostFetchInit { method?: string; headers?: Record; body?: string; } export interface HostFetchResponse { status: number; headers: Record; body: string; } /** * The capability surface. v0 wraps a curated subset of the host's DaemonClient * plus UI affordances. `net.fetch` is the escape hatch for an extension's OWN * (possibly paid) backend — calls leave the host arms-length. */ export interface HostApi { agents: { list(): Promise; get(id: string): Promise; /** Subscribe to agent-list status changes. Returns a Disposable. */ onStatus(listener: (agents: AgentSummary[]) => void): Disposable; archive(id: string): Promise; }; commands: { /** Invoke any registered command (host or another extension's). */ execute(id: string, ...args: unknown[]): Promise; }; ui: { showNotification(options: NotificationOptions): Promise; /** Open a contributed view (webview) by id. */ openView(viewId: string): Promise; /** Open a workspace-tab panel by kind, with optional props. */ openPanel(kind: string, props?: Record): Promise; }; storage: { /** Per-extension scoped key/value storage (host-persisted). */ get(key: string): Promise; set(key: string, value: unknown): Promise; }; net: { /** Arms-length network call — for the extension's own backend. */ fetch(url: string, init?: HostFetchInit): Promise; }; } //# sourceMappingURL=host-api.d.ts.map