import { SessionState, ToolEntry } from "./sessionModel.mjs"; import { DialogPromptContribution, ToolPromptContribution, ToolPromptDialog } from "@agimon-ai/po-core/web"; //#region src/web/lib/toolPrompt.d.ts /** * Which running tool, if any, owns the open extension UI request. * * The composer and the dialog have to agree, or the reader gets both surfaces * or neither, so the verdict is one pure function they both read rather than * a flag each keeps. It is pure for the same reason the rest of sessionModel * is: the interesting cases are combinations of session state, and none of * them need a browser to exercise. * * The pairing is an inference. Pi's protocol does not say which tool a request * belongs to, only that one is open, so this reads the newest running tool * whose plugin declared a prompt and lets that plugin confirm the request is * its own. A tool that declares no prompt never participates, and a request no * prompt claims stays with the host's dialog. */ export interface ToolPromptClaim { entry: ToolEntry; prompt: ToolPromptContribution; dialog: ToolPromptDialog; } export interface DialogPromptClaim { entry?: undefined; prompt: DialogPromptContribution; dialog: ToolPromptDialog; } export type ComposerPromptClaim = ToolPromptClaim | DialogPromptClaim; /** The three facts the verdict rests on, so a caller can memoize on exactly those. */ export type ToolPromptInput = Pick; /** * `spokenFor` is a request some other surface has already taken: the one the * selection bar claimed with a click, or one whose prompt threw and handed it * back. Passed in rather than read, because both live in stores and this layer * sits below them so that every surface can reach it. */ export declare function toolPromptClaim(state: ToolPromptInput, spokenFor: string | null, sessionId?: string): ComposerPromptClaim | null; //#endregion //# sourceMappingURL=toolPrompt.d.mts.map