histoire
Version:
A fast story book powered by Vite
76 lines • 2.96 kB
TypeScript
import type { McpReadToolName } from '../server/read-tools.js';
import type { WorkerMethod, WorkerResultMap } from './worker-protocol.js';
/** Start one owned child; all project output is piped with native stream backpressure. */
export declare function createMcpWorkerClient(options: {
root: string;
config?: string;
projectId: string;
principal: string;
entry?: URL;
timeoutMs?: number;
}): {
/** Boot snapshot arrives before project collection, making lifecycle reads available. */
ready: Promise<{
type: "boot";
project: {
projectId: string;
epoch: string;
runtimeMode: "dev" | "node";
buildId?: string;
status: "closed" | "failed" | "ready" | "restarting" | "starting";
revision?: string;
updating: boolean;
title: string;
base: string;
routerMode: "hash" | "history";
storyCount: number;
variantCount: number;
capabilities: {
catalog: boolean;
content: boolean;
previews: boolean;
screenshots: {
available: boolean;
reason?: string;
};
inspection?: {
available: boolean;
reason?: string;
};
tests: {
available: boolean;
reason?: string;
engine: "built-preview" | "project-vitest" | "unavailable";
};
};
diagnostics: {
filePath?: string;
storyId?: string;
code: string;
message: string;
}[];
diagnosticsTruncated?: boolean;
};
executors: {
screenshot: boolean;
tests: boolean;
'inspect-variant'?: boolean;
'inspect-dom'?: boolean;
'inspect-accessibility'?: boolean;
'runtime-diagnostics'?: boolean;
};
}>;
/** Exact owned process identity, used by lifecycle integration checks. */
readonly pid: number;
/** Resolves on owned child exit, including a crash. */
exited: Promise<void>;
/** Forward only bounded client display name selected by SDK metadata hooks. */
setClientName(name: string): void;
/** Only SDK public read callbacks mark their corresponding IPC request. */
observeReadTool<T>(name: McpReadToolName, _target: unknown, run: () => T): T;
/** Submit one finite bounded request; cancellation never invents a new operation. */
request<T extends WorkerMethod>(method: T, input: unknown, signal?: AbortSignal): Promise<WorkerResultMap[T]>;
/** Stop admission, ask for confirmed cleanup, then escalate only this owned child. */
close(): Promise<void>;
};
//# sourceMappingURL=worker-client.d.ts.map