histoire
Version:
A fast story book powered by Vite
32 lines • 1.99 kB
TypeScript
import type { UiMcpOperationInfo, UiMcpSnapshot } from '@histoire/shared';
import type { McpOperationToolService } from '../server/operation-tools.js';
/** Dev HTTP activity follows stateless exchanges rather than inventing sessions. */
export declare function createDevMcpActivity(): {
snapshot: () => UiMcpSnapshot;
publish: (operation: UiMcpOperationInfo) => void;
/** Resolve current transport identity during synchronous operation admission. */
currentClientId: () => string;
/** Only SDK public read-tool callbacks invoke this hook. */
observeReadTool: <T>(tool: string, input: unknown, work: () => T) => T;
/** Observe each accepted HTTP exchange without parsing request bodies. */
observeExchange(work: () => Promise<void>): Promise<void>;
/** One owned parent pipe is one persistent stdio client, not one per tool. */
observeStdio<T>(work: () => Promise<T>): Promise<T>;
/** Polls and cancellation are reads of exact handles; failed admission also appears. */
observeOperations<T extends McpOperationToolService>(service: T): T;
/** Display only name selected from SDK metadata, never the metadata envelope. */
setClientName(name: string): void;
/** Publish actual endpoint after binding or disabling policy. */
setEndpoint(value?: string): void;
/** Stdio runs without an HTTP endpoint but still exposes an enabled MCP server. */
setEnabled(value: boolean): void;
/** Worker pipe shutdown retires its one client and server availability. */
disconnect(): void;
/** A runtime restart invalidates prior activity and late read completions. */
reset(): void;
/** Observe server policy and exchange connection changes. */
onClientChange(listener: (value: UiMcpSnapshot) => void): () => void;
/** Observe only sanitized read and execution lifecycle DTOs. */
onOperationChange(listener: (operation: UiMcpOperationInfo) => void): () => void;
};
//# sourceMappingURL=activity.d.ts.map