{"version":3,"file":"toolPromptStore.cjs","names":["Store"],"sources":["../../../src/web/stores/toolPromptStore.ts"],"sourcesContent":["import { Store } from '@tanstack/store';\n\n/**\n * The one request a tool's composer prompt failed to render.\n *\n * A tool prompt standing in for the composer is the only surface offering the\n * agent an answer, so a plugin component that throws would otherwise strand\n * the run with nothing to click. Recording the request it threw on hands it\n * back: the claim declines it, and the host's own dialog opens instead.\n *\n * One id is enough because one request is open at a time, and a later request\n * gets its own id, so a plugin fixed between turns is tried again rather than\n * written off for the rest of the session.\n */\nexport interface ToolPromptState {\n  failedDialogId: string | null;\n}\n\nexport const toolPromptStore = new Store<ToolPromptState>({ failedDialogId: null });\n\nexport function markToolPromptFailed(dialogId: string): void {\n  toolPromptStore.setState((state) => (state.failedDialogId === dialogId ? state : { failedDialogId: dialogId }));\n}\n\n/** Test seam. */\nexport function resetToolPromptStore(): void {\n  toolPromptStore.setState(() => ({ failedDialogId: null }));\n}\n"],"mappings":";AAkBA,MAAa,kBAAkB,K,yBAAIA,EAAAA,CAAAA,MAAuB,EAAE,gBAAgB,KAAK,CAAC;AAElF,SAAgB,qBAAqB,UAAwB;CAC3D,gBAAgB,UAAU,UAAW,MAAM,mBAAmB,WAAW,QAAQ,EAAE,gBAAgB,SAAS,CAAE;AAChH;;AAGA,SAAgB,uBAA6B;CAC3C,gBAAgB,gBAAgB,EAAE,gBAAgB,KAAK,EAAE;AAC3D"}