UNPKG

histoire

Version:

A fast story book powered by Vite

20 lines • 1.46 kB
import type { UiAgentThreadBase, UiAiThread, UiCommentMessage } from '@histoire/shared'; import type { ThreadFileCodec } from './file.js'; import type { CommentAgentReply } from './store.js'; /** Safe user-facing admission failure; no agent is dispatched for this error. */ export declare class CommentCapacityError extends Error { /** Preserve exact history and tell callers how to continue. */ constructor(); } /** Successful execution and persistence failure stay separate in caller-visible recovery. */ export declare class CommentReplyStorageError extends Error { /** Never describe a completed agent request as failed. */ constructor(cause?: unknown); } /** Reserve one complete bounded reply without dropping any existing messages. */ export declare function assertCommentReplyCapacity(comment: UiAgentThreadBase, agentId: string): void; /** Reserve encoded document capacity for this reply plus every other pending physical-file reply. */ export declare function reserveCommentFileReplyCapacity<T extends UiAgentThreadBase = UiAiThread>(comments: readonly T[], comment: T, agentId: string, reservations: ReadonlyMap<string, UiCommentMessage>, codec?: ThreadFileCodec<T>): UiCommentMessage; /** Keep success text and useful change metadata; every omission is explicit in the reply. */ export declare function boundedCommentAgentReply(result: CommentAgentReply, agentId: string): UiCommentMessage; //# sourceMappingURL=capacity.d.ts.map