diff --git a/apps/app/src/components/plugin/PluginPanelActions.tsx b/apps/app/src/components/plugin/PluginPanelActions.tsx index ee69923b5..ae501cf3c 100644 --- a/apps/app/src/components/plugin/PluginPanelActions.tsx +++ b/apps/app/src/components/plugin/PluginPanelActions.tsx @@ -6,6 +6,7 @@ import { type PluginThreadPanelActionSlot, } from "@/lib/plugin-slots"; import type { PluginPanelFixedPanelTab } from "@/lib/fixed-panel-tabs-state"; +import { revealPluginThreadMessage } from "@/lib/plugin-thread-message-reveal"; import { parsePersistedPluginPanelParams, serializePluginPanelParams, @@ -178,7 +179,13 @@ function ActionTabContent({ slotKind="threadPanelAction" slotId={action.id} > - + + revealPluginThreadMessage(threadId, messageId) + } + /> ); diff --git a/apps/app/src/components/plugin/plugin-slot-mounts.test.tsx b/apps/app/src/components/plugin/plugin-slot-mounts.test.tsx index b8ff63b95..9c2fda3a0 100644 --- a/apps/app/src/components/plugin/plugin-slot-mounts.test.tsx +++ b/apps/app/src/components/plugin/plugin-slot-mounts.test.tsx @@ -14,6 +14,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import { PERSONAL_PROJECT_ID } from "@bb/domain"; import type { PluginComposerApi, PluginThreadPanelProps } from "@bb/plugin-sdk"; import { createPluginPanelFixedPanelTab } from "@/lib/fixed-panel-tabs-state"; +import { registerPluginThreadMessageRevealHandler } from "@/lib/plugin-thread-message-reveal"; import { resetPluginSlotStoreForTest, setPluginSlotRegistrations, @@ -1718,6 +1719,18 @@ describe("plugin thread panel actions", () => { ); } + function RevealProbe({ experimental_revealMessage }: PluginThreadPanelProps) { + const [result, setResult] = useState("idle"); + return ( + + ); + } + function ActionsProbe({ threadId, openPluginPanel, @@ -1784,6 +1797,36 @@ describe("plugin thread panel actions", () => { ).toBeDefined(); }); + it("scopes panel message reveal to the panel thread", async () => { + const reveal = vi.fn().mockResolvedValue("revealed"); + const unregister = registerPluginThreadMessageRevealHandler( + "thr_9", + reveal, + ); + setPluginSlotRegistrations( + "demo", + registrationSet({ + threadPanelActions: [ + { id: "comments", title: "Comments", component: RevealProbe }, + ], + }), + ); + const tab = createPluginPanelFixedPanelTab({ + actionId: "comments", + paramsJson: null, + pluginId: "demo", + title: "Comments", + }); + render(); + + fireEvent.click(screen.getByRole("button", { name: "reveal:idle" })); + expect( + await screen.findByRole("button", { name: "reveal:revealed" }), + ).toBeDefined(); + expect(reveal).toHaveBeenCalledWith("msg_1"); + unregister(); + }); + it("contains a throwing run and rejects non-JSON params without opening", () => { const warn = vi.spyOn(console, "warn").mockImplementation(() => {}); const cyclic: Record = {}; diff --git a/apps/app/src/components/thread/embedded-chat/EmbeddedThreadChat.tsx b/apps/app/src/components/thread/embedded-chat/EmbeddedThreadChat.tsx index f2247d5a0..afd2f20ab 100644 --- a/apps/app/src/components/thread/embedded-chat/EmbeddedThreadChat.tsx +++ b/apps/app/src/components/thread/embedded-chat/EmbeddedThreadChat.tsx @@ -259,15 +259,23 @@ function EmbeddedThreadChatHostedFooter({ scrollOverlay, surface, }: EmbeddedThreadChatHostedFooterProps) { + const exposePluginTimelineHooks = + surface.includePluginMessageActions !== false; return (
+
{timelineBody} diff --git a/apps/app/src/components/thread/timeline/ConversationMessageContent.tsx b/apps/app/src/components/thread/timeline/ConversationMessageContent.tsx index ccb11f60f..590d56b86 100644 --- a/apps/app/src/components/thread/timeline/ConversationMessageContent.tsx +++ b/apps/app/src/components/thread/timeline/ConversationMessageContent.tsx @@ -86,6 +86,8 @@ export interface ConversationMessageContentUserProps extends ConversationMessage initiator: TimelineUserConversationRow["initiator"]; mentions: readonly PromptTextMention[]; onAddToChat?: ThreadTimelineAddToChatHandler; + /** Reports selections from ordinary user-authored message prose. */ + onSelectProse?: (selection: MessageProseSelection | null) => void; resolveMentionLink?: PromptMentionLinkResolver; resolveSegmentLinkHref?: TimelineTitleLinkResolver; onOpenLink?: ThreadTimelineLinkHandler; @@ -192,6 +194,7 @@ interface UserConversationMessageProps { mentions: readonly PromptTextMention[]; mobileActionDisplay: "inline" | "overflow"; onAddToChat?: ThreadTimelineAddToChatHandler; + onSelectProse?: (selection: MessageProseSelection | null) => void; onOpenLink?: ThreadTimelineLinkHandler; onOpenLocalFileLink?: ThreadTimelineLocalFileLinkHandler; projectId?: string; @@ -385,6 +388,7 @@ function UserConversationMessage({ mentions, mobileActionDisplay, onAddToChat, + onSelectProse, onOpenLink, onOpenLocalFileLink, pluginActions = [], @@ -484,14 +488,16 @@ function UserConversationMessage({ ) : null}
{messageText ? ( - + + + ) : (

Sent attachments

)} @@ -727,6 +733,7 @@ export function ConversationMessageContent( mentions={props.mentions} mobileActionDisplay={props.mobileActionDisplay ?? "overflow"} onAddToChat={props.onAddToChat} + onSelectProse={props.onSelectProse} onOpenLink={props.onOpenLink} onOpenLocalFileLink={onOpenLocalFileLink} projectId={projectId} diff --git a/apps/app/src/components/thread/timeline/SelectableMessageProse.events.test.tsx b/apps/app/src/components/thread/timeline/SelectableMessageProse.events.test.tsx index 923e35e3f..fe606a9b6 100644 --- a/apps/app/src/components/thread/timeline/SelectableMessageProse.events.test.tsx +++ b/apps/app/src/components/thread/timeline/SelectableMessageProse.events.test.tsx @@ -4,6 +4,7 @@ import { cleanup, fireEvent, render, waitFor } from "@testing-library/react"; import { afterEach, describe, expect, it, vi } from "vitest"; import { MULTI_CLICK_SELECTION_REPORT_DELAY_MS, + renderedTextSelectionFromRange, SelectableMessageProse, } from "./SelectableMessageProse.js"; @@ -27,8 +28,19 @@ function makeWindowSelection({ text: string; }): Selection { const rect = new DOMRect(10, 20, 30, 8); + const fullText = node.textContent ?? text; + const normalizedText = text.trim(); + const selectedStart = Math.max(0, fullText.indexOf(normalizedText)); + const selectedEnd = Math.min( + fullText.length, + selectedStart + normalizedText.length, + ); const range = { commonAncestorContainer: commonAncestorContainer ?? node, + startContainer: node, + startOffset: selectedStart, + endContainer: node, + endOffset: selectedEnd, getBoundingClientRect: () => rect, getClientRects: () => ({ length: 1, @@ -68,6 +80,37 @@ describe("SelectableMessageProse", () => { ).not.toBeNull(); }); + it("captures one UTF-16 rendered-text selector across nested Markdown nodes", () => { + const root = document.createElement("div"); + root.append("Before "); + const strong = document.createElement("strong"); + strong.textContent = "nested ๐Ÿ˜€ text"; + root.append(strong, " after"); + document.body.append(root); + const range = document.createRange(); + range.setStart(root.firstChild!, 3); + range.setEnd(strong.firstChild!, "nested ๐Ÿ˜€".length); + const rect = new DOMRect(10, 20, 90, 18); + vi.spyOn(Range.prototype, "getClientRects").mockReturnValue({ + 0: rect, + length: 1, + item: (index: number) => (index === 0 ? rect : null), + } as unknown as DOMRectList); + vi.spyOn(Range.prototype, "getBoundingClientRect").mockReturnValue(rect); + + expect(renderedTextSelectionFromRange(root, range)).toEqual({ + version: 1, + coordinateSpace: "rendered-text-utf16", + start: 3, + end: "Before nested ๐Ÿ˜€".length, + exact: "ore nested ๐Ÿ˜€", + prefix: "Bef", + suffix: " text after", + rects: [{ x: 10, y: 20, width: 90, height: 18 }], + }); + root.remove(); + }); + it("reports a selection only after pointer release", async () => { const onSelect = vi.fn(); const { getByText } = render( diff --git a/apps/app/src/components/thread/timeline/SelectableMessageProse.tsx b/apps/app/src/components/thread/timeline/SelectableMessageProse.tsx index 784293000..32cb691a3 100644 --- a/apps/app/src/components/thread/timeline/SelectableMessageProse.tsx +++ b/apps/app/src/components/thread/timeline/SelectableMessageProse.tsx @@ -1,4 +1,5 @@ import { useEffect, useRef, type ReactNode } from "react"; +import type { experimental_PluginRenderedTextSelection } from "@bb/plugin-sdk"; export interface SelectionAnchorPoint { x: number; @@ -15,6 +16,8 @@ export interface SelectionAnchor { export interface MessageProseSelection { text: string; rect: DOMRect; + /** Present for selections captured inside canonical message prose roots. */ + renderedText?: experimental_PluginRenderedTextSelection; anchorPoint?: SelectionAnchorPoint; anchorSide?: SelectionAnchorSide; sourceSeqEnd?: number; @@ -106,17 +109,126 @@ function isSelectionBoundarySpillWithinNode( ); } +function textOffsetAtBoundary( + root: HTMLElement, + container: Node, + offset: number, +): number | null { + if (container !== root && !root.contains(container)) return null; + const prefix = document.createRange(); + prefix.selectNodeContents(root); + try { + prefix.setEnd(container, offset); + } catch { + return null; + } + return (prefix.cloneContents().textContent ?? "").length; +} + +function slicePrefixWithoutSplittingSurrogate( + text: string, + end: number, +): string { + let start = Math.max(0, end - 32); + const first = text.charCodeAt(start); + if ( + start > 0 && + first >= 0xdc00 && + first <= 0xdfff && + text.charCodeAt(start - 1) >= 0xd800 && + text.charCodeAt(start - 1) <= 0xdbff + ) { + start += 1; + } + return text.slice(start, end); +} + +function sliceSuffixWithoutSplittingSurrogate( + text: string, + start: number, +): string { + let end = Math.min(text.length, start + 32); + const last = text.charCodeAt(end - 1); + if ( + end < text.length && + last >= 0xd800 && + last <= 0xdbff && + text.charCodeAt(end) >= 0xdc00 && + text.charCodeAt(end) <= 0xdfff + ) { + end -= 1; + } + return text.slice(start, end); +} + +export function renderedTextSelectionFromRange( + root: HTMLElement, + range: Range, + geometryRange: Range = range, +): experimental_PluginRenderedTextSelection | null { + const start = textOffsetAtBoundary( + root, + range.startContainer, + range.startOffset, + ); + const end = textOffsetAtBoundary(root, range.endContainer, range.endOffset); + if (start === null || end === null || end <= start) return null; + + const text = root.textContent ?? ""; + const exact = text.slice(start, end); + if (exact.trim().length === 0) return null; + const rects: experimental_PluginRenderedTextSelection["rects"][number][] = []; + const clientRects = geometryRange.getClientRects(); + for (let index = 0; index < clientRects.length; index += 1) { + const rect = clientRects.item(index); + if (rect === null || (rect.width <= 0 && rect.height <= 0)) continue; + rects.push({ + x: rect.x, + y: rect.y, + width: rect.width, + height: rect.height, + }); + } + if (rects.length === 0) { + const rect = geometryRange.getBoundingClientRect(); + if (rect.width > 0 || rect.height > 0) { + rects.push({ + x: rect.x, + y: rect.y, + width: rect.width, + height: rect.height, + }); + } + } + if (rects.length === 0) return null; + + return { + version: 1, + coordinateSpace: "rendered-text-utf16", + start, + end, + exact, + prefix: slicePrefixWithoutSplittingSurrogate(text, start), + suffix: sliceSuffixWithoutSplittingSurrogate(text, end), + rects, + }; +} + function toMessageProseSelection({ anchor, rect, - text, + renderedText, }: { anchor: SelectionAnchor | null; rect: DOMRect | null; - text: string; + renderedText: experimental_PluginRenderedTextSelection | null; }): MessageProseSelection | null { - if (text.length === 0 || rect === null) return null; - const selection: MessageProseSelection = { text, rect }; + if (renderedText === null || rect === null) return null; + const selection: MessageProseSelection = { + text: renderedText.exact, + rect, + renderedText, + }; if (anchor !== null) { selection.anchorPoint = anchor.point; selection.anchorSide = anchor.side; @@ -193,15 +305,31 @@ function readSelectionWithinNode( commonAncestorContainer: range.commonAncestorContainer, }); if (accepted) { - const text = selection.toString().trim(); const rect = firstClientRect(range); - return toMessageProseSelection({ anchor, rect, text }); + const renderedText = renderedTextSelectionFromRange(node, range); + return toMessageProseSelection({ anchor, rect, renderedText }); } - const text = selection.toString().trim(); + const text = selection.toString(); if (isSelectionBoundarySpillWithinNode(node, range, text)) { + const clippedRange = document.createRange(); + if (node.contains(range.startContainer)) { + clippedRange.setStart(range.startContainer, range.startOffset); + } else { + clippedRange.setStart(node, 0); + } + if (node.contains(range.endContainer)) { + clippedRange.setEnd(range.endContainer, range.endOffset); + } else { + clippedRange.setEnd(node, node.childNodes.length); + } const rect = firstClientRect(range); - return toMessageProseSelection({ anchor, rect, text }); + const renderedText = renderedTextSelectionFromRange( + node, + clippedRange, + range, + ); + return toMessageProseSelection({ anchor, rect, renderedText }); } return null; @@ -375,6 +503,7 @@ export function SelectableMessageProse({ // inset. A long-press text selection uses the same touch sequence, so // keep sidebar swipe recognition out of selectable message prose. data-no-sidebar-swipe + data-bb-experimental-message-prose-root="" > {children}
diff --git a/apps/app/src/components/thread/timeline/ThreadTimelineRows.actions.test.tsx b/apps/app/src/components/thread/timeline/ThreadTimelineRows.actions.test.tsx index a8bb38284..63b1d6930 100644 --- a/apps/app/src/components/thread/timeline/ThreadTimelineRows.actions.test.tsx +++ b/apps/app/src/components/thread/timeline/ThreadTimelineRows.actions.test.tsx @@ -25,6 +25,7 @@ import { setPluginSlotRegistrations, type PluginRegistrationSet, } from "@/lib/plugin-slots"; +import { revealPluginThreadMessage } from "@/lib/plugin-thread-message-reveal"; import { ThreadTimelineRows } from "./ThreadTimelineRows"; function messageActionRegistrationSet( @@ -131,18 +132,22 @@ function SearchOlderRowsHarness({ ]; return ( - { - onLoadOlderRows(); - setLoadedOlderRows(true); - }} - threadRuntimeDisplayStatus="idle" - workspaceRootPath={undefined} - /> +
+
+ { + onLoadOlderRows(); + setLoadedOlderRows(true); + }} + threadRuntimeDisplayStatus="idle" + workspaceRootPath={undefined} + /> +
+
); } @@ -189,8 +194,14 @@ function SearchOlderRowsFailedLoadHarness({ function mockWindowSelection({ node, text }: { node: Node; text: string }) { const rect = new DOMRect(10, 20, 30, 8); + const source = node.textContent ?? text; + const start = Math.max(0, source.indexOf(text)); const range = { commonAncestorContainer: node, + startContainer: node, + startOffset: start, + endContainer: node, + endOffset: start + text.length, getBoundingClientRect: () => rect, getClientRects: () => ({ length: 1, @@ -998,10 +1009,11 @@ describe("ThreadTimelineRows actions", () => { it("loads older timeline rows before scrolling to an older sidebar search match", async () => { const onLoadOlderRows = vi.fn(); vi.spyOn(window, "requestAnimationFrame").mockImplementation((callback) => { - callback(performance.now()); - return 1; + return window.setTimeout(() => callback(performance.now()), 0); }); - vi.spyOn(window, "cancelAnimationFrame").mockImplementation(() => {}); + vi.spyOn(window, "cancelAnimationFrame").mockImplementation((handle) => + window.clearTimeout(handle), + ); Object.defineProperty(HTMLElement.prototype, "scrollIntoView", { configurable: true, value: vi.fn(), @@ -1033,6 +1045,36 @@ describe("ThreadTimelineRows actions", () => { ); }); + it("loads older history and waits for canonical prose during plugin reveal", async () => { + const onLoadOlderRows = vi.fn(); + vi.spyOn(window, "requestAnimationFrame").mockImplementation((callback) => { + return window.setTimeout(() => callback(performance.now()), 0); + }); + vi.spyOn(window, "cancelAnimationFrame").mockImplementation((handle) => + window.clearTimeout(handle), + ); + + const { container } = renderWithRouter( + , + ); + const reveal = revealPluginThreadMessage("thr_main", "older_match"); + const olderRow = await waitFor(() => { + const row = container.querySelector( + '[data-bb-experimental-conversation-message-id="older_match"]', + ); + if (row === null) throw new Error("Older plugin reveal row not mounted"); + return row; + }); + expect( + olderRow?.querySelectorAll("[data-bb-experimental-message-prose-root]"), + ).toHaveLength(1); + await expect(reveal).resolves.toBe("revealed"); + expect(onLoadOlderRows).toHaveBeenCalledTimes(1); + await expect( + revealPluginThreadMessage("thr_main", "not_in_this_thread"), + ).resolves.toBe("missing"); + }); + it("does not retry failed older-row auto-loading until rows advance", async () => { const onLoadOlderRows = vi.fn(); @@ -1094,11 +1136,26 @@ describe("ThreadTimelineRows actions", () => { const userRow = container.querySelector( '[data-timeline-row-id="user_row"]', ); + expect( + userRow?.getAttribute("data-bb-experimental-conversation-message-id"), + ).toBe("user_row"); + expect(userRow?.getAttribute("data-bb-experimental-message-role")).toBe( + "user", + ); + expect( + userRow?.querySelectorAll("[data-bb-experimental-message-prose-root]") + .length, + ).toBe(1); expect(userRow?.querySelector('[aria-label="Summarize"]')).not.toBeNull(); const assistantRow = container.querySelector( '[data-timeline-row-id="assistant_row"]', ); + expect( + assistantRow?.querySelectorAll( + "[data-bb-experimental-message-prose-root]", + ).length, + ).toBe(1); const assistantAction = assistantRow?.querySelector( '[aria-label="Summarize"]', ); @@ -1341,6 +1398,16 @@ describe("ThreadTimelineRows actions", () => { expect(run).toHaveBeenCalledTimes(1); const context = run.mock.calls[0]![0]; expect(context.selectedText).toBe("part of this answer"); + expect(context.experimental_selection).toEqual({ + version: 1, + coordinateSpace: "rendered-text-utf16", + start: 7, + end: 26, + exact: "part of this answer", + prefix: "Select ", + suffix: ".", + rects: [{ x: 10, y: 20, width: 30, height: 8 }], + }); expect(context.message).toEqual({ id: "selectable_row", threadId: "thr_main", @@ -1352,6 +1419,67 @@ describe("ThreadTimelineRows actions", () => { expect(context.openPanel({ actionId: "panel" })).toBe(false); }); + it("supports selection-only actions on ordinary user message prose", async () => { + const run = vi.fn(); + setPluginSlotRegistrations( + "comments", + messageActionRegistrationSet([ + { + id: "comment", + title: "Comment", + experimental_placements: ["selection-menu"], + run, + }, + ]), + ); + vi.spyOn(window, "requestAnimationFrame").mockImplementation((callback) => { + callback(performance.now()); + return 1; + }); + vi.spyOn(window, "cancelAnimationFrame").mockImplementation(() => {}); + + const { container } = renderWithRouter( + , + ); + expect(container.querySelector('[aria-label="Comment"]')).toBeNull(); + const textNode = screen.getByText( + "Please make this contract explicit.", + ).firstChild; + expect(textNode).not.toBeNull(); + mockWindowSelection({ node: textNode!, text: "this contract" }); + fireEvent(document, new Event("selectionchange")); + const action = await screen.findByRole("button", { name: "Comment" }); + fireEvent.click(action); + + expect(run).toHaveBeenCalledWith( + expect.objectContaining({ + threadId: "thr_main", + selectedText: "this contract", + message: expect.objectContaining({ + id: "user_selectable", + role: "user", + }), + experimental_selection: expect.objectContaining({ + exact: "this contract", + start: 12, + }), + }), + ); + }); + it("forces a manually collapsed same-thread search ancestor open", async () => { vi.spyOn(window, "requestAnimationFrame").mockImplementation((callback) => { callback(performance.now()); diff --git a/apps/app/src/components/thread/timeline/ThreadTimelineRows.tsx b/apps/app/src/components/thread/timeline/ThreadTimelineRows.tsx index f31c8d167..8162a4969 100644 --- a/apps/app/src/components/thread/timeline/ThreadTimelineRows.tsx +++ b/apps/app/src/components/thread/timeline/ThreadTimelineRows.tsx @@ -107,6 +107,7 @@ import { type PluginMessageActionSlot, } from "@/lib/plugin-slots.js"; import { runPluginMessageAction } from "@/lib/plugin-message-actions.js"; +import { registerPluginThreadMessageRevealHandler } from "@/lib/plugin-thread-message-reveal.js"; import { isPluginSideChatSenderThread } from "@/lib/side-chat-plugin.js"; import { buildMessageDirectiveRegistry, @@ -800,6 +801,110 @@ export function findLastActionableUserMessageId( const EMPTY_CONSUMER_MESSAGE_ACTIONS: readonly ThreadTimelineConsumerMessageAction[] = []; +function nestedRawTimelineRows(row: TimelineRow): readonly TimelineRow[] { + if ("childRows" in row && Array.isArray(row.childRows)) { + return row.childRows; + } + if ("children" in row && Array.isArray(row.children)) { + return row.children; + } + return []; +} + +function collectMessageAncestorRowIds( + rows: readonly TimelineRow[], + messageId: string, + ancestors: Set, +): boolean { + for (const row of rows) { + if (row.kind === "conversation" && row.id === messageId) { + return true; + } + const nested = nestedRawTimelineRows(row); + if ( + nested.length > 0 && + collectMessageAncestorRowIds(nested, messageId, ancestors) + ) { + ancestors.add(row.id); + return true; + } + } + return false; +} + +function findElementByDataValue( + root: ParentNode, + attribute: string, + value: string, +): HTMLElement | null { + for (const element of root.querySelectorAll(`[${attribute}]`)) { + if (element.getAttribute(attribute) === value) return element; + } + return null; +} + +function waitForAnimationFrame(): Promise { + return new Promise((resolve) => + window.requestAnimationFrame(() => resolve()), + ); +} + +async function revealMountedPluginMessage( + threadId: string, + messageId: string, + isDisposed: () => boolean, +): Promise { + const deadline = window.performance.now() + 5_000; + while (!isDisposed() && window.performance.now() < deadline) { + const threadWindow = findElementByDataValue( + document, + "data-bb-experimental-thread-window", + threadId, + ); + if (threadWindow !== null) { + const row = findElementByDataValue( + threadWindow, + "data-bb-experimental-conversation-message-id", + messageId, + ); + if (row !== null) { + const proseRoots = row.querySelectorAll( + "[data-bb-experimental-message-prose-root]", + ); + if (proseRoots.length !== 1) return false; + const scrollRoot = findElementByDataValue( + threadWindow, + "data-bb-experimental-thread-scroll-root", + threadId, + ); + if (scrollRoot !== null) { + const rowRect = row.getBoundingClientRect(); + const scrollRect = scrollRoot.getBoundingClientRect(); + scrollRoot.scrollTop += + rowRect.top + + rowRect.height / 2 - + (scrollRect.top + scrollRect.height / 2); + } else { + row.scrollIntoView({ block: "center", inline: "nearest" }); + } + return true; + } + } + await waitForAnimationFrame(); + } + return false; +} + +function pluginMessageActionSupportsPlacement( + slot: PluginMessageActionSlot, + placement: "action-bar" | "selection-menu", +): boolean { + return ( + slot.experimental_placements === undefined || + slot.experimental_placements.includes(placement) + ); +} + /** * Resolve the registered plugin `messageAction`s into concrete per-message * actions for one row. Undefined (no actions rendered) when the surface has @@ -816,19 +921,21 @@ function buildRowPluginMessageActions(args: { if (timelineThreadId === undefined || slots.length === 0) { return undefined; } - return slots.map((slot) => ({ - key: `${slot.pluginId}/${slot.id}/${slot.generation}`, - pluginId: slot.pluginId, - icon: slot.icon ?? null, - label: slot.title, - onSelect: () => - runPluginMessageAction({ - slot, - threadId: timelineThreadId, - message, - openThreadPanel, - }), - })); + return slots + .filter((slot) => pluginMessageActionSupportsPlacement(slot, "action-bar")) + .map((slot) => ({ + key: `${slot.pluginId}/${slot.id}/${slot.generation}`, + pluginId: slot.pluginId, + icon: slot.icon ?? null, + label: slot.title, + onSelect: () => + runPluginMessageAction({ + slot, + threadId: timelineThreadId, + message, + openThreadPanel, + }), + })); } /** @@ -843,7 +950,8 @@ function buildRowConsumerMessageActions(args: { const { actions, message } = args; return actions .filter( - (action) => action.roles === undefined || action.roles.includes(message.role), + (action) => + action.roles === undefined || action.roles.includes(message.role), ) .map((action) => ({ key: `consumer/${action.id}`, @@ -929,6 +1037,17 @@ function ConversationRow({ rowConsumerActions.length === 0 ? rowSlotActions : [...(rowSlotActions ?? []), ...rowConsumerActions]; + const onSelectProse = + reportProseSelection === undefined + ? undefined + : (selection: MessageProseSelection | null) => + reportProseSelection( + row.id, + selection === null + ? null + : { ...selection, sourceSeqEnd: row.sourceSeqEnd }, + messageReference, + ); if (row.role === "user") { const senderThreadMetadata = row.senderThreadId === null @@ -948,6 +1067,7 @@ function ConversationRow({ row.id === latestActionableUserMessageId ? "inline" : "overflow" } onAddToChat={onSelectionAddToChat} + onSelectProse={onSelectProse} onOpenLink={onOpenLink} onOpenLocalFileLink={onOpenLocalFileLink} projectId={projectId} @@ -993,17 +1113,6 @@ function ConversationRow({ onSendToMainMessage === undefined ? undefined : () => onSendToMainMessage({ messageText: row.text }); - const onSelectProse = - reportProseSelection === undefined - ? undefined - : (selection: MessageProseSelection | null) => - reportProseSelection( - row.id, - selection === null - ? null - : { ...selection, sourceSeqEnd: row.sourceSeqEnd }, - messageReference, - ); return ( +
getViewRows(props.timelineRows), [getViewRows, props.timelineRows], ); + const [pluginRevealExpandedRowIds, setPluginRevealExpandedRowIds] = + useState>(EMPTY_ROW_ID_SET); + const stablePluginRevealExpandedRowIds = useStableReadonlySet( + pluginRevealExpandedRowIds, + ); + const revealStateRef = useRef({ + timelineRows: props.timelineRows, + hasOlderTimelineRows: props.hasOlderTimelineRows ?? false, + isLoadingOlderTimelineRows: props.isLoadingOlderTimelineRows ?? false, + onLoadOlderRows: props.onLoadOlderRows, + }); + revealStateRef.current = { + timelineRows: props.timelineRows, + hasOlderTimelineRows: props.hasOlderTimelineRows ?? false, + isLoadingOlderTimelineRows: props.isLoadingOlderTimelineRows ?? false, + onLoadOlderRows: props.onLoadOlderRows, + }; + useEffect(() => { + const threadId = props.threadId; + if (threadId === undefined || props.includePluginMessageActions === false) { + return; + } + let disposed = false; + const unregister = registerPluginThreadMessageRevealHandler( + threadId, + async (messageId) => { + for (let page = 0; page < 500 && !disposed; page += 1) { + const current = revealStateRef.current; + const ancestors = new Set(); + if ( + collectMessageAncestorRowIds( + current.timelineRows, + messageId, + ancestors, + ) + ) { + setPluginRevealExpandedRowIds(ancestors); + return (await revealMountedPluginMessage( + threadId, + messageId, + () => disposed, + )) + ? "revealed" + : "missing"; + } + if (!current.hasOlderTimelineRows) return "missing"; + if (current.isLoadingOlderTimelineRows) { + await waitForAnimationFrame(); + continue; + } + if (current.onLoadOlderRows === undefined) return "missing"; + const previousRows = current.timelineRows; + await current.onLoadOlderRows(); + const deadline = window.performance.now() + 5_000; + while ( + !disposed && + revealStateRef.current.timelineRows === previousRows && + window.performance.now() < deadline + ) { + await waitForAnimationFrame(); + } + if (revealStateRef.current.timelineRows === previousRows) { + return "missing"; + } + } + return "missing"; + }, + ); + return () => { + disposed = true; + unregister(); + }; + }, [props.includePluginMessageActions, props.threadId]); const latestActionableAssistantMessageId = useMemo( () => findLastActionableAssistantMessageId(rows), [rows], @@ -1928,7 +2119,10 @@ function ThreadTimelineRowsForTimelineView(props: ThreadTimelineRowsProps) { const onSelectionReplyInSideChat = props.onSelectionReplyInSideChat; const timelineThreadId = props.threadId; const hasPluginSelectionActions = - timelineThreadId !== undefined && messageActionSlots.length > 0; + timelineThreadId !== undefined && + messageActionSlots.some((slot) => + pluginMessageActionSupportsPlacement(slot, "selection-menu"), + ); const hasSelectionActions = onSelectionAddToChat !== undefined || onSelectionReplyInSideChat !== undefined || @@ -2001,25 +2195,31 @@ function ThreadTimelineRowsForTimelineView(props: ThreadTimelineRowsProps) { >(() => { if ( activeSelection === null || + activeSelection.selection.renderedText === undefined || timelineThreadId === undefined || messageActionSlots.length === 0 ) { return []; } - return messageActionSlots.map((slot) => ({ - key: `${slot.pluginId}/${slot.id}/${slot.generation}`, - pluginId: slot.pluginId, - icon: slot.icon ?? null, - label: slot.title, - onSelect: () => - runPluginMessageAction({ - slot, - threadId: timelineThreadId, - message: activeSelection.message, - selectedText: activeSelection.selection.text, - openThreadPanel: onOpenPluginPanel, - }), - })); + return messageActionSlots + .filter((slot) => + pluginMessageActionSupportsPlacement(slot, "selection-menu"), + ) + .map((slot) => ({ + key: `${slot.pluginId}/${slot.id}/${slot.generation}`, + pluginId: slot.pluginId, + icon: slot.icon ?? null, + label: slot.title, + onSelect: () => + runPluginMessageAction({ + slot, + threadId: timelineThreadId, + message: activeSelection.message, + selectedText: activeSelection.selection.text, + selection: activeSelection.selection.renderedText, + openThreadPanel: onOpenPluginPanel, + }), + })); }, [ activeSelection, messageActionSlots, @@ -2110,22 +2310,30 @@ function ThreadTimelineRowsForTimelineView(props: ThreadTimelineRowsProps) { value={latestActionableUserMessageId} > - - - + + + + + {hasSelectionActions ? ( (null); @@ -778,6 +781,7 @@ export function BottomAnchoredScrollBody({
{children} @@ -93,6 +97,7 @@ export function PageShell({
{ + const disposeNavigate = setPluginContentScriptNavigate(navigate); if (resolved) void bootPluginFrontends(); - }, [resolved]); + return () => { + void disposeNavigate(); + }; + }, [navigate, resolved]); } diff --git a/apps/app/src/lib/plugin-app-definition.test.ts b/apps/app/src/lib/plugin-app-definition.test.ts index 641e93490..02f424fc3 100644 --- a/apps/app/src/lib/plugin-app-definition.test.ts +++ b/apps/app/src/lib/plugin-app-definition.test.ts @@ -77,6 +77,12 @@ describe("collectPluginAppRegistrations", () => { id: "summarize", title: "Summarize", icon: "Zap", + experimental_placements: ["selection-menu"], + run, + }); + app.slots.experimental_messageAction({ + id: "legacy", + title: "Legacy", run, }); app.composer.customize({ @@ -139,7 +145,14 @@ describe("collectPluginAppRegistrations", () => { { id: "inline-vis", component: Component }, ]); expect(registrations.messageActions).toEqual([ - { id: "summarize", title: "Summarize", icon: "Zap", run }, + { + id: "summarize", + title: "Summarize", + icon: "Zap", + experimental_placements: ["selection-menu"], + run, + }, + { id: "legacy", title: "Legacy", run }, ]); expect(registrations.composerCustomizations).toEqual([ { @@ -380,6 +393,19 @@ describe("collectPluginAppRegistrations", () => { }), /duplicate id "a"/, ], + [ + "invalid message action placement", + () => + definePluginApp((app) => { + app.slots.experimental_messageAction({ + id: "bad-placement", + title: "Bad placement", + experimental_placements: ["sidebar" as never], + run: () => {}, + }); + }), + /entries must be "action-bar" or "selection-menu"/, + ], [ "sidebar footer action missing run", () => diff --git a/apps/app/src/lib/plugin-app-definition.ts b/apps/app/src/lib/plugin-app-definition.ts index 910b263a5..7121e0505 100644 --- a/apps/app/src/lib/plugin-app-definition.ts +++ b/apps/app/src/lib/plugin-app-definition.ts @@ -247,6 +247,29 @@ export function collectPluginAppRegistrations( if (typeof registration.run !== "function") { throw new Error(`${kind}: "run" must be a function`); } + const rawPlacements = registration.experimental_placements; + let placements: ("action-bar" | "selection-menu")[] | undefined; + if (rawPlacements !== undefined) { + if (!Array.isArray(rawPlacements) || rawPlacements.length === 0) { + throw new Error( + `${kind}: "experimental_placements" must be a non-empty array when set`, + ); + } + placements = []; + for (const placement of rawPlacements) { + if (placement !== "action-bar" && placement !== "selection-menu") { + throw new Error( + `${kind}: "experimental_placements" entries must be "action-bar" or "selection-menu"`, + ); + } + if (placements.includes(placement)) { + throw new Error( + `${kind}: "experimental_placements" must not contain duplicates`, + ); + } + placements.push(placement); + } + } messageActions.push({ id, title: requireNonEmptyString(kind, "title", registration.title), @@ -255,6 +278,9 @@ export function collectPluginAppRegistrations( icon: requireNonEmptyString(kind, "icon", registration.icon), } : {}), + ...(placements !== undefined + ? { experimental_placements: placements } + : {}), run: registration.run, }); }, diff --git a/apps/app/src/lib/plugin-content-script-context.ts b/apps/app/src/lib/plugin-content-script-context.ts new file mode 100644 index 000000000..902ef87f7 --- /dev/null +++ b/apps/app/src/lib/plugin-content-script-context.ts @@ -0,0 +1,100 @@ +import type { + BbNavigate, + PluginContentScriptContext, + PluginContentScriptDisposer, + PluginRealtimeConnectionState, + PluginRpcClient, +} from "@bb/plugin-sdk"; +import { getRootComposeRoutePath } from "./route-paths.js"; +import { callPluginRpc } from "./plugin-sdk-hooks.js"; +import { wsManager } from "./ws.js"; + +type Navigate = ( + to: string, + options?: { state?: Record }, +) => void; + +let appNavigate: Navigate | null = null; + +/** Install the app router used by imperative plugin content-script navigation. */ +export function setPluginContentScriptNavigate( + navigate: Navigate, +): PluginContentScriptDisposer { + appNavigate = navigate; + return () => { + if (appNavigate === navigate) appNavigate = null; + }; +} + +function bindDisposerToSignal( + signal: AbortSignal, + dispose: PluginContentScriptDisposer, +): PluginContentScriptDisposer { + let active = true; + const run = () => { + if (!active) return; + active = false; + signal.removeEventListener("abort", run); + void dispose(); + }; + if (signal.aborted) { + run(); + } else { + signal.addEventListener("abort", run, { once: true }); + } + return run; +} + +function toCompose(options?: Parameters[0]): void { + if (appNavigate === null) { + throw new Error("plugin content-script navigation is not mounted"); + } + appNavigate(getRootComposeRoutePath(), { + state: { + focusPrompt: options?.focusPrompt ?? false, + initialPrompt: options?.initialPrompt ?? "", + }, + }); +} + +export function createPluginContentScriptContext(args: { + pluginId: string; + generation: number; + signal: AbortSignal; +}): PluginContentScriptContext { + const { pluginId, generation, signal } = args; + const rpc: PluginRpcClient = { + call: (method: string, input?: unknown) => + callPluginRpc(fetch, pluginId, method, input), + }; + return { + pluginId, + generation, + signal, + experimental_rpc: rpc, + experimental_realtime: { + subscribe(channel, handler) { + return bindDisposerToSignal( + signal, + wsManager.onPluginSignal((event) => { + if (event.pluginId !== pluginId || event.channel !== channel) + return; + handler(event.payload); + }), + ); + }, + getConnectionState(): PluginRealtimeConnectionState { + return wsManager.getConnectionState(); + }, + subscribeConnectionState(handler) { + return bindDisposerToSignal( + signal, + wsManager.onConnectionStateChange(() => { + handler(wsManager.getConnectionState()); + }), + ); + }, + }, + experimental_navigate: { toCompose }, + }; +} diff --git a/apps/app/src/lib/plugin-frontend.ts b/apps/app/src/lib/plugin-frontend.ts index 8c776f6d7..82d492870 100644 --- a/apps/app/src/lib/plugin-frontend.ts +++ b/apps/app/src/lib/plugin-frontend.ts @@ -29,6 +29,7 @@ import type { PluginContentScriptRegistration, PluginSdkApp, } from "@bb/plugin-sdk"; +import { createPluginContentScriptContext } from "./plugin-content-script-context.js"; import { resetCrashedPluginSlots } from "@/components/plugin/PluginSlotMount"; import { collectPluginAppRegistrations, @@ -493,11 +494,13 @@ async function mountWithTimeout( let timeoutId: ReturnType | undefined; let timedOut = false; const mountPromise = Promise.resolve().then(() => - registration.mount({ - pluginId, - generation, - signal: controller.signal, - }), + registration.mount( + createPluginContentScriptContext({ + pluginId, + generation, + signal: controller.signal, + }), + ), ); const timeoutMs = deps.mountTimeoutMs ?? DEFAULT_CONTENT_SCRIPT_MOUNT_TIMEOUT_MS; diff --git a/apps/app/src/lib/plugin-message-actions.ts b/apps/app/src/lib/plugin-message-actions.ts index 91127aeb0..81caa0ef5 100644 --- a/apps/app/src/lib/plugin-message-actions.ts +++ b/apps/app/src/lib/plugin-message-actions.ts @@ -1,5 +1,6 @@ import type { PluginMessageActionContext, + experimental_PluginRenderedTextSelection, ThreadChatMessageReference, } from "@bb/plugin-sdk"; import type { MarkdownMessageDirectiveOpenThreadPanel } from "@/components/ui/markdown-message-directives"; @@ -19,6 +20,8 @@ export interface RunPluginMessageActionArgs { message: ThreadChatMessageReference; /** Present only for selection-menu invocations. */ selectedText?: string; + /** Rich rendered-text selector paired with `selectedText`. */ + selection?: experimental_PluginRenderedTextSelection; /** * The surface's thread-panel opener (same one message directives use), or * undefined on surfaces without a side panel โ€” `openPanel` then reports @@ -32,12 +35,14 @@ export function runPluginMessageAction({ threadId, message, selectedText, + selection, openThreadPanel, }: RunPluginMessageActionArgs): void { const context: PluginMessageActionContext = { threadId, message, ...(selectedText !== undefined ? { selectedText } : {}), + ...(selection !== undefined ? { experimental_selection: selection } : {}), openPanel: (options) => { if (openThreadPanel === undefined) return false; return openThreadPanel({ ...options, pluginId: slot.pluginId }); diff --git a/apps/app/src/lib/plugin-thread-message-reveal.ts b/apps/app/src/lib/plugin-thread-message-reveal.ts new file mode 100644 index 000000000..06ba623c4 --- /dev/null +++ b/apps/app/src/lib/plugin-thread-message-reveal.ts @@ -0,0 +1,31 @@ +export type PluginThreadMessageRevealResult = "revealed" | "missing"; +export type PluginThreadMessageRevealHandler = ( + messageId: string, +) => Promise; + +const revealHandlers = new Map(); + +export function registerPluginThreadMessageRevealHandler( + threadId: string, + handler: PluginThreadMessageRevealHandler, +): () => void { + revealHandlers.set(threadId, handler); + return () => { + if (revealHandlers.get(threadId) === handler) { + revealHandlers.delete(threadId); + } + }; +} + +/** + * Reveal through the currently mounted native timeline for `threadId`. + * Absence is deliberately reported as missing rather than falling back to a + * different route or another thread's DOM. + */ +export function revealPluginThreadMessage( + threadId: string, + messageId: string, +): Promise { + const handler = revealHandlers.get(threadId); + return handler?.(messageId) ?? Promise.resolve("missing"); +} diff --git a/apps/server/src/services/skills/builtin-skills/bb-plugin-authoring/SKILL.md b/apps/server/src/services/skills/builtin-skills/bb-plugin-authoring/SKILL.md index 56b99140d..0190d4fa2 100644 --- a/apps/server/src/services/skills/builtin-skills/bb-plugin-authoring/SKILL.md +++ b/apps/server/src/services/skills/builtin-skills/bb-plugin-authoring/SKILL.md @@ -816,11 +816,26 @@ compatible ESM bundle. The host mounts scripts in registration order after the bundle loads and `definePluginApp` setup validates. `mount` receives -`{ pluginId, generation, signal }`: `generation` is a monotonic per-window -mount attempt number, and `signal` aborts before cleanup starts. A script may -return nothing, a disposer, or a promise of either; async mount setup is -time-boxed to 10 seconds. Keep long-running work outside the returned promise, -observe `signal`, and catch failures in work the host does not await. +`{ pluginId, generation, signal, experimental_rpc, experimental_realtime, +experimental_navigate }`: `generation` is a monotonic per-window mount attempt +number, and `signal` aborts before cleanup starts. +`experimental_rpc.call(...)` uses the plugin's validated RPC contract; +`experimental_realtime` supplies signal subscriptions plus connection-state +observation; and `experimental_navigate.toCompose(...)` opens a new-thread +composer. Every realtime subscription returns a disposer and is also tied to +`signal`. A script may return nothing, a disposer, or a promise of either; +async mount setup is time-boxed to 10 seconds. Keep long-running work outside +the returned promise, observe `signal`, and catch failures in work the host +does not await. + +Native thread timelines expose experimental content-script hooks: +`data-bb-experimental-thread-window`, +`data-bb-experimental-thread-scroll-root`, +`data-bb-experimental-conversation-message-id`, +`data-bb-experimental-message-role`, and +`data-bb-experimental-message-prose-root`. Embedded plugin chats deliberately +omit them. Treat these selectors as pre-stable contracts and keep plugin-owned +DOM marked separately. A replacement bundle and setup validate before lifecycle cutover. The host then aborts and disposes the prior generation before mounting candidate scripts, @@ -888,7 +903,11 @@ Slot props contracts (versioned, additive-only): `{ id, title, icon?, component, layout?, run? }`. Activating it calls `run({ threadId, openPanel })` โ€” do anything there (rpc, toast), and/or call `openPanel({ title?, params? })` to open a closable panel tab - rendering `component` with `{ threadId: string, params: JsonValue | null }`. + rendering `component` with + `{ threadId: string, params: JsonValue | null, experimental_revealMessage }`. + `experimental_revealMessage(messageId)` loads and centers a native user or assistant + message in that thread, resolving `"revealed"` only after its canonical + prose root mounts and `"missing"` when the message is unavailable. Omitting `run` opens a tab immediately with defaults. Write parameters are typed as the recursively JSON-safe `JsonValue` exported by both `@bb/plugin-sdk` and `@bb/plugin-sdk/app`; they persist with the tab across reloads (null when @@ -967,14 +986,21 @@ openWorkspaceFile }` โ€” register a leaf `plugins/inline-vis` (the sidebar's path-shaped, sandboxed worktree iframe preview, including relative assets and normal web loading). - `experimental_messageAction` โ†’ an action on chat messages: an icon button in the - per-message action bar (user and assistant messages) and an entry in the - assistant-message text-selection menu. Host-rendered chrome, no plugin - component โ€” registration: `{ id, title, icon?, run }`. Activating it calls - `run(context)` with `{ threadId, message, selectedText?, openPanel }`: + per-message action bar and an entry in the text-selection menu for supported + user and assistant prose. Host-rendered chrome, no plugin component โ€” + registration: + `{ id, title, icon?, experimental_placements?, run }`. + `experimental_placements` accepts `"action-bar"` and/or `"selection-menu"`; + omission preserves both legacy placements. Activating it calls + `run(context)` with + `{ threadId, message, selectedText?, experimental_selection?, openPanel }`: `message` is a narrow stable reference `{ id, threadId, role: "user" | "assistant", text, sourceSeqEnd }` (never - an internal timeline row); `selectedText` is present only for - selection-menu invocations and holds the exact highlighted text; and + an internal timeline row); `selectedText` and `experimental_selection` are + present only for selection-menu invocations. `selectedText` holds the exact + highlighted text. `experimental_selection` adds rendered-text UTF-16 offsets, + up to 32 code units of prefix/suffix context, and viewport line-fragment + rectangles across nested Markdown nodes; and `openPanel({ actionId, title?, params? })` opens one of the same plugin's registered `threadPanelAction` components in the current thread's side panel โ€” same semantics and boolean return as diff --git a/apps/server/test/services/plugins/plugin-authoring-docs.test.ts b/apps/server/test/services/plugins/plugin-authoring-docs.test.ts index 70c2859b1..2f2f6d54f 100644 --- a/apps/server/test/services/plugins/plugin-authoring-docs.test.ts +++ b/apps/server/test/services/plugins/plugin-authoring-docs.test.ts @@ -182,6 +182,9 @@ const CONTENT_SCRIPT_CONTEXT_FIELDS = [ "pluginId", "generation", "signal", + "experimental_rpc", + "experimental_realtime", + "experimental_navigate", ] as const satisfies readonly (keyof PluginContentScriptContext)[]; type MissingContentScriptContextField = Exclude< @@ -211,20 +214,16 @@ const FRONTEND_SLOT_PROP_FIELDS = { homepageSection: ["projectId"], settingsSection: [], navPanel: ["subPath"], - threadPanelAction: ["threadId", "params"], + threadPanelAction: ["threadId", "params", "experimental_revealMessage"], pendingInteraction: ["interaction", "submit", "cancel"], sidebarFooterAction: [], fileOpener: ["path", "source"], - messageDirective: [ - "attributes", - "source", - "message", - "openWorkspaceFile", - ], + messageDirective: ["attributes", "source", "message", "openWorkspaceFile"], experimental_messageAction: [ "threadId", "message", "selectedText", + "experimental_selection", "openPanel", ], } as const satisfies { @@ -285,6 +284,7 @@ const MESSAGE_ACTION_REGISTRATION_FIELDS = [ "id", "title", "icon", + "experimental_placements", "run", ] as const satisfies readonly (keyof PluginMessageActionRegistration)[]; diff --git a/docs/api_to_audit.md b/docs/api_to_audit.md index 04d22f1d1..61b4591c7 100644 --- a/docs/api_to_audit.md +++ b/docs/api_to_audit.md @@ -48,6 +48,28 @@ Audit before stabilizing: - Is returning a disposer plus `AbortSignal` sufficient for partial mounts, or should a future context expose additive cleanup registration? +### `PluginContentScriptContext.experimental_rpc`, `.experimental_realtime`, and `.experimental_navigate` + +Lifecycle-managed content scripts receive plugin-scoped RPC, realtime +subscriptions plus connection state, and root-composer navigation without +mounting React. The matching test harness controls are also experimental: +`ContentScriptTestMountOptions.experimental_rpc`, +`.experimental_realtimeConnectionState`, +`inspection.experimental_rpcCalls`, `inspection.experimental_navigateCalls`, +`behavior.experimental_publishRealtime`, and +`behavior.experimental_setRealtimeConnectionState`. + +Audit before stabilizing: + +- Should content scripts receive the complete hook-equivalent clients, or a + smaller capability set tailored to imperative lifecycle code? +- Are automatic abort-bound realtime disposers sufficient, or should the + context expose additive cleanup registration? +- Should navigation remain limited to `toCompose`, and how should unavailable + navigation surfaces report failure? +- Does the test harness expose the minimum controls needed to verify transport, + connection, and navigation behavior? + ### `BbNavigate.experimental_openThreadPanel` A general plugin-navigation method that opens one of the current plugin's @@ -105,11 +127,16 @@ Audit before stabilizing: A plugin-contributed action on chat messages: an icon button in the per-message action bar (user and assistant messages) and an entry in the -assistant text-selection menu. Registration `{ id, title, icon?, run }`; -`run(context)` receives `{ threadId, message: ThreadChatMessageReference, -selectedText?, openPanel({ actionId, title?, params? }) }`. Errors are -contained and logged. The side-chat plugin's "Reply in side chat" is the -reference consumer. +assistant text-selection menu. Registration +`{ id, title, icon?, experimental_placements?, run }`; `run(context)` receives +`{ threadId, message: ThreadChatMessageReference, selectedText?, +experimental_selection?, openPanel({ actionId, title?, params? }) }`. The +experimental selection contains rendered-text UTF-16 offsets, quote context, +and viewport line-fragment geometry. Its exported helper types are +`experimental_PluginMessageActionPlacement` and +`experimental_PluginRenderedTextSelection`. Errors are contained and logged. +The side-chat plugin's "Reply in side chat" and Timeline Comments are reference +consumers. Audit before stabilizing: @@ -117,8 +144,46 @@ Audit before stabilizing: `ThreadChatMessageAction` already does? - Is `openPanel`-only the right navigation affordance, or do actions also need `useBbNavigate`-style routing from `run`? +- Is `experimental_placements` the right opt-in shape, including omission + meaning both action-bar and selection-menu placement? +- Are rendered-text UTF-16 offsets plus prefix/suffix context sufficient for + durable re-anchoring across Markdown rerenders? +- Should viewport rectangles stay in the activation payload, or should plugins + resolve geometry from a stable selector when needed? - Ordering/dedup policy when several plugins contribute actions. +### `PluginThreadPanelProps.experimental_revealMessage` + +Reveals a native user or assistant message in the panel's thread. The host +loads bounded older history, expands containing groups, centers the stable row, +and resolves only after its canonical prose root mounts. + +Audit before stabilizing: + +- Is `"revealed" | "missing"` enough result detail for plugins to recover or + explain failures? +- Should the method accept an explicit reveal alignment or animation policy? +- Are the older-history bounds and five-second mount deadline appropriate for + large threads and slow clients? + +### Experimental native timeline DOM hooks + +Content scripts can locate native timeline boundaries and message prose through +`data-bb-experimental-thread-window`, +`data-bb-experimental-thread-scroll-root`, +`data-bb-experimental-conversation-message-id`, +`data-bb-experimental-message-role`, and +`data-bb-experimental-message-prose-root`. Embedded plugin chats omit these +hooks. + +Audit before stabilizing: + +- Can the selector set be reduced while still supporting annotation layout and + exact-range restoration? +- Should message role remain a DOM attribute or come from the action payload? +- Are the hooks unique and stable across grouped turns, older-history loading, + streaming, and embedded chat surfaces? + ### `threadPanelAction.layout` (registration field) Not a new member, but new contract surface on an existing registration: diff --git a/official-plugins/docs/app.test.tsx b/official-plugins/docs/app.test.tsx index 509d245c7..63d915a60 100644 --- a/official-plugins/docs/app.test.tsx +++ b/official-plugins/docs/app.test.tsx @@ -781,6 +781,7 @@ describe("Docs nav panel", () => { path: "plans/release.md", title: "Release plan", }, + experimental_revealMessage: async () => "missing", }, { rpc: { diff --git a/packages/plugin-sdk/README.md b/packages/plugin-sdk/README.md index 84cd82e84..38d0a508c 100644 --- a/packages/plugin-sdk/README.md +++ b/packages/plugin-sdk/README.md @@ -31,9 +31,12 @@ controls to actions or the plus menu and larger content to banners. Use `app.experimental_contentScripts.register({ id, mount })` for ordinary bundled TypeScript/JavaScript that enhances the bb app shell without rendering -a React slot. The host supplies `{ pluginId, generation, signal }`, awaits -mount setup, and owns abort plus exact-once reverse-order disposal across hash -reload, disable, removal, failed replacement, and app-window teardown. The old +a React slot. The host supplies +`{ pluginId, generation, signal, experimental_rpc, experimental_realtime, +experimental_navigate }`, awaits mount setup, and owns abort plus exact-once +reverse-order disposal across hash reload, disable, removal, failed replacement, +and app-window teardown. RPC is plugin-scoped and schema-validated; realtime +subscriptions return disposers; navigation exposes `toCompose`. The old generation is disposed before candidate mounts, so generations never overlap. Content scripts are trusted same-origin page code, not a sandbox. diff --git a/packages/plugin-sdk/bundled-types/bb-plugin-sdk-app.d.ts b/packages/plugin-sdk/bundled-types/bb-plugin-sdk-app.d.ts index 14c88d53c..e8aa4f2b5 100644 --- a/packages/plugin-sdk/bundled-types/bb-plugin-sdk-app.d.ts +++ b/packages/plugin-sdk/bundled-types/bb-plugin-sdk-app.d.ts @@ -116,6 +116,13 @@ interface PluginThreadPanelProps { * action opened the panel without params. */ params: JsonValue | null; + /** + * Reveal a native user or assistant conversation message in this panel's + * thread. The host loads older history and expands containing groups as + * needed, centers the stable row, and resolves only after its canonical + * prose root mounts. A message from another thread is reported as missing. + */ + experimental_revealMessage(messageId: string): Promise<"revealed" | "missing">; } interface PluginPendingInteractionView { id: string; @@ -347,6 +354,31 @@ interface PluginMessageActionThreadPanelOptions { title?: string; params?: JsonValue; } +/** Where a plugin message action is rendered by host chrome. */ +type experimental_PluginMessageActionPlacement = "action-bar" | "selection-menu"; +/** + * A stable rendered-text selector captured inside one canonical message prose + * root. Offsets index the concatenation of descendant DOM text nodes in DOM + * order and therefore survive Markdown element boundaries. + */ +interface experimental_PluginRenderedTextSelection { + version: 1; + coordinateSpace: "rendered-text-utf16"; + start: number; + end: number; + exact: string; + /** At most 32 UTF-16 code units, never ending inside a surrogate pair. */ + prefix: string; + /** At most 32 UTF-16 code units, never starting inside a surrogate pair. */ + suffix: string; + /** Viewport-relative line-fragment rectangles for the captured range. */ + rects: readonly { + x: number; + y: number; + width: number; + height: number; + }[]; +} /** Context handed to a `messageAction`'s `run`. */ interface PluginMessageActionContext { /** The thread whose timeline surfaced the action. */ @@ -357,6 +389,12 @@ interface PluginMessageActionContext { * the exact text the user highlighted inside `message`. */ selectedText?: string; + /** + * Present with `selectedText` for selection-menu invocations. Omitted for + * action-bar invocations. `experimental_selection.exact` always equals + * `selectedText`. + */ + experimental_selection?: experimental_PluginRenderedTextSelection; /** * Open one of this plugin's `threadPanelAction` components in the current * thread's side panel โ€” the registration-callback equivalent of @@ -379,6 +417,12 @@ interface PluginMessageActionRegistration { title: string; /** Icon hint (BB icon name); unknown names fall back to a generic icon. */ icon?: string; + /** + * Host placements where the action appears. Omission preserves the legacy + * behavior of rendering in both the per-message action bar and the floating + * selection menu. + */ + experimental_placements?: readonly experimental_PluginMessageActionPlacement[]; /** * Runs when the user activates the action. Errors (sync or async) are * contained and logged; they never break the timeline. @@ -407,6 +451,16 @@ interface PluginContentScriptContext { readonly generation: number; /** Aborted before cleanup begins on replacement, deactivation, or teardown. */ readonly signal: AbortSignal; + /** Plugin-scoped schema-validated RPC transport. */ + readonly experimental_rpc: PluginRpcClient; + /** Plugin-scoped realtime signals and shared socket lifecycle. */ + readonly experimental_realtime: { + subscribe(channel: string, handler: (payload: unknown) => void): PluginContentScriptDisposer; + getConnectionState(): PluginRealtimeConnectionState; + subscribeConnectionState(handler: (state: PluginRealtimeConnectionState) => void): PluginContentScriptDisposer; + }; + /** Imperative navigation available outside a React slot. */ + readonly experimental_navigate: Pick; } /** Cleanup returned by a frontend content script. */ type PluginContentScriptDisposer = () => void | Promise; @@ -794,4 +848,4 @@ declare const useComposer: () => PluginComposerApi; declare const useComposerView: () => ComposerView; export { definePluginApp, experimental_Markdown, experimental_ThreadChat, useBbContext, useBbNavigate, useComposer, useComposerView, useRealtime, useRealtimeConnectionState, useRpc, useSettings }; -export type { BbContext, BbNavigate, ComposerCustomization, ComposerPlusMenuItem, ComposerRichTextSpec, ComposerStructuredDraft, ComposerView, JsonValue, MarkdownProps, PluginAppBuilder, PluginAppComposer, PluginAppContentScripts, PluginAppDefinition, PluginAppSetup, PluginAppSlots, PluginComposerApi, PluginComposerMention, PluginComposerScope, PluginComposerTextEffect, PluginComposerThreadRowStatus, PluginContentScriptContext, PluginContentScriptDisposer, PluginContentScriptRegistration, PluginFileOpenerProps, PluginFileOpenerRegistration, PluginFileOpenerSource, PluginHomepageSectionProps, PluginHomepageSectionRegistration, PluginMessageActionContext, PluginMessageActionRegistration, PluginMessageActionThreadPanelOptions, PluginMessageDirectiveMessage, PluginMessageDirectiveOpenWorkspaceFile, PluginMessageDirectiveProps, PluginMessageDirectiveRegistration, PluginNavPanelProps, PluginNavPanelRegistration, PluginPendingInteractionProps, PluginPendingInteractionRegistration, PluginPendingInteractionView, PluginRealtimeConnectionState, PluginRpcCallArgs, PluginRpcClient, PluginRpcContract, PluginRpcError, PluginRpcErrorCode, PluginRpcHandlers, PluginRpcIssuePathSegment, PluginRpcMethodContract, PluginRpcResult, PluginRpcValidationIssue, PluginSdkApp, PluginSettingsSectionProps, PluginSettingsSectionRegistration, PluginSettingsState, PluginSidebarFooterActionContext, PluginSidebarFooterActionProps, PluginSidebarFooterActionRegistration, PluginThreadPanelActionContext, PluginThreadPanelActionRegistration, PluginThreadPanelProps, StandardSchemaV1, StandardSchemaV1InferInput, StandardSchemaV1InferOutput, StandardSchemaV1Issue, StandardSchemaV1Result, ThreadChatMessageAction, ThreadChatMessageReference, ThreadChatProps }; +export type { BbContext, BbNavigate, ComposerCustomization, ComposerPlusMenuItem, ComposerRichTextSpec, ComposerStructuredDraft, ComposerView, JsonValue, MarkdownProps, PluginAppBuilder, PluginAppComposer, PluginAppContentScripts, PluginAppDefinition, PluginAppSetup, PluginAppSlots, PluginComposerApi, PluginComposerMention, PluginComposerScope, PluginComposerTextEffect, PluginComposerThreadRowStatus, PluginContentScriptContext, PluginContentScriptDisposer, PluginContentScriptRegistration, PluginFileOpenerProps, PluginFileOpenerRegistration, PluginFileOpenerSource, PluginHomepageSectionProps, PluginHomepageSectionRegistration, PluginMessageActionContext, PluginMessageActionRegistration, PluginMessageActionThreadPanelOptions, PluginMessageDirectiveMessage, PluginMessageDirectiveOpenWorkspaceFile, PluginMessageDirectiveProps, PluginMessageDirectiveRegistration, PluginNavPanelProps, PluginNavPanelRegistration, PluginPendingInteractionProps, PluginPendingInteractionRegistration, PluginPendingInteractionView, PluginRealtimeConnectionState, PluginRpcCallArgs, PluginRpcClient, PluginRpcContract, PluginRpcError, PluginRpcErrorCode, PluginRpcHandlers, PluginRpcIssuePathSegment, PluginRpcMethodContract, PluginRpcResult, PluginRpcValidationIssue, PluginSdkApp, PluginSettingsSectionProps, PluginSettingsSectionRegistration, PluginSettingsState, PluginSidebarFooterActionContext, PluginSidebarFooterActionProps, PluginSidebarFooterActionRegistration, PluginThreadPanelActionContext, PluginThreadPanelActionRegistration, PluginThreadPanelProps, StandardSchemaV1, StandardSchemaV1InferInput, StandardSchemaV1InferOutput, StandardSchemaV1Issue, StandardSchemaV1Result, ThreadChatMessageAction, ThreadChatMessageReference, ThreadChatProps, experimental_PluginMessageActionPlacement, experimental_PluginRenderedTextSelection }; diff --git a/packages/plugin-sdk/bundled-types/bb-plugin-sdk-testing-app.d.ts b/packages/plugin-sdk/bundled-types/bb-plugin-sdk-testing-app.d.ts index d92e0eb1e..68e3bd436 100644 --- a/packages/plugin-sdk/bundled-types/bb-plugin-sdk-testing-app.d.ts +++ b/packages/plugin-sdk/bundled-types/bb-plugin-sdk-testing-app.d.ts @@ -7,7 +7,7 @@ import { ReactNode, ComponentType } from 'react'; import { RenderResult } from '@testing-library/react'; -import { PluginHomepageSectionRegistration, PluginSettingsSectionRegistration, PluginNavPanelRegistration, PluginThreadPanelActionRegistration, ComposerCustomization, PluginPendingInteractionRegistration, PluginSidebarFooterActionRegistration, PluginFileOpenerRegistration, PluginMessageDirectiveRegistration, PluginMessageActionRegistration, PluginContentScriptRegistration, PluginComposerScope, PluginComposerTextEffect, PluginComposerThreadRowStatus, PluginComposerMention, BbNavigate, PluginAppDefinition, PluginRpcContract, StandardSchemaV1InferInput, PluginRpcResult, PluginRealtimeConnectionState } from '@bb/plugin-sdk'; +import { PluginHomepageSectionRegistration, PluginSettingsSectionRegistration, PluginNavPanelRegistration, PluginThreadPanelActionRegistration, ComposerCustomization, PluginPendingInteractionRegistration, PluginSidebarFooterActionRegistration, PluginFileOpenerRegistration, PluginMessageDirectiveRegistration, PluginMessageActionRegistration, PluginContentScriptRegistration, PluginComposerScope, PluginComposerTextEffect, PluginComposerThreadRowStatus, PluginComposerMention, PluginRealtimeConnectionState, BbNavigate, PluginAppDefinition, PluginRpcContract, StandardSchemaV1InferInput, PluginRpcResult } from '@bb/plugin-sdk'; /** * `@bb/plugin-sdk/testing/app` โ€” the frontend plugin test harness. Tests a @@ -114,12 +114,22 @@ interface ContentScriptTestMountOptions { pluginId: string; /** Defaults to 1. Pass the host generation you want the plugin to observe. */ generation?: number; + /** Backing handlers for `context.experimental_rpc.call`. */ + experimental_rpc?: Record unknown | Promise>; + /** Initial shared-socket lifecycle state. Defaults to connected. */ + experimental_realtimeConnectionState?: PluginRealtimeConnectionState; } interface MountedPluginContentScripts { inspection: { readonly mountedIds: readonly string[]; readonly signal: AbortSignal; readonly disposed: boolean; + readonly experimental_rpcCalls: readonly RpcCall[]; + readonly experimental_navigateCalls: readonly NavigateCall[]; + }; + behavior: { + experimental_publishRealtime(channel: string, payload: unknown): void; + experimental_setRealtimeConnectionState(state: PluginRealtimeConnectionState): void; }; lifecycle: { /** Abort, then run returned cleanup functions once in reverse order. */ diff --git a/packages/plugin-sdk/bundled-types/bb-plugin-sdk.d.ts b/packages/plugin-sdk/bundled-types/bb-plugin-sdk.d.ts index 7604361ba..3887f1c1b 100644 --- a/packages/plugin-sdk/bundled-types/bb-plugin-sdk.d.ts +++ b/packages/plugin-sdk/bundled-types/bb-plugin-sdk.d.ts @@ -121,6 +121,13 @@ interface PluginThreadPanelProps { * action opened the panel without params. */ params: JsonValue$1 | null; + /** + * Reveal a native user or assistant conversation message in this panel's + * thread. The host loads older history and expands containing groups as + * needed, centers the stable row, and resolves only after its canonical + * prose root mounts. A message from another thread is reported as missing. + */ + experimental_revealMessage(messageId: string): Promise<"revealed" | "missing">; } interface PluginPendingInteractionView { id: string; @@ -352,6 +359,31 @@ interface PluginMessageActionThreadPanelOptions { title?: string; params?: JsonValue$1; } +/** Where a plugin message action is rendered by host chrome. */ +type experimental_PluginMessageActionPlacement = "action-bar" | "selection-menu"; +/** + * A stable rendered-text selector captured inside one canonical message prose + * root. Offsets index the concatenation of descendant DOM text nodes in DOM + * order and therefore survive Markdown element boundaries. + */ +interface experimental_PluginRenderedTextSelection { + version: 1; + coordinateSpace: "rendered-text-utf16"; + start: number; + end: number; + exact: string; + /** At most 32 UTF-16 code units, never ending inside a surrogate pair. */ + prefix: string; + /** At most 32 UTF-16 code units, never starting inside a surrogate pair. */ + suffix: string; + /** Viewport-relative line-fragment rectangles for the captured range. */ + rects: readonly { + x: number; + y: number; + width: number; + height: number; + }[]; +} /** Context handed to a `messageAction`'s `run`. */ interface PluginMessageActionContext { /** The thread whose timeline surfaced the action. */ @@ -362,6 +394,12 @@ interface PluginMessageActionContext { * the exact text the user highlighted inside `message`. */ selectedText?: string; + /** + * Present with `selectedText` for selection-menu invocations. Omitted for + * action-bar invocations. `experimental_selection.exact` always equals + * `selectedText`. + */ + experimental_selection?: experimental_PluginRenderedTextSelection; /** * Open one of this plugin's `threadPanelAction` components in the current * thread's side panel โ€” the registration-callback equivalent of @@ -384,6 +422,12 @@ interface PluginMessageActionRegistration { title: string; /** Icon hint (BB icon name); unknown names fall back to a generic icon. */ icon?: string; + /** + * Host placements where the action appears. Omission preserves the legacy + * behavior of rendering in both the per-message action bar and the floating + * selection menu. + */ + experimental_placements?: readonly experimental_PluginMessageActionPlacement[]; /** * Runs when the user activates the action. Errors (sync or async) are * contained and logged; they never break the timeline. @@ -412,6 +456,16 @@ interface PluginContentScriptContext { readonly generation: number; /** Aborted before cleanup begins on replacement, deactivation, or teardown. */ readonly signal: AbortSignal; + /** Plugin-scoped schema-validated RPC transport. */ + readonly experimental_rpc: PluginRpcClient; + /** Plugin-scoped realtime signals and shared socket lifecycle. */ + readonly experimental_realtime: { + subscribe(channel: string, handler: (payload: unknown) => void): PluginContentScriptDisposer; + getConnectionState(): PluginRealtimeConnectionState; + subscribeConnectionState(handler: (state: PluginRealtimeConnectionState) => void): PluginContentScriptDisposer; + }; + /** Imperative navigation available outside a React slot. */ + readonly experimental_navigate: Pick; } /** Cleanup returned by a frontend content script. */ type PluginContentScriptDisposer = () => void | Promise; @@ -909,13 +963,13 @@ declare const changedMessageSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{ id: z$1.ZodOptional; metadata: z$1.ZodOptional; - eventTypes: z$1.ZodOptional>>>>; + eventTypes: z$1.ZodOptional>>>>; hasPendingInteraction: z$1.ZodOptional; projectId: z$1.ZodOptional; }, z$1.core.$strict>>; changes: z$1.ZodReadonly; statusReason: z$1.ZodNullable; createdAt: z$1.ZodNumber; @@ -1219,9 +1273,9 @@ declare const pluginPendingInteractionSchema: z$1.ZodObject<{ threadId: z$1.ZodString; status: z$1.ZodEnum<{ pending: "pending"; - interrupted: "interrupted"; resolving: "resolving"; resolved: "resolved"; + interrupted: "interrupted"; }>; statusReason: z$1.ZodNullable; createdAt: z$1.ZodNumber; @@ -1547,9 +1601,9 @@ declare const threadEventSchema: z$1.ZodPipe; taskStatus: z$1.ZodEnum<{ pending: "pending"; + completed: "completed"; running: "running"; paused: "paused"; - completed: "completed"; failed: "failed"; killed: "killed"; stopped: "stopped"; @@ -1775,9 +1829,9 @@ declare const threadEventSchema: z$1.ZodPipe; taskStatus: z$1.ZodEnum<{ pending: "pending"; + completed: "completed"; running: "running"; paused: "paused"; - completed: "completed"; failed: "failed"; killed: "killed"; stopped: "stopped"; @@ -1904,9 +1958,9 @@ declare const threadEventSchema: z$1.ZodPipe; taskStatus: z$1.ZodEnum<{ pending: "pending"; + completed: "completed"; running: "running"; paused: "paused"; - completed: "completed"; failed: "failed"; killed: "killed"; stopped: "stopped"; @@ -1976,9 +2030,9 @@ declare const threadEventSchema: z$1.ZodPipe; taskStatus: z$1.ZodEnum<{ pending: "pending"; + completed: "completed"; running: "running"; paused: "paused"; - completed: "completed"; failed: "failed"; killed: "killed"; stopped: "stopped"; @@ -2130,8 +2184,8 @@ declare const threadEventSchema: z$1.ZodPipe; message: z$1.ZodString; }, z$1.core.$strip>, z$1.ZodObject<{ @@ -2163,9 +2217,9 @@ declare const threadEventSchema: z$1.ZodPipe; initiator: z$1.ZodEnum<{ - system: "system"; user: "user"; agent: "agent"; + system: "system"; }>; request: z$1.ZodObject<{ method: z$1.ZodEnum<{ @@ -2184,9 +2238,9 @@ declare const threadEventSchema: z$1.ZodPipe; initiator: z$1.ZodEnum<{ - system: "system"; user: "user"; agent: "agent"; + system: "system"; }>; senderThreadId: z$1.ZodNullable; systemMessageKind: z$1.ZodOptional; origin: z$1.ZodEnum<{ - user: "user"; project: "project"; builtin: "builtin"; + user: "user"; }>; label: z$1.ZodString; argumentHint: z$1.ZodNullable; @@ -2333,9 +2387,9 @@ declare const threadEventSchema: z$1.ZodPipe; origin: z$1.ZodEnum<{ - user: "user"; project: "project"; builtin: "builtin"; + user: "user"; }>; label: z$1.ZodString; argumentHint: z$1.ZodNullable; @@ -2426,9 +2480,9 @@ declare const threadEventSchema: z$1.ZodPipe; initiator: z$1.ZodEnum<{ - system: "system"; user: "user"; agent: "agent"; + system: "system"; }>; request: z$1.ZodObject<{ method: z$1.ZodEnum<{ @@ -2475,9 +2529,9 @@ declare const threadEventSchema: z$1.ZodPipe; resolution: z$1.ZodDefault; @@ -2527,9 +2581,9 @@ declare const threadEventSchema: z$1.ZodPipe; resolution: z$1.ZodDefault; @@ -2697,8 +2751,8 @@ declare const threadTimelinePendingTodosSchema: z$1.ZodObject<{ text: z$1.ZodString; status: z$1.ZodEnum<{ pending: "pending"; - completed: "completed"; in_progress: "in_progress"; + completed: "completed"; }>; }, z$1.core.$strip>>; }, z$1.core.$strip>; @@ -2751,9 +2805,9 @@ declare const threadQueuedMessageSchema: z$1.ZodObject<{ skill: "skill"; }>; origin: z$1.ZodEnum<{ - user: "user"; project: "project"; builtin: "builtin"; + user: "user"; }>; label: z$1.ZodString; argumentHint: z$1.ZodNullable; @@ -4120,8 +4174,8 @@ declare const hostDaemonCommandRegistry: { }, z$1.core.$strict>], "kind">>; disallowedTools: z$1.ZodOptional>; instructionMode: z$1.ZodEnum<{ - append: "append"; replace: "replace"; + append: "append"; }>; type: z$1.ZodLiteral<"thread.start">; requestId: z$1.ZodString; @@ -4609,8 +4663,8 @@ declare const hostDaemonCommandRegistry: { }>; }, z$1.core.$strip>; instructionMode: z$1.ZodEnum<{ - append: "append"; replace: "replace"; + append: "append"; }>; projectId: z$1.ZodString; providerId: z$1.ZodString; @@ -4905,8 +4959,8 @@ declare const hostDaemonCommandRegistry: { }>; }, z$1.core.$strip>; instructionMode: z$1.ZodEnum<{ - append: "append"; replace: "replace"; + append: "append"; }>; projectId: z$1.ZodString; providerId: z$1.ZodString; @@ -5863,9 +5917,9 @@ declare const hostDaemonCommandRegistry: { executablePath: z$1.ZodNullable; installed: z$1.ZodBoolean; installSource: z$1.ZodEnum<{ - external: "external"; notInstalled: "notInstalled"; npmGlobal: "npmGlobal"; + external: "external"; }>; currentVersion: z$1.ZodNullable; latestVersion: z$1.ZodNullable; @@ -6038,13 +6092,13 @@ declare const hostDaemonCommandRegistry: { outcome: z$1.ZodLiteral<"unavailable">; failure: z$1.ZodObject<{ code: z$1.ZodEnum<{ + unknown: "unknown"; path_not_found: "path_not_found"; not_git_repo: "not_git_repo"; not_worktree: "not_worktree"; workspace_type_mismatch: "workspace_type_mismatch"; permission_denied: "permission_denied"; unknown_environment: "unknown_environment"; - unknown: "unknown"; }>; workspacePath: z$1.ZodString; message: z$1.ZodString; @@ -6088,13 +6142,13 @@ declare const hostDaemonCommandRegistry: { outcome: z$1.ZodLiteral<"unavailable">; failure: z$1.ZodObject<{ code: z$1.ZodEnum<{ + unknown: "unknown"; path_not_found: "path_not_found"; not_git_repo: "not_git_repo"; not_worktree: "not_worktree"; workspace_type_mismatch: "workspace_type_mismatch"; permission_denied: "permission_denied"; unknown_environment: "unknown_environment"; - unknown: "unknown"; }>; workspacePath: z$1.ZodString; message: z$1.ZodString; @@ -6150,13 +6204,13 @@ declare const hostDaemonCommandRegistry: { outcome: z$1.ZodLiteral<"unavailable">; failure: z$1.ZodObject<{ code: z$1.ZodEnum<{ + unknown: "unknown"; path_not_found: "path_not_found"; not_git_repo: "not_git_repo"; not_worktree: "not_worktree"; workspace_type_mismatch: "workspace_type_mismatch"; permission_denied: "permission_denied"; unknown_environment: "unknown_environment"; - unknown: "unknown"; }>; workspacePath: z$1.ZodString; message: z$1.ZodString; @@ -6198,13 +6252,13 @@ declare const hostDaemonCommandRegistry: { outcome: z$1.ZodLiteral<"unavailable">; failure: z$1.ZodObject<{ code: z$1.ZodEnum<{ + unknown: "unknown"; path_not_found: "path_not_found"; not_git_repo: "not_git_repo"; not_worktree: "not_worktree"; workspace_type_mismatch: "workspace_type_mismatch"; permission_denied: "permission_denied"; unknown_environment: "unknown_environment"; - unknown: "unknown"; }>; workspacePath: z$1.ZodString; message: z$1.ZodString; @@ -6322,9 +6376,9 @@ declare const providerCliStatusResponseSchema: z$1.ZodRecord; installed: z$1.ZodBoolean; installSource: z$1.ZodEnum<{ - external: "external"; notInstalled: "notInstalled"; npmGlobal: "npmGlobal"; + external: "external"; }>; currentVersion: z$1.ZodNullable; latestVersion: z$1.ZodNullable; @@ -7342,9 +7396,9 @@ declare const terminalSessionSchema: z$1.ZodObject<{ cols: z$1.ZodNumber; rows: z$1.ZodNumber; status: z$1.ZodEnum<{ + running: "running"; starting: "starting"; disconnected: "disconnected"; - running: "running"; exited: "exited"; }>; exitCode: z$1.ZodNullable; @@ -7373,9 +7427,9 @@ declare const terminalListResponseSchema: z$1.ZodObject<{ cols: z$1.ZodNumber; rows: z$1.ZodNumber; status: z$1.ZodEnum<{ + running: "running"; starting: "starting"; disconnected: "disconnected"; - running: "running"; exited: "exited"; }>; exitCode: z$1.ZodNullable; @@ -9947,8 +10001,8 @@ declare const threadTimelineResponseSchema: z$1.ZodObject<{ updatedAt: z$1.ZodNumber; objective: z$1.ZodString; status: z$1.ZodEnum<{ - active: "active"; paused: "paused"; + active: "active"; budgetLimited: "budgetLimited"; complete: "complete"; }>; @@ -11965,4 +12019,4 @@ interface BbPluginApi { } export { PLUGIN_CLI_OUTPUT_MAX_BYTES, defineRpcContract }; -export type { BbContext, BbNavigate, BbPluginApi, ComposerCustomization, ComposerPlusMenuItem, ComposerRichTextSpec, ComposerStructuredDraft, ComposerView, JsonValue$1 as JsonValue, MarkdownProps, PluginAgentConfiguration, PluginAgentConfigurationContext, PluginAgentToolContentPart, PluginAgentToolContext, PluginAgentToolRegistrationBase, PluginAgentToolResult, PluginAgentToolSelection, PluginAgents, PluginAppBuilder, PluginAppComposer, PluginAppContentScripts, PluginAppDefinition, PluginAppSetup, PluginAppSlots, PluginBackground, PluginCli, PluginCliCommandInfo, PluginCliContext, PluginCliExecutionResult, PluginCliOutputLimitError, PluginCliRegistration, PluginCliResult, PluginComposerApi, PluginComposerMention, PluginComposerScope, PluginComposerTextEffect, PluginComposerThreadRowStatus, PluginContentScriptContext, PluginContentScriptDisposer, PluginContentScriptRegistration, PluginEvents, PluginFileOpenerProps, PluginFileOpenerRegistration, PluginFileOpenerSource, PluginHomepageSectionProps, PluginHomepageSectionRegistration, PluginHosts, PluginHttp, PluginHttpAuthMode, PluginHttpHandler, PluginInteractionCancelReason, PluginInteractionRequest, PluginInteractionResult, PluginKvStorage, PluginLogger, PluginMentionItem, PluginMentionProviderRegistration, PluginMentionSearchContext, PluginMentionTrigger, PluginMessageActionContext, PluginMessageActionRegistration, PluginMessageActionThreadPanelOptions, PluginMessageDirectiveMessage, PluginMessageDirectiveOpenWorkspaceFile, PluginMessageDirectiveProps, PluginMessageDirectiveRegistration, PluginNavPanelProps, PluginNavPanelRegistration, PluginPendingInteractionProps, PluginPendingInteractionRegistration, PluginPendingInteractionView, PluginRealtime, PluginRealtimeConnectionState, PluginRpc, PluginRpcCallArgs, PluginRpcClient, PluginRpcContract, PluginRpcError, PluginRpcErrorCode, PluginRpcHandlers, PluginRpcIssuePathSegment, PluginRpcMethodContract, PluginRpcResult, PluginRpcValidationIssue, PluginSdkApp, PluginServerApi, PluginSettingDescriptor, PluginSettingDescriptors, PluginSettingValue, PluginSettings, PluginSettingsHandle, PluginSettingsSectionProps, PluginSettingsSectionRegistration, PluginSettingsState, PluginSettingsValues, PluginSharedPortTunnelIdentity, PluginSidebarFooterActionContext, PluginSidebarFooterActionProps, PluginSidebarFooterActionRegistration, PluginStatusApi, PluginStorage, PluginThreadActionContext, PluginThreadActionRegistration, PluginThreadActionResult, PluginThreadActionToast, PluginThreadEventHandler, PluginThreadEventName, PluginThreadEventPayloads, PluginThreadPanelActionContext, PluginThreadPanelActionRegistration, PluginThreadPanelProps, PluginUi, StandardSchemaV1, StandardSchemaV1InferInput, StandardSchemaV1InferOutput, StandardSchemaV1Issue, StandardSchemaV1Result, ThreadChatMessageAction, ThreadChatMessageReference, ThreadChatProps }; +export type { BbContext, BbNavigate, BbPluginApi, ComposerCustomization, ComposerPlusMenuItem, ComposerRichTextSpec, ComposerStructuredDraft, ComposerView, JsonValue$1 as JsonValue, MarkdownProps, PluginAgentConfiguration, PluginAgentConfigurationContext, PluginAgentToolContentPart, PluginAgentToolContext, PluginAgentToolRegistrationBase, PluginAgentToolResult, PluginAgentToolSelection, PluginAgents, PluginAppBuilder, PluginAppComposer, PluginAppContentScripts, PluginAppDefinition, PluginAppSetup, PluginAppSlots, PluginBackground, PluginCli, PluginCliCommandInfo, PluginCliContext, PluginCliExecutionResult, PluginCliOutputLimitError, PluginCliRegistration, PluginCliResult, PluginComposerApi, PluginComposerMention, PluginComposerScope, PluginComposerTextEffect, PluginComposerThreadRowStatus, PluginContentScriptContext, PluginContentScriptDisposer, PluginContentScriptRegistration, PluginEvents, PluginFileOpenerProps, PluginFileOpenerRegistration, PluginFileOpenerSource, PluginHomepageSectionProps, PluginHomepageSectionRegistration, PluginHosts, PluginHttp, PluginHttpAuthMode, PluginHttpHandler, PluginInteractionCancelReason, PluginInteractionRequest, PluginInteractionResult, PluginKvStorage, PluginLogger, PluginMentionItem, PluginMentionProviderRegistration, PluginMentionSearchContext, PluginMentionTrigger, PluginMessageActionContext, PluginMessageActionRegistration, PluginMessageActionThreadPanelOptions, PluginMessageDirectiveMessage, PluginMessageDirectiveOpenWorkspaceFile, PluginMessageDirectiveProps, PluginMessageDirectiveRegistration, PluginNavPanelProps, PluginNavPanelRegistration, PluginPendingInteractionProps, PluginPendingInteractionRegistration, PluginPendingInteractionView, PluginRealtime, PluginRealtimeConnectionState, PluginRpc, PluginRpcCallArgs, PluginRpcClient, PluginRpcContract, PluginRpcError, PluginRpcErrorCode, PluginRpcHandlers, PluginRpcIssuePathSegment, PluginRpcMethodContract, PluginRpcResult, PluginRpcValidationIssue, PluginSdkApp, PluginServerApi, PluginSettingDescriptor, PluginSettingDescriptors, PluginSettingValue, PluginSettings, PluginSettingsHandle, PluginSettingsSectionProps, PluginSettingsSectionRegistration, PluginSettingsState, PluginSettingsValues, PluginSharedPortTunnelIdentity, PluginSidebarFooterActionContext, PluginSidebarFooterActionProps, PluginSidebarFooterActionRegistration, PluginStatusApi, PluginStorage, PluginThreadActionContext, PluginThreadActionRegistration, PluginThreadActionResult, PluginThreadActionToast, PluginThreadEventHandler, PluginThreadEventName, PluginThreadEventPayloads, PluginThreadPanelActionContext, PluginThreadPanelActionRegistration, PluginThreadPanelProps, PluginUi, StandardSchemaV1, StandardSchemaV1InferInput, StandardSchemaV1InferOutput, StandardSchemaV1Issue, StandardSchemaV1Result, ThreadChatMessageAction, ThreadChatMessageReference, ThreadChatProps, experimental_PluginMessageActionPlacement, experimental_PluginRenderedTextSelection }; diff --git a/packages/plugin-sdk/src/app-contract.ts b/packages/plugin-sdk/src/app-contract.ts index b58758e13..e0028d039 100644 --- a/packages/plugin-sdk/src/app-contract.ts +++ b/packages/plugin-sdk/src/app-contract.ts @@ -54,6 +54,15 @@ export interface PluginThreadPanelProps { * action opened the panel without params. */ params: JsonValue | null; + /** + * Reveal a native user or assistant conversation message in this panel's + * thread. The host loads older history and expands containing groups as + * needed, centers the stable row, and resolves only after its canonical + * prose root mounts. A message from another thread is reported as missing. + */ + experimental_revealMessage( + messageId: string, + ): Promise<"revealed" | "missing">; } export interface PluginPendingInteractionView { @@ -306,6 +315,35 @@ export interface PluginMessageActionThreadPanelOptions { params?: JsonValue; } +/** Where a plugin message action is rendered by host chrome. */ +export type experimental_PluginMessageActionPlacement = + | "action-bar" + | "selection-menu"; + +/** + * A stable rendered-text selector captured inside one canonical message prose + * root. Offsets index the concatenation of descendant DOM text nodes in DOM + * order and therefore survive Markdown element boundaries. + */ +export interface experimental_PluginRenderedTextSelection { + version: 1; + coordinateSpace: "rendered-text-utf16"; + start: number; + end: number; + exact: string; + /** At most 32 UTF-16 code units, never ending inside a surrogate pair. */ + prefix: string; + /** At most 32 UTF-16 code units, never starting inside a surrogate pair. */ + suffix: string; + /** Viewport-relative line-fragment rectangles for the captured range. */ + rects: readonly { + x: number; + y: number; + width: number; + height: number; + }[]; +} + /** Context handed to a `messageAction`'s `run`. */ export interface PluginMessageActionContext { /** The thread whose timeline surfaced the action. */ @@ -316,6 +354,12 @@ export interface PluginMessageActionContext { * the exact text the user highlighted inside `message`. */ selectedText?: string; + /** + * Present with `selectedText` for selection-menu invocations. Omitted for + * action-bar invocations. `experimental_selection.exact` always equals + * `selectedText`. + */ + experimental_selection?: experimental_PluginRenderedTextSelection; /** * Open one of this plugin's `threadPanelAction` components in the current * thread's side panel โ€” the registration-callback equivalent of @@ -339,6 +383,12 @@ export interface PluginMessageActionRegistration { title: string; /** Icon hint (BB icon name); unknown names fall back to a generic icon. */ icon?: string; + /** + * Host placements where the action appears. Omission preserves the legacy + * behavior of rendering in both the per-message action bar and the floating + * selection menu. + */ + experimental_placements?: readonly experimental_PluginMessageActionPlacement[]; /** * Runs when the user activates the action. Errors (sync or async) are * contained and logged; they never break the timeline. @@ -378,6 +428,21 @@ export interface PluginContentScriptContext { readonly generation: number; /** Aborted before cleanup begins on replacement, deactivation, or teardown. */ readonly signal: AbortSignal; + /** Plugin-scoped schema-validated RPC transport. */ + readonly experimental_rpc: PluginRpcClient; + /** Plugin-scoped realtime signals and shared socket lifecycle. */ + readonly experimental_realtime: { + subscribe( + channel: string, + handler: (payload: unknown) => void, + ): PluginContentScriptDisposer; + getConnectionState(): PluginRealtimeConnectionState; + subscribeConnectionState( + handler: (state: PluginRealtimeConnectionState) => void, + ): PluginContentScriptDisposer; + }; + /** Imperative navigation available outside a React slot. */ + readonly experimental_navigate: Pick; } /** Cleanup returned by a frontend content script. */ diff --git a/packages/plugin-sdk/src/testing/__tests__/app-harness.test.tsx b/packages/plugin-sdk/src/testing/__tests__/app-harness.test.tsx index 9e1da9b2b..1ae488b51 100644 --- a/packages/plugin-sdk/src/testing/__tests__/app-harness.test.tsx +++ b/packages/plugin-sdk/src/testing/__tests__/app-harness.test.tsx @@ -285,6 +285,62 @@ describe("loadPluginApp", () => { ]); }); + it("drives content-script RPC, realtime, connection state, and navigation with abort cleanup", async () => { + const events: string[] = []; + const captured = await loadPluginApp( + definePluginApp((builder) => { + builder.experimental_contentScripts.register({ + id: "controller", + async mount({ + experimental_rpc, + experimental_realtime, + experimental_navigate, + }) { + const result = await experimental_rpc.call("list", { + threadId: "thr_1", + }); + events.push(`rpc:${String(result)}`); + experimental_realtime.subscribe("changed", (payload) => { + events.push(`signal:${String(payload)}`); + }); + experimental_realtime.subscribeConnectionState((state) => { + events.push(`connection:${state}`); + }); + experimental_navigate.toCompose({ + initialPrompt: "Follow up", + focusPrompt: true, + }); + }, + }); + }), + ); + const mounted = await mountPluginContentScripts(captured, { + pluginId: "demo", + experimental_rpc: { list: () => "ready" }, + }); + + expect(mounted.inspection.experimental_rpcCalls).toEqual([ + { method: "list", input: { threadId: "thr_1" } }, + ]); + expect(mounted.inspection.experimental_navigateCalls).toEqual([ + { + method: "toCompose", + options: { initialPrompt: "Follow up", focusPrompt: true }, + }, + ]); + mounted.behavior.experimental_publishRealtime("changed", "thread-1"); + mounted.behavior.experimental_setRealtimeConnectionState("reconnecting"); + expect(events).toEqual([ + "rpc:ready", + "signal:thread-1", + "connection:reconnecting", + ]); + + await mounted.lifecycle.dispose(); + mounted.behavior.experimental_publishRealtime("changed", "ignored"); + expect(events).toHaveLength(3); + }); + it("rolls back earlier content scripts when a later mount rejects", async () => { const events: string[] = []; const captured = await loadPluginApp( diff --git a/packages/plugin-sdk/src/testing/app.tsx b/packages/plugin-sdk/src/testing/app.tsx index 77941fc13..e12516ba6 100644 --- a/packages/plugin-sdk/src/testing/app.tsx +++ b/packages/plugin-sdk/src/testing/app.tsx @@ -587,12 +587,38 @@ function collectRegistrations( if (typeof registration.run !== "function") { throw new Error(`${kind}: "run" must be a function`); } + const rawPlacements = registration.experimental_placements; + let placements: ("action-bar" | "selection-menu")[] | undefined; + if (rawPlacements !== undefined) { + if (!Array.isArray(rawPlacements) || rawPlacements.length === 0) { + throw new Error( + `${kind}: "experimental_placements" must be a non-empty array when set`, + ); + } + placements = []; + for (const placement of rawPlacements) { + if (placement !== "action-bar" && placement !== "selection-menu") { + throw new Error( + `${kind}: "experimental_placements" entries must be "action-bar" or "selection-menu"`, + ); + } + if (placements.includes(placement)) { + throw new Error( + `${kind}: "experimental_placements" must not contain duplicates`, + ); + } + placements.push(placement); + } + } captured.messageActions.push({ id, title: requireNonEmptyString(kind, "title", registration.title), ...(registration.icon !== undefined ? { icon: requireNonEmptyString(kind, "icon", registration.icon) } : {}), + ...(placements !== undefined + ? { experimental_placements: placements } + : {}), run: registration.run, }); }, @@ -651,6 +677,13 @@ export interface ContentScriptTestMountOptions { pluginId: string; /** Defaults to 1. Pass the host generation you want the plugin to observe. */ generation?: number; + /** Backing handlers for `context.experimental_rpc.call`. */ + experimental_rpc?: Record< + string, + (input: unknown) => unknown | Promise + >; + /** Initial shared-socket lifecycle state. Defaults to connected. */ + experimental_realtimeConnectionState?: PluginRealtimeConnectionState; } export interface MountedPluginContentScripts { @@ -658,6 +691,14 @@ export interface MountedPluginContentScripts { readonly mountedIds: readonly string[]; readonly signal: AbortSignal; readonly disposed: boolean; + readonly experimental_rpcCalls: readonly RpcCall[]; + readonly experimental_navigateCalls: readonly NavigateCall[]; + }; + behavior: { + experimental_publishRealtime(channel: string, payload: unknown): void; + experimental_setRealtimeConnectionState( + state: PluginRealtimeConnectionState, + ): void; }; lifecycle: { /** Abort, then run returned cleanup functions once in reverse order. */ @@ -680,6 +721,14 @@ export async function mountPluginContentScripts( id: string; dispose: PluginContentScriptDisposer | null; }> = []; + const rpcCalls: RpcCall[] = []; + const navigateCalls: NavigateCall[] = []; + const realtimeHandlers = new Map void>>(); + const connectionStateHandlers = new Set< + (state: PluginRealtimeConnectionState) => void + >(); + let connectionState = + options.experimental_realtimeConnectionState ?? "connected"; let disposed = false; const dispose = async (): Promise => { @@ -700,10 +749,63 @@ export async function mountPluginContentScripts( try { for (const registration of app.contentScripts) { + const rpc = { + async call(method: string, input?: unknown) { + rpcCalls.push({ method, input: input ?? null }); + const handler = options.experimental_rpc?.[method]; + if (handler === undefined) { + throw new Error(`No content-script RPC handler for "${method}"`); + } + return handler(input ?? null); + }, + } as PluginRpcClient; const result = await registration.mount({ pluginId: options.pluginId, generation, signal: controller.signal, + experimental_rpc: rpc, + experimental_realtime: { + subscribe(channel, handler) { + const handlers = realtimeHandlers.get(channel) ?? new Set(); + handlers.add(handler); + realtimeHandlers.set(channel, handlers); + let active = true; + const unsubscribe = () => { + if (!active) return; + active = false; + handlers.delete(handler); + if (handlers.size === 0) realtimeHandlers.delete(channel); + }; + controller.signal.addEventListener("abort", unsubscribe, { + once: true, + }); + return unsubscribe; + }, + getConnectionState: () => connectionState, + subscribeConnectionState(handler) { + connectionStateHandlers.add(handler); + let active = true; + const unsubscribe = () => { + if (!active) return; + active = false; + connectionStateHandlers.delete(handler); + }; + controller.signal.addEventListener("abort", unsubscribe, { + once: true, + }); + return unsubscribe; + }, + }, + experimental_navigate: { + toCompose(navigateOptions) { + navigateCalls.push({ + method: "toCompose", + ...(navigateOptions !== undefined + ? { options: navigateOptions } + : {}), + }); + }, + }, }); if (result !== undefined && typeof result !== "function") { throw new Error( @@ -726,6 +828,19 @@ export async function mountPluginContentScripts( get disposed() { return disposed; }, + experimental_rpcCalls: rpcCalls, + experimental_navigateCalls: navigateCalls, + }, + behavior: { + experimental_publishRealtime(channel, payload) { + for (const handler of realtimeHandlers.get(channel) ?? []) { + handler(payload); + } + }, + experimental_setRealtimeConnectionState(state) { + connectionState = state; + for (const handler of connectionStateHandlers) handler(state); + }, }, lifecycle: { dispose }, }; diff --git a/packages/templates/src/generated/plugin-sdk-dts.generated.ts b/packages/templates/src/generated/plugin-sdk-dts.generated.ts index 0dffa7155..7e62fc362 100644 --- a/packages/templates/src/generated/plugin-sdk-dts.generated.ts +++ b/packages/templates/src/generated/plugin-sdk-dts.generated.ts @@ -2,6 +2,6 @@ // Generated by packages/templates/scripts/generate-templates.mjs from // @bb/plugin-sdk/bundled-types. Do not edit directly. -export const PLUGIN_SDK_DTS = "// Portable type declarations for `@bb/plugin-sdk`. Unpublished BB\n// workspace contracts are flattened; public subpaths may reuse the\n// package root without requiring any other @bb/* package.\n//\n// Confused by the API, or need a symbol that isn't here? Clone the BB repo\n// and read the real source: https://github.com/ymichael/bb\n\nimport { ComponentType, ReactNode } from 'react';\nimport Database from 'better-sqlite3';\nimport { Context } from 'hono';\nimport * as z from 'zod';\nimport { z as z$1 } from 'zod';\n\n/**\n * A value that survives a JSON round trip without coercion or data loss.\n *\n * Host boundaries still validate values at runtime because TypeScript cannot\n * exclude non-finite numbers and plugin bundles can bypass static types.\n */\ntype JsonValue$1 = string | number | boolean | null | JsonValue$1[] | {\n [key: string]: JsonValue$1;\n};\n\n/** A JSON-safe path segment reported by a Standard Schema validation issue. */\ntype PluginRpcIssuePathSegment = string | number;\n/** Validator-neutral validation detail carried by an RPC error envelope. */\ninterface PluginRpcValidationIssue {\n message: string;\n path?: PluginRpcIssuePathSegment[];\n}\n/** Stable wire error categories for plugin RPC. */\ntype PluginRpcErrorCode = \"invalid_json\" | \"invalid_input\" | \"handler_error\" | \"invalid_output\" | \"non_json_result\" | \"unknown_method\";\n/** Structured RPC failure returned as `{ ok: false, error }`. */\ninterface PluginRpcError {\n code: PluginRpcErrorCode;\n message: string;\n issues?: PluginRpcValidationIssue[];\n}\n/**\n * The validator-neutral subset of Standard Schema v1 used by plugin RPC.\n * Zod 4 schemas implement this interface directly; other validators can do\n * the same without becoming part of BB's public protocol.\n */\ninterface StandardSchemaV1 {\n readonly \"~standard\": {\n readonly version: 1;\n readonly vendor: string;\n readonly validate: (value: unknown) => StandardSchemaV1Result | Promise>;\n readonly types?: {\n readonly input: Input;\n readonly output: Output;\n };\n };\n}\ntype StandardSchemaV1Result = {\n readonly value: Output;\n readonly issues?: undefined;\n} | {\n readonly issues: readonly StandardSchemaV1Issue[];\n};\ninterface StandardSchemaV1Issue {\n readonly message: string;\n readonly path?: PropertyKey | readonly (PropertyKey | {\n readonly key: PropertyKey;\n })[];\n}\ntype StandardSchemaV1InferInput = NonNullable[\"input\"];\ntype StandardSchemaV1InferOutput = NonNullable[\"output\"];\ninterface PluginRpcMethodContract {\n readonly input: InputSchema;\n readonly output: OutputSchema;\n}\ntype PluginRpcContract = Readonly>;\n/** Define a shared RPC contract while preserving exact method/schema types. */\ndeclare function defineRpcContract(contract: Contract): Contract;\ntype PluginRpcHandlers = {\n [Method in keyof Contract]: (input: StandardSchemaV1InferOutput) => StandardSchemaV1InferInput | Promise>;\n};\ntype PluginRpcCallInput = StandardSchemaV1InferInput;\ntype PluginRpcCallArgs = null extends PluginRpcCallInput ? [input?: PluginRpcCallInput] : [input: PluginRpcCallInput];\ntype PluginRpcResult = StandardSchemaV1InferOutput;\n\n/**\n * The `@bb/plugin-sdk/app` contract (plugin design ยง5.2) โ€” pure types with no\n * side effects. The BB app imports these to keep its real implementation in\n * sync (`satisfies PluginSdkApp`). Plugin authors import the same shapes through\n * `@bb/plugin-sdk/app`.\n *\n * Per-slot props are versioned contracts: additive-only within an SDK major.\n */\n/** Props passed to a `homepageSection` component. */\ninterface PluginHomepageSectionProps {\n /** Project in view on the compose surface; null when none is selected. */\n projectId: string | null;\n}\n/**\n * Props passed to a `settingsSection` component.\n *\n * Deliberately empty in V1; versioned additive like the other slot props.\n */\ninterface PluginSettingsSectionProps {\n}\n/** Props passed to a `navPanel` component (it owns its whole route). */\ninterface PluginNavPanelProps {\n /**\n * The route remainder after the panel root, \"\" at the root. The panel's\n * route is `/plugins///*`, so a deep link like\n * `/plugins/notes/notes/work/ideas.md` renders the panel with\n * `subPath: \"work/ideas.md\"`. Navigate within the panel via\n * `useBbNavigate().toPluginPanel(path, { subPath })` โ€” browser\n * back/forward then walks panel-internal history.\n */\n subPath: string;\n}\n/** Props passed to a panel tab opened by a `threadPanelAction`. */\ninterface PluginThreadPanelProps {\n threadId: string;\n /**\n * The JSON value the action's `openPanel` call passed (round-tripped\n * through persistence, so the tab restores across reloads); null when the\n * action opened the panel without params.\n */\n params: JsonValue$1 | null;\n}\ninterface PluginPendingInteractionView {\n id: string;\n threadId: string;\n title: string;\n payload: JsonValue$1;\n createdAt: number;\n expiresAt: number | null;\n}\ninterface PluginPendingInteractionProps {\n interaction: PluginPendingInteractionView;\n submit(value: JsonValue$1): Promise;\n cancel(): Promise;\n}\n/**\n * Props for a `sidebarFooterAction` โ€” host-rendered (no plugin component).\n * Deliberately empty; the registration's `run` carries the behavior.\n */\ninterface PluginSidebarFooterActionProps {\n}\n/**\n * Where a file being opened by a `fileOpener` lives. `path` semantics follow\n * the source: workspace paths are relative to the environment's worktree,\n * thread-storage paths are relative to the thread's storage root, host paths\n * are absolute on the thread's host.\n */\ninterface PluginFileOpenerSource {\n kind: \"workspace\" | \"host\" | \"thread-storage\";\n threadId: string | null;\n environmentId: string | null;\n projectId: string | null;\n}\n/** Props passed to a `fileOpener` component (rendered as a panel file tab). */\ninterface PluginFileOpenerProps {\n path: string;\n source: PluginFileOpenerSource;\n}\n/**\n * Message context passed to a `messageDirective` component โ€” the assistant\n * (or nested agent) message that contained the directive.\n */\ninterface PluginMessageDirectiveMessage {\n id: string;\n threadId: string;\n turnId: string | null;\n projectId: string | null;\n}\n/**\n * Open a worktree-relative file in the host's workspace file viewer. Returns\n * true when the host accepted the path; false when the path is invalid or the\n * viewer declined it.\n */\ntype PluginMessageDirectiveOpenWorkspaceFile = (path: string) => boolean;\n/**\n * Props passed to a `messageDirective` component. Attributes are untrusted\n * strings parsed from the directive; the plugin validates its own fields.\n */\ninterface PluginMessageDirectiveProps {\n /** Parsed, untrusted directive attributes (e.g. `{ file: \"demo.html\" }`). */\n attributes: Readonly>;\n /** Original directive source text (useful for diagnostics / crash fallback). */\n source: string;\n message: PluginMessageDirectiveMessage;\n /**\n * Opens a worktree-relative file in the host's workspace file viewer. Null\n * when the message surface has no workspace viewer available.\n */\n openWorkspaceFile: PluginMessageDirectiveOpenWorkspaceFile | null;\n}\ninterface PluginHomepageSectionRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n title: string;\n component: ComponentType;\n}\ninterface PluginSettingsSectionRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Optional host-rendered section heading. */\n title?: string;\n /**\n * Optional one-line host-rendered subheading under `title`, in the built-in\n * SettingsSection idiom (ignored when `title` is absent).\n */\n description?: string;\n component: ComponentType;\n}\ninterface PluginNavPanelRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n title: string;\n /** Icon hint (BB icon name); unknown names fall back to a generic icon. */\n icon: string;\n /** URL segment under `/plugins//`; letters, digits, `-`, `_`. */\n path: string;\n component: ComponentType;\n /**\n * Optional component rendered on the right side of the shared title bar\n * (e.g. a sync button or a count). Contained separately from the body: a\n * throwing headerContent is hidden without breaking the title bar.\n */\n headerContent?: ComponentType;\n}\n/** Context handed to a `threadPanelAction`'s `run`. */\ninterface PluginThreadPanelActionContext {\n /** The thread whose panel launcher invoked the action. */\n threadId: string;\n /**\n * Open a tab in the thread's side panel rendering this action's\n * `component`. `title` labels the tab (default: the action's `title`);\n * `params` must be JSON-serializable โ€” it is persisted with the tab and\n * reaches the component as its `params` prop. Opening with params\n * identical to an already-open tab of this action focuses that tab\n * (updating its title) instead of duplicating it. May be called more than\n * once (different params โ‡’ multiple tabs) or not at all.\n */\n openPanel(options?: {\n title?: string;\n params?: JsonValue$1;\n }): void;\n}\ninterface PluginThreadPanelActionRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Label of the action row in the panel's new-tab launcher. */\n title: string;\n /**\n * Icon hint (BB icon name) used when the plugin ships no logo; the\n * launcher row and opened tabs prefer the plugin's logo.\n */\n icon?: string;\n /** Rendered inside every panel tab this action opens. */\n component: ComponentType;\n /**\n * How the host frames the tab content. \"padded\" (default) wraps the\n * component in the panel's scroll container with standard padding โ€”\n * right for document-like content. \"flush\" gives the component the full\n * tab area (no padding, definite height, no host scrolling) โ€” right for\n * app-like content that manages its own layout, such as\n * `experimental_ThreadChat`.\n */\n layout?: \"padded\" | \"flush\";\n /**\n * Runs when the user activates the action: call your RPC methods, show a\n * toast, and/or open panel tabs via `context.openPanel`. Omitted =\n * immediately open a panel tab with defaults. Errors (sync or async) are\n * contained and logged; they never break the launcher.\n */\n run?(context: PluginThreadPanelActionContext): void | Promise;\n}\ninterface PluginPendingInteractionRegistration {\n /** Matches `rendererId` passed to `bb.ui.requestInput`. */\n id: string;\n component: ComponentType;\n}\n/** Context handed to a `sidebarFooterAction`'s `run`. */\ninterface PluginSidebarFooterActionContext {\n /**\n * Navigate to this plugin's detail page in Tools, where declarative settings\n * and `settingsSection` slots render.\n */\n openSettings(): void;\n}\n/**\n * An icon button in the app sidebar footer (next to Settings / bug report).\n * Host-rendered for consistent chrome โ€” plugins supply icon, label, and\n * `run` behavior only.\n */\ninterface PluginSidebarFooterActionRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Tooltip and accessible label for the icon button. */\n title: string;\n /** Icon hint (BB icon name); unknown names fall back to a generic icon. */\n icon: string;\n /**\n * Runs when the user activates the action (e.g. call `openSettings()`,\n * open a panel via other surfaces, toast). Errors (sync or async) are\n * contained and logged; they never break the sidebar.\n */\n run(context: PluginSidebarFooterActionContext): void | Promise;\n}\n/**\n * Register this plugin as a viewer/editor for file extensions. The user\n * picks (and can set as default) an opener per extension via the file tab's\n * \"Open with\" menu; matching files opened in the panel then render\n * `component` in a plugin tab instead of the built-in preview. Applies to\n * working-tree, host, and thread-storage files โ€” never to git-ref snapshots\n * (diff views always use the built-in preview). The built-in preview stays\n * one menu click away, and a missing/disabled opener falls back to it.\n */\ninterface PluginFileOpenerRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Label in the \"Open with\" menu (e.g. \"Notes editor\"). */\n title: string;\n /** Lowercase extensions without the dot (e.g. [\"md\", \"mdx\"]). */\n extensions: readonly string[];\n component: ComponentType;\n}\n/**\n * Register a leaf message directive rendered inside assistant (and nested\n * agent) message Markdown. `id` is the directive name: `inline-vis` matches\n * `::inline-vis{file=\"demo.html\"}`.\n */\ninterface PluginMessageDirectiveRegistration {\n /**\n * The directive name. Lowercase kebab-case beginning with a letter.\n */\n id: string;\n component: ComponentType;\n}\n/**\n * A narrow, stable reference to one rendered chat message โ€” NOT an internal\n * timeline row. `sourceSeqEnd` is the last source event sequence the message\n * covers, the anchor the server accepts for provider-history forks.\n */\ninterface ThreadChatMessageReference {\n id: string;\n threadId: string;\n role: \"user\" | \"assistant\";\n /** Visible text of the message. */\n text: string;\n sourceSeqEnd: number;\n}\ninterface PluginMessageActionThreadPanelOptions {\n /** A `threadPanelAction` id registered by this same plugin. */\n actionId: string;\n title?: string;\n params?: JsonValue$1;\n}\n/** Context handed to a `messageAction`'s `run`. */\ninterface PluginMessageActionContext {\n /** The thread whose timeline surfaced the action. */\n threadId: string;\n message: ThreadChatMessageReference;\n /**\n * Present only when the action was invoked from the text-selection menu;\n * the exact text the user highlighted inside `message`.\n */\n selectedText?: string;\n /**\n * Open one of this plugin's `threadPanelAction` components in the current\n * thread's side panel โ€” the registration-callback equivalent of\n * `useBbNavigate().experimental_openThreadPanel`. Returns true when the host\n * accepted (the action id exists and the surface has a panel); false\n * otherwise.\n */\n openPanel(options: PluginMessageActionThreadPanelOptions): boolean;\n}\n/**\n * An action on chat messages: an icon button in the per-message action bar\n * (user and assistant messages) and an entry in the assistant-message\n * text-selection menu. Host-rendered chrome โ€” the plugin supplies title,\n * icon hint, and `run` behavior only.\n */\ninterface PluginMessageActionRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Tooltip / menu label for the action. */\n title: string;\n /** Icon hint (BB icon name); unknown names fall back to a generic icon. */\n icon?: string;\n /**\n * Runs when the user activates the action. Errors (sync or async) are\n * contained and logged; they never break the timeline.\n */\n run(context: PluginMessageActionContext): void | Promise;\n}\ninterface PluginAppSlots {\n homepageSection(registration: PluginHomepageSectionRegistration): void;\n settingsSection(registration: PluginSettingsSectionRegistration): void;\n navPanel(registration: PluginNavPanelRegistration): void;\n threadPanelAction(registration: PluginThreadPanelActionRegistration): void;\n pendingInteraction(registration: PluginPendingInteractionRegistration): void;\n sidebarFooterAction(registration: PluginSidebarFooterActionRegistration): void;\n fileOpener(registration: PluginFileOpenerRegistration): void;\n messageDirective(registration: PluginMessageDirectiveRegistration): void;\n experimental_messageAction(registration: PluginMessageActionRegistration): void;\n}\ninterface PluginAppComposer {\n customize(registration: ComposerCustomization): void;\n}\n/** Stable lifecycle values for one content-script instance in one bb client. */\ninterface PluginContentScriptContext {\n /** The id of the plugin that owns this script. */\n readonly pluginId: string;\n /** Monotonic per-client generation, starting at 1. */\n readonly generation: number;\n /** Aborted before cleanup begins on replacement, deactivation, or teardown. */\n readonly signal: AbortSignal;\n}\n/** Cleanup returned by a frontend content script. */\ntype PluginContentScriptDisposer = () => void | Promise;\n/**\n * Trusted same-origin JavaScript/TypeScript mounted once per active frontend\n * generation in each bb app window or browser tab.\n */\ninterface PluginContentScriptRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /**\n * Install behavior into the bb app shell. The host awaits a returned\n * promise, contains failures, and calls the returned disposer exactly once.\n */\n mount(context: PluginContentScriptContext): void | PluginContentScriptDisposer | Promise;\n}\n/** Experimental lifecycle surface for trusted frontend content scripts. */\ninterface PluginAppContentScripts {\n register(registration: PluginContentScriptRegistration): void;\n}\ninterface PluginAppBuilder {\n slots: PluginAppSlots;\n composer: PluginAppComposer;\n experimental_contentScripts: PluginAppContentScripts;\n}\ntype PluginAppSetup = (app: PluginAppBuilder) => void;\n/**\n * The opaque product of `definePluginApp` โ€” a plugin's `app.tsx` default\n * export. The host re-runs `setup` against a fresh collector on every\n * (re)interpretation, replacing that plugin's registrations wholesale.\n */\ninterface PluginAppDefinition {\n /** Brand the host checks before interpreting a bundle's default export. */\n readonly __bbPluginApp: true;\n readonly setup: PluginAppSetup;\n}\ninterface PluginRpcClient {\n /**\n * Invoke one of the plugin's `bb.rpc` methods (POST\n * /api/v1/plugins/<id>/rpc/<method>). Resolves with the method's\n * inferred output; rejects with an `Error` carrying the server's message,\n * stable `code`, and validation `issues` when present.\n */\n call>(method: Method, ...args: PluginRpcCallArgs): Promise>;\n}\ninterface PluginSettingsState {\n /**\n * Effective non-secret setting values (secret settings are excluded โ€”\n * read them server-side). Undefined while loading or unavailable.\n */\n values: Record | undefined;\n isLoading: boolean;\n}\n/** State of the app's shared realtime connection to the bb server. */\ntype PluginRealtimeConnectionState = \"connecting\" | \"connected\" | \"reconnecting\";\n/** Where `useComposer()` writes. */\ntype PluginComposerScope = {\n kind: \"thread\";\n threadId: string;\n} | {\n kind: \"queued-message\";\n threadId: string;\n queuedMessageId: string;\n} | {\n kind: \"side-chat\";\n projectId: string;\n parentThreadId: string;\n tabId: string;\n childThreadId: string | null;\n} | {\n kind: \"new-thread\";\n /** Root compose's effective selected project; null only while unresolved. */\n projectId: string | null;\n};\n/** One plugin-owned composer customization registration. */\ninterface ComposerCustomization {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Composer kinds where this customization is active; omit for all kinds. */\n scopes?: readonly PluginComposerScope[\"kind\"][];\n actions?: readonly {\n id: string;\n component: ComponentType;\n }[];\n banners?: readonly {\n id: string;\n /** Host chrome around the banner. Defaults to `\"card\"`. */\n chrome?: \"card\" | \"bare\";\n component: ComponentType;\n }[];\n plusMenu?: readonly ComposerPlusMenuItem[];\n richText?: ComposerRichTextSpec;\n}\n/** Host-rendered menu row in the composer's `+` menu. */\ninterface ComposerPlusMenuItem {\n id: string;\n label: string;\n /** BB icon name; unknown names fall back to the generic plugin icon. */\n icon?: string;\n /** Accessible description for the host-rendered row. */\n description?: string;\n disabled?: boolean | ((view: ComposerView) => boolean);\n run(context: {\n composer: PluginComposerApi;\n view: ComposerView;\n }): void | Promise;\n}\n/** Reactive read-side of the composer a plugin surface is mounted in. */\ninterface ComposerView {\n scope: PluginComposerScope;\n layout: \"expanded\" | \"compact\" | \"zen\";\n draft: {\n text: string;\n isEmpty: boolean;\n attachmentCount: number;\n };\n run: {\n isRunning: boolean;\n isSubmitting: boolean;\n };\n}\ninterface ComposerRichTextSpec {\n /** Content-derived paint: match ranges receive `className`; text is never mutated. */\n effects?: readonly {\n id: string;\n /** Plain-text offsets into the current structured draft. */\n match(text: string): readonly {\n from: number;\n to: number;\n }[];\n className: string;\n }[];\n /** Debounced, read-only observation of the structured draft. */\n onDraftChange?(draft: ComposerStructuredDraft, view: ComposerView): void;\n}\ninterface ComposerStructuredDraft {\n text: string;\n mentions: readonly {\n from: number;\n to: number;\n provider: string;\n id: string;\n label: string;\n }[];\n}\n/** Host-rendered paint applied to the editable composer text. */\ninterface PluginComposerTextEffect {\n className: string;\n}\n/** Host-rendered status that temporarily replaces a thread's draft glyph. */\ninterface PluginComposerThreadRowStatus {\n /** BB icon-name hint; unknown names fall back to the generic plugin icon. */\n icon: string;\n /** Accessible label for the status glyph. */\n label: string;\n /**\n * Semantic host treatment for the status glyph. `running` automatically\n * shimmers; terminal `success` and `error` tones are static. Defaults to the\n * neutral tone.\n */\n tone?: \"default\" | \"running\" | \"success\" | \"error\";\n}\n/** An @-mention pill bound to one of the calling plugin's mention providers. */\ninterface PluginComposerMention {\n /** Mention provider id registered by THIS plugin via `bb.ui.registerMentionProvider`. */\n provider: string;\n /** Item id your provider's `resolve` will receive at send time. */\n id: string;\n /** Pill text shown in the composer. */\n label: string;\n}\n/**\n * Programmatic access to the chat composer draft โ€” the same shared draft the\n * built-in \"Add to chat\" affordances (file preview, diff, terminal selections)\n * write to. While a queued message is being edited, writes land in that\n * message's inline editor. In a side chat, writes land in the visible side-chat\n * draft. Otherwise, inside a thread context writes land in that thread's draft;\n * anywhere else (nav panel, homepage section) they seed the new-thread composer\n * draft, which persists until the user sends or clears it.\n */\ninterface PluginComposerApi {\n scope: PluginComposerScope;\n /** Current plain text for this composer scope. */\n readonly text: string;\n /**\n * Replace the draft's plain text. Attachments are preserved. Inline mentions\n * outside the changed range are preserved and rebased; mentions overlapped\n * by the replacement are removed because their text representation changed.\n */\n setText(next: string): void;\n /**\n * Replace the draft's plain text from the latest committed value. Uses the\n * same structured-state reconciliation as `setText`.\n */\n updateText(updater: (current: string) => string): void;\n /** Clear plain text without clearing independently attached files. */\n clear(): void;\n /**\n * Apply a host-rendered effect to this composer's editable text, or clear it.\n * Effects are scoped to the calling plugin and automatically clear when the\n * slot unmounts or its composer scope changes.\n */\n setTextEffect(effect: PluginComposerTextEffect | null): void;\n /**\n * Lock or unlock editing for this composer. Locks are scoped to the calling\n * plugin and automatically release when the slot unmounts or its composer\n * scope changes.\n */\n setInputLock(locked: boolean): void;\n /**\n * Replace this composer's thread-row draft glyph with a host-rendered status,\n * or clear it. New-thread composers have no row, so calls are a no-op.\n * Side-chat and queued side-chat scopes decorate the visible parent-thread\n * row. Status is scoped to the calling plugin and automatically clears when\n * the slot unmounts or its composer scope changes.\n */\n setThreadRowStatus(status: PluginComposerThreadRowStatus | null): void;\n /**\n * Append text to the draft as a `> ` blockquote block and focus the\n * composer. Blank text is a no-op. This is the \"reference this selection\n * in chat\" primitive.\n */\n addQuote(text: string): void;\n /**\n * Insert an @-mention pill that resolves through this plugin's mention\n * provider at send time โ€” the durable way to reference an entity whose\n * content should be fetched fresh when the message is sent.\n */\n insertMention(mention: PluginComposerMention): void;\n /** Focus the composer caret at the end of the draft. */\n focus(): void;\n}\n/**\n * A consumer-supplied action on the messages of one `ThreadChat` instance,\n * rendered in the embedded timeline's per-message action bar alongside the\n * native and slot-registered actions. Unlike the `messageAction` slot this is\n * scoped to the rendering component, not registered globally.\n */\ninterface ThreadChatMessageAction {\n /** Unique within this ThreadChat instance; letters, digits, `-`, `_`. */\n id: string;\n /** Tooltip / menu label for the action. */\n title: string;\n /** Icon hint (BB icon name); unknown names fall back to a generic icon. */\n icon?: string;\n /**\n * Message roles the action applies to. Omitted = both user and assistant\n * messages.\n */\n roles?: readonly (\"user\" | \"assistant\")[];\n /**\n * Runs when the user activates the action. Errors (sync or async) are\n * contained and logged; they never break the timeline.\n */\n run(message: ThreadChatMessageReference): void | Promise;\n}\n/**\n * Props of the host-owned `ThreadChat` component โ€” one thread's chat\n * (timeline, and for the composer variants the full send/queue/draft\n * engine), rendered by the BB app inside a plugin slot. This is the\n * deliberate exception to the no-host-components rule (ยง5.5): a stable\n * product capability, not a UI kit. Versioned additive like slot props;\n * internal timeline rows, query hooks, and prompt-box configuration are\n * deliberately not exposed.\n */\ninterface ThreadChatProps {\n threadId: string;\n /**\n * \"full\" (default) is the page presentation (centered reading width);\n * \"compact\" is the side-panel presentation; \"timeline\" renders the\n * transcript without a composer.\n */\n variant?: \"full\" | \"compact\" | \"timeline\";\n /**\n * \"contained\" (default) fills and scrolls inside a bounded parent;\n * \"document\" grows with its content and defers scrolling to the page.\n */\n layout?: \"contained\" | \"document\";\n /** Bump to focus the composer (ignored by `variant: \"timeline\"`). */\n focusRequest?: number;\n className?: string;\n /** Rendered above the conversation, scrolling with it. */\n leadingContent?: ReactNode;\n /**\n * Actions rendered in this instance's per-message action bar (see\n * {@link ThreadChatMessageAction}).\n */\n messageActions?: readonly ThreadChatMessageAction[];\n}\n/**\n * Props of the host-owned `Markdown` component โ€” bb's chat message renderer\n * (the same typography, spacing, and code styling as timeline messages).\n * Use it wherever plugin UI quotes or previews message content so it reads\n * like the rest of the chat. Like `ThreadChat`, this is a stable product\n * capability, not a UI kit; renderer internals stay private.\n */\ninterface MarkdownProps {\n /** Markdown source, rendered exactly like a chat message body. */\n content: string;\n className?: string;\n}\n/** Current app selection, derived from the route. */\ninterface BbContext {\n projectId: string | null;\n threadId: string | null;\n}\ninterface BbNavigate {\n toThread(threadId: string): void;\n toProject(projectId: string): void;\n /**\n * Navigate to one of this plugin's own nav panels by its `path`.\n * `subPath` targets a location inside the panel (the component's\n * `subPath` prop); `replace` swaps the current history entry instead of\n * pushing โ€” use it for redirects so back does not bounce.\n */\n toPluginPanel(path: string, options?: {\n subPath?: string;\n replace?: boolean;\n }): void;\n /**\n * Navigate to the root compose surface (the new-thread screen). Pass\n * `initialPrompt` to seed the composer draft and `focusPrompt` to focus the\n * composer on arrival โ€” the pairing behind \"Create via chat\" style entry\n * points that drop the user into chat with a prefilled prompt.\n */\n toCompose(options?: {\n initialPrompt?: string;\n focusPrompt?: boolean;\n }): void;\n /**\n * Open one of this plugin's registered thread-panel actions in the current\n * thread surface. Returns false when the surface has no thread side panel or\n * the action is unavailable.\n */\n experimental_openThreadPanel(options: {\n actionId: string;\n title?: string;\n params?: JsonValue$1;\n }): boolean;\n}\n/**\n * Everything `@bb/plugin-sdk/app` resolves to at runtime. The BB app builds\n * the real implementation and `satisfies` this interface; `bb plugin build`\n * shims the specifier to that object on `globalThis.__bbPluginRuntime`.\n */\ninterface PluginSdkApp {\n definePluginApp(setup: PluginAppSetup): PluginAppDefinition;\n useRpc(): PluginRpcClient;\n useRealtime(channel: string, handler: (payload: unknown) => void): void;\n /**\n * Observe the same shared connection that delivers `useRealtime` signals.\n * Use a subsequent transition to `connected` to reconcile server state that\n * may have changed while ephemeral signals could not be delivered. The first\n * connection can transition from `connecting` and is not a reconnection.\n */\n useRealtimeConnectionState(): PluginRealtimeConnectionState;\n useSettings(): PluginSettingsState;\n useBbContext(): BbContext;\n useBbNavigate(): BbNavigate;\n useComposer(): PluginComposerApi;\n /**\n * The host-owned chat component (see {@link ThreadChatProps}). Together\n * with `Markdown`, the only components the SDK ships โ€” everything else\n * stays vendored per ยง5.5.\n */\n experimental_ThreadChat: ComponentType;\n /**\n * The host-owned chat-message markdown renderer (see\n * {@link MarkdownProps}).\n */\n experimental_Markdown: ComponentType;\n useComposerView(): ComposerView;\n}\n\n/**\n * App-wide server-backed preferences.\n * Client-local settings stay in the frontend localStorage helpers instead.\n */\ndeclare const appSettingsSchema: z$1.ZodObject<{\n caffeinate: z$1.ZodBoolean;\n showKeyboardHints: z$1.ZodBoolean;\n showUnhandledProviderEvents: z$1.ZodBoolean;\n codexMemoryEnabled: z$1.ZodBoolean;\n claudeCodeMemoryEnabled: z$1.ZodBoolean;\n codexSubagentsDisabled: z$1.ZodBoolean;\n claudeCodeSubagentsDisabled: z$1.ZodBoolean;\n claudeCodeWorkflowsDisabled: z$1.ZodBoolean;\n}, z$1.core.$strict>;\ntype AppSettings = z$1.infer;\n\ndeclare const appKeybindingOverridesSchema: z$1.ZodArray;\n shortcut: z$1.ZodNullable>;\n}, z$1.core.$strict>>;\ntype AppKeybindingOverrides = z$1.infer;\n\ndeclare const appThemeSchema: z$1.ZodObject<{\n themeId: z$1.ZodString;\n customCss: z$1.ZodNullable;\n faviconColor: z$1.ZodEnum<{\n default: \"default\";\n red: \"red\";\n orange: \"orange\";\n yellow: \"yellow\";\n green: \"green\";\n teal: \"teal\";\n blue: \"blue\";\n purple: \"purple\";\n pink: \"pink\";\n }>;\n}, z$1.core.$strip>;\ntype AppTheme = z$1.infer;\n/**\n * The complete appearance selection a client sends when changing the palette\n * and/or favicon tint. The server validates `themeId` (built-in id or an\n * existing custom theme) and resolves the CSS from disk for custom themes.\n * Callers changing only one facet must carry the other facet forward explicitly.\n */\ndeclare const appThemeSelectionSchema: z$1.ZodObject<{\n themeId: z$1.ZodString;\n faviconColor: z$1.ZodEnum<{\n default: \"default\";\n red: \"red\";\n orange: \"orange\";\n yellow: \"yellow\";\n green: \"green\";\n teal: \"teal\";\n blue: \"blue\";\n purple: \"purple\";\n pink: \"pink\";\n }>;\n}, z$1.core.$strip>;\ntype AppThemeSelection = z$1.infer;\n\ndeclare const changedMessageSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"changed\">;\n entity: z$1.ZodLiteral<\"thread\">;\n id: z$1.ZodOptional;\n metadata: z$1.ZodOptional;\n eventTypes: z$1.ZodOptional>>>>;\n hasPendingInteraction: z$1.ZodOptional;\n projectId: z$1.ZodOptional;\n }, z$1.core.$strict>>;\n changes: z$1.ZodReadonly>>;\n}, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"changed\">;\n entity: z$1.ZodLiteral<\"project\">;\n id: z$1.ZodOptional;\n changes: z$1.ZodReadonly>>;\n}, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"changed\">;\n entity: z$1.ZodLiteral<\"environment\">;\n id: z$1.ZodOptional;\n changes: z$1.ZodReadonly>>;\n}, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"changed\">;\n entity: z$1.ZodLiteral<\"host\">;\n id: z$1.ZodOptional;\n changes: z$1.ZodReadonly>>;\n}, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"changed\">;\n entity: z$1.ZodLiteral<\"system\">;\n changes: z$1.ZodReadonly>>;\n}, z$1.core.$strict>], \"entity\">;\ntype ChangedMessage = z$1.infer;\n\ndeclare const environmentSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n name: z$1.ZodNullable;\n projectId: z$1.ZodString;\n hostId: z$1.ZodString;\n path: z$1.ZodNullable;\n managed: z$1.ZodBoolean;\n isGitRepo: z$1.ZodBoolean;\n isWorktree: z$1.ZodBoolean;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n branchName: z$1.ZodNullable;\n baseBranch: z$1.ZodNullable;\n defaultBranch: z$1.ZodNullable;\n mergeBaseBranch: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n error: \"error\";\n provisioning: \"provisioning\";\n ready: \"ready\";\n retiring: \"retiring\";\n destroying: \"destroying\";\n destroyed: \"destroyed\";\n }>;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype Environment = z$1.infer;\n\n/**\n * User-opt-in experiments (the Settings โ†’ Experiments toggles). Distinct from\n * `FeatureFlags`: flags are operator-set via env at server start, experiments\n * are user-toggled at runtime and persisted server-side so server-owned\n * policy (e.g. skill injection) can honor them.\n *\n * Every experiment defaults to off โ€” opting in is the point.\n */\ndeclare const experimentsSchema: z$1.ZodObject<{\n claudeCodeMockCliTraffic: z$1.ZodBoolean;\n plugins: z$1.ZodBoolean;\n toolsHub: z$1.ZodBoolean;\n sideChatPlugin: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype Experiments = z$1.infer;\n\ndeclare const hostSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n name: z$1.ZodString;\n type: z$1.ZodEnum<{\n persistent: \"persistent\";\n }>;\n status: z$1.ZodEnum<{\n connected: \"connected\";\n disconnected: \"disconnected\";\n }>;\n lastSeenAt: z$1.ZodNullable;\n lastRejectedProtocolVersion: z$1.ZodNullable;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype Host = z$1.infer;\n\ninterface JsonObject {\n [key: string]: JsonValue;\n}\ntype JsonValue = string | number | boolean | null | JsonValue[] | JsonObject;\n\ndeclare const pendingInteractionResolutionSchema: z$1.ZodUnion;\n grantedPermissions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"allow_for_session\">;\n grantedPermissions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"deny\">;\n}, z$1.core.$strip>], \"decision\">, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"user_answer\">;\n answers: z$1.ZodRecord;\n freeText: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin_submitted\">;\n}, z$1.core.$strip>]>;\ntype PendingInteractionResolution = z$1.infer;\ndeclare const providerPendingInteractionSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n interrupted: \"interrupted\";\n resolving: \"resolving\";\n resolved: \"resolved\";\n }>;\n statusReason: z$1.ZodNullable;\n createdAt: z$1.ZodNumber;\n expiresAt: z$1.ZodOptional>;\n resolvedAt: z$1.ZodNullable;\n turnId: z$1.ZodString;\n providerId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n providerRequestId: z$1.ZodString;\n origin: z$1.ZodOptional;\n providerId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n providerRequestId: z$1.ZodString;\n }, z$1.core.$strip>>;\n payload: z$1.ZodUnion;\n subject: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n itemId: z$1.ZodString;\n command: z$1.ZodString;\n cwd: z$1.ZodNullable;\n actions: z$1.ZodArray;\n command: z$1.ZodString;\n name: z$1.ZodString;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"listFiles\">;\n command: z$1.ZodString;\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"search\">;\n command: z$1.ZodString;\n query: z$1.ZodNullable;\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"unknown\">;\n command: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">>;\n sessionGrant: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"file_change\">;\n itemId: z$1.ZodString;\n writeScope: z$1.ZodNullable;\n sessionGrant: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"permission_grant\">;\n itemId: z$1.ZodString;\n toolName: z$1.ZodNullable;\n permissions: z$1.ZodObject<{\n network: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>;\n }, z$1.core.$strip>], \"kind\">;\n reason: z$1.ZodNullable;\n availableDecisions: z$1.ZodArray>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"user_question\">;\n questions: z$1.ZodArray;\n multiSelect: z$1.ZodBoolean;\n options: z$1.ZodOptional;\n }, z$1.core.$strip>>>;\n allowFreeText: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>]>;\n resolution: z$1.ZodNullable;\n grantedPermissions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"allow_for_session\">;\n grantedPermissions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"deny\">;\n }, z$1.core.$strip>], \"decision\">, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"user_answer\">;\n answers: z$1.ZodRecord;\n freeText: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>]>>;\n}, z$1.core.$strip>;\ntype ProviderPendingInteraction = z$1.infer;\ndeclare const pluginPendingInteractionSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n interrupted: \"interrupted\";\n resolving: \"resolving\";\n resolved: \"resolved\";\n }>;\n statusReason: z$1.ZodNullable;\n createdAt: z$1.ZodNumber;\n expiresAt: z$1.ZodOptional>;\n resolvedAt: z$1.ZodNullable;\n turnId: z$1.ZodNullable;\n origin: z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n rendererId: z$1.ZodString;\n }, z$1.core.$strip>;\n payload: z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n title: z$1.ZodString;\n data: z$1.ZodType>;\n }, z$1.core.$strip>;\n resolution: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype PluginPendingInteraction = z$1.infer;\ntype PendingInteraction = ProviderPendingInteraction | PluginPendingInteraction;\n\ndeclare const projectSourceSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n projectId: z$1.ZodString;\n isDefault: z$1.ZodBoolean;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n type: z$1.ZodLiteral<\"local_path\">;\n hostId: z$1.ZodString;\n path: z$1.ZodString;\n}, z$1.core.$strip>;\ntype ProjectSource = z$1.infer;\n\ndeclare const resolvedThreadExecutionOptionsSchema: z$1.ZodObject<{\n seq: z$1.ZodOptional;\n model: z$1.ZodString;\n serviceTier: z$1.ZodEnum<{\n default: \"default\";\n fast: \"fast\";\n }>;\n reasoningLevel: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n permissionMode: z$1.ZodEnum<{\n full: \"full\";\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n }>;\n source: z$1.ZodEnum<{\n \"client/thread/start\": \"client/thread/start\";\n \"client/turn/requested\": \"client/turn/requested\";\n \"client/turn/start\": \"client/turn/start\";\n }>;\n}, z$1.core.$strip>;\ntype ResolvedThreadExecutionOptions = z$1.infer;\ndeclare const projectExecutionDefaultsSchema: z$1.ZodObject<{\n providerId: z$1.ZodString;\n model: z$1.ZodString;\n serviceTier: z$1.ZodEnum<{\n default: \"default\";\n fast: \"fast\";\n }>;\n reasoningLevel: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n permissionMode: z$1.ZodEnum<{\n full: \"full\";\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n }>;\n}, z$1.core.$strip>;\ntype ProjectExecutionDefaults = z$1.infer;\n\n/** All thread events โ€” provider-originated or system-originated. */\ndeclare const threadEventSchema: z$1.ZodPipe;\n threadId: z$1.ZodString;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"thread/identity\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"turn/started\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"turn/completed\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n }>;\n error: z$1.ZodOptional>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"turn/input/accepted\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n clientRequestId: z$1.ZodString;\n scope: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"turn\">;\n turnId: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">;\n}, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"thread/name/updated\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n threadName: z$1.ZodString;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"thread/compacted\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"thread/goal/updated\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n objective: z$1.ZodString;\n status: z$1.ZodEnum<{\n paused: \"paused\";\n active: \"active\";\n budgetLimited: \"budgetLimited\";\n complete: \"complete\";\n }>;\n tokenBudget: z$1.ZodNullable;\n tokensUsed: z$1.ZodNumber;\n timeUsedSeconds: z$1.ZodNumber;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"thread/goal/cleared\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/started\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n item: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"userMessage\">;\n id: z$1.ZodString;\n content: z$1.ZodArray;\n text: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">>;\n clientRequestId: z$1.ZodOptional;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"agentMessage\">;\n id: z$1.ZodString;\n text: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"commandExecution\">;\n id: z$1.ZodString;\n command: z$1.ZodString;\n cwd: z$1.ZodString;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n }>;\n approvalStatus: z$1.ZodNullable>;\n aggregatedOutput: z$1.ZodOptional;\n exitCode: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n truncation: z$1.ZodOptional>;\n result: z$1.ZodOptional>;\n resultText: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"fileChange\">;\n id: z$1.ZodString;\n changes: z$1.ZodArray;\n movePath: z$1.ZodOptional;\n diff: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n }>;\n approvalStatus: z$1.ZodNullable>;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"webSearch\">;\n id: z$1.ZodString;\n queries: z$1.ZodArray;\n resultText: z$1.ZodNullable;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"webFetch\">;\n id: z$1.ZodString;\n url: z$1.ZodString;\n prompt: z$1.ZodNullable;\n pattern: z$1.ZodNullable;\n resultText: z$1.ZodNullable;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"imageView\">;\n id: z$1.ZodString;\n path: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"toolCall\">;\n id: z$1.ZodString;\n server: z$1.ZodOptional;\n tool: z$1.ZodString;\n arguments: z$1.ZodOptional>;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n }>;\n result: z$1.ZodOptional;\n error: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n truncation: z$1.ZodOptional>;\n result: z$1.ZodOptional>;\n resultText: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"reasoning\">;\n id: z$1.ZodString;\n summary: z$1.ZodArray;\n content: z$1.ZodArray;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"plan\">;\n id: z$1.ZodString;\n text: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"contextCompaction\">;\n id: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"backgroundTask\">;\n id: z$1.ZodString;\n taskType: z$1.ZodString;\n description: z$1.ZodString;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n }>;\n taskStatus: z$1.ZodEnum<{\n pending: \"pending\";\n running: \"running\";\n paused: \"paused\";\n completed: \"completed\";\n failed: \"failed\";\n killed: \"killed\";\n stopped: \"stopped\";\n }>;\n skipTranscript: z$1.ZodBoolean;\n workflowName: z$1.ZodOptional;\n workflow: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n agents: z$1.ZodArray;\n model: z$1.ZodString;\n attempt: z$1.ZodNumber;\n cached: z$1.ZodBoolean;\n lastProgressAt: z$1.ZodNumber;\n phaseIndex: z$1.ZodOptional;\n phaseTitle: z$1.ZodOptional;\n agentType: z$1.ZodOptional;\n isolation: z$1.ZodOptional;\n queuedAt: z$1.ZodOptional;\n startedAt: z$1.ZodOptional;\n lastToolName: z$1.ZodOptional;\n lastToolSummary: z$1.ZodOptional;\n promptPreview: z$1.ZodOptional;\n resultPreview: z$1.ZodOptional;\n error: z$1.ZodOptional;\n tokens: z$1.ZodOptional;\n toolCalls: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n usage: z$1.ZodOptional>;\n summary: z$1.ZodOptional;\n error: z$1.ZodOptional;\n outputFile: z$1.ZodOptional;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/completed\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n item: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"userMessage\">;\n id: z$1.ZodString;\n content: z$1.ZodArray;\n text: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">>;\n clientRequestId: z$1.ZodOptional;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"agentMessage\">;\n id: z$1.ZodString;\n text: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"commandExecution\">;\n id: z$1.ZodString;\n command: z$1.ZodString;\n cwd: z$1.ZodString;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n }>;\n approvalStatus: z$1.ZodNullable>;\n aggregatedOutput: z$1.ZodOptional;\n exitCode: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n truncation: z$1.ZodOptional>;\n result: z$1.ZodOptional>;\n resultText: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"fileChange\">;\n id: z$1.ZodString;\n changes: z$1.ZodArray;\n movePath: z$1.ZodOptional;\n diff: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n }>;\n approvalStatus: z$1.ZodNullable>;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"webSearch\">;\n id: z$1.ZodString;\n queries: z$1.ZodArray;\n resultText: z$1.ZodNullable;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"webFetch\">;\n id: z$1.ZodString;\n url: z$1.ZodString;\n prompt: z$1.ZodNullable;\n pattern: z$1.ZodNullable;\n resultText: z$1.ZodNullable;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"imageView\">;\n id: z$1.ZodString;\n path: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"toolCall\">;\n id: z$1.ZodString;\n server: z$1.ZodOptional;\n tool: z$1.ZodString;\n arguments: z$1.ZodOptional>;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n }>;\n result: z$1.ZodOptional;\n error: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n truncation: z$1.ZodOptional>;\n result: z$1.ZodOptional>;\n resultText: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"reasoning\">;\n id: z$1.ZodString;\n summary: z$1.ZodArray;\n content: z$1.ZodArray;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"plan\">;\n id: z$1.ZodString;\n text: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"contextCompaction\">;\n id: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"backgroundTask\">;\n id: z$1.ZodString;\n taskType: z$1.ZodString;\n description: z$1.ZodString;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n }>;\n taskStatus: z$1.ZodEnum<{\n pending: \"pending\";\n running: \"running\";\n paused: \"paused\";\n completed: \"completed\";\n failed: \"failed\";\n killed: \"killed\";\n stopped: \"stopped\";\n }>;\n skipTranscript: z$1.ZodBoolean;\n workflowName: z$1.ZodOptional;\n workflow: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n agents: z$1.ZodArray;\n model: z$1.ZodString;\n attempt: z$1.ZodNumber;\n cached: z$1.ZodBoolean;\n lastProgressAt: z$1.ZodNumber;\n phaseIndex: z$1.ZodOptional;\n phaseTitle: z$1.ZodOptional;\n agentType: z$1.ZodOptional;\n isolation: z$1.ZodOptional;\n queuedAt: z$1.ZodOptional;\n startedAt: z$1.ZodOptional;\n lastToolName: z$1.ZodOptional;\n lastToolSummary: z$1.ZodOptional;\n promptPreview: z$1.ZodOptional;\n resultPreview: z$1.ZodOptional;\n error: z$1.ZodOptional;\n tokens: z$1.ZodOptional;\n toolCalls: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n usage: z$1.ZodOptional>;\n summary: z$1.ZodOptional;\n error: z$1.ZodOptional;\n outputFile: z$1.ZodOptional;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/agentMessage/delta\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n itemId: z$1.ZodString;\n delta: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/commandExecution/outputDelta\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n itemId: z$1.ZodString;\n delta: z$1.ZodString;\n reset: z$1.ZodOptional;\n parentToolCallId: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/fileChange/outputDelta\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n itemId: z$1.ZodString;\n delta: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/reasoning/summaryTextDelta\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n itemId: z$1.ZodString;\n delta: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/reasoning/textDelta\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n itemId: z$1.ZodString;\n delta: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/plan/delta\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n itemId: z$1.ZodString;\n delta: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/mcpToolCall/progress\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n itemId: z$1.ZodString;\n message: z$1.ZodOptional;\n parentToolCallId: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/toolCall/progress\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n itemId: z$1.ZodString;\n message: z$1.ZodOptional;\n parentToolCallId: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/backgroundTask/progress\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n item: z$1.ZodObject<{\n type: z$1.ZodLiteral<\"backgroundTask\">;\n id: z$1.ZodString;\n taskType: z$1.ZodString;\n description: z$1.ZodString;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n }>;\n taskStatus: z$1.ZodEnum<{\n pending: \"pending\";\n running: \"running\";\n paused: \"paused\";\n completed: \"completed\";\n failed: \"failed\";\n killed: \"killed\";\n stopped: \"stopped\";\n }>;\n skipTranscript: z$1.ZodBoolean;\n workflowName: z$1.ZodOptional;\n workflow: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n agents: z$1.ZodArray;\n model: z$1.ZodString;\n attempt: z$1.ZodNumber;\n cached: z$1.ZodBoolean;\n lastProgressAt: z$1.ZodNumber;\n phaseIndex: z$1.ZodOptional;\n phaseTitle: z$1.ZodOptional;\n agentType: z$1.ZodOptional;\n isolation: z$1.ZodOptional;\n queuedAt: z$1.ZodOptional;\n startedAt: z$1.ZodOptional;\n lastToolName: z$1.ZodOptional;\n lastToolSummary: z$1.ZodOptional;\n promptPreview: z$1.ZodOptional;\n resultPreview: z$1.ZodOptional;\n error: z$1.ZodOptional;\n tokens: z$1.ZodOptional;\n toolCalls: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n usage: z$1.ZodOptional>;\n summary: z$1.ZodOptional;\n error: z$1.ZodOptional;\n outputFile: z$1.ZodOptional;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/backgroundTask/completed\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n item: z$1.ZodObject<{\n type: z$1.ZodLiteral<\"backgroundTask\">;\n id: z$1.ZodString;\n taskType: z$1.ZodString;\n description: z$1.ZodString;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n }>;\n taskStatus: z$1.ZodEnum<{\n pending: \"pending\";\n running: \"running\";\n paused: \"paused\";\n completed: \"completed\";\n failed: \"failed\";\n killed: \"killed\";\n stopped: \"stopped\";\n }>;\n skipTranscript: z$1.ZodBoolean;\n workflowName: z$1.ZodOptional;\n workflow: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n agents: z$1.ZodArray;\n model: z$1.ZodString;\n attempt: z$1.ZodNumber;\n cached: z$1.ZodBoolean;\n lastProgressAt: z$1.ZodNumber;\n phaseIndex: z$1.ZodOptional;\n phaseTitle: z$1.ZodOptional;\n agentType: z$1.ZodOptional;\n isolation: z$1.ZodOptional;\n queuedAt: z$1.ZodOptional;\n startedAt: z$1.ZodOptional;\n lastToolName: z$1.ZodOptional;\n lastToolSummary: z$1.ZodOptional;\n promptPreview: z$1.ZodOptional;\n resultPreview: z$1.ZodOptional;\n error: z$1.ZodOptional;\n tokens: z$1.ZodOptional;\n toolCalls: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n usage: z$1.ZodOptional>;\n summary: z$1.ZodOptional;\n error: z$1.ZodOptional;\n outputFile: z$1.ZodOptional;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"thread/tokenUsage/updated\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n tokenUsage: z$1.ZodObject<{\n total: z$1.ZodObject<{\n totalTokens: z$1.ZodNumber;\n inputTokens: z$1.ZodNumber;\n cachedInputTokens: z$1.ZodNumber;\n outputTokens: z$1.ZodNumber;\n reasoningOutputTokens: z$1.ZodNumber;\n }, z$1.core.$strip>;\n last: z$1.ZodObject<{\n totalTokens: z$1.ZodNumber;\n inputTokens: z$1.ZodNumber;\n cachedInputTokens: z$1.ZodNumber;\n outputTokens: z$1.ZodNumber;\n reasoningOutputTokens: z$1.ZodNumber;\n }, z$1.core.$strip>;\n modelContextWindow: z$1.ZodNullable;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"thread/contextWindowUsage/updated\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n contextWindowUsage: z$1.ZodObject<{\n usedTokens: z$1.ZodNullable;\n modelContextWindow: z$1.ZodNullable;\n estimated: z$1.ZodBoolean;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"turn/plan/updated\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n plan: z$1.ZodArray>;\n }, z$1.core.$strip>>;\n explanation: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"turn/diff/updated\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n diff: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"provider/error\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n message: z$1.ZodString;\n detail: z$1.ZodOptional;\n willRetry: z$1.ZodOptional;\n errorInfo: z$1.ZodOptional;\n providerCode: z$1.ZodNullable;\n httpStatusCode: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"provider/warning\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n category: z$1.ZodEnum<{\n deprecation: \"deprecation\";\n config: \"config\";\n general: \"general\";\n }>;\n summary: z$1.ZodOptional;\n details: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"provider/modelFallback\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n originalModel: z$1.ZodString;\n fallbackModel: z$1.ZodString;\n reason: z$1.ZodEnum<{\n refusal: \"refusal\";\n provider: \"provider\";\n }>;\n message: z$1.ZodString;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"provider/unhandled\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n providerId: z$1.ZodString;\n rawType: z$1.ZodString;\n rawEvent: z$1.ZodObject<{\n jsonrpc: z$1.ZodLiteral<\"2.0\">;\n id: z$1.ZodOptional>;\n method: z$1.ZodString;\n params: z$1.ZodOptional>>;\n }, z$1.core.$strip>;\n parentToolCallId: z$1.ZodOptional;\n}, z$1.core.$strip>], \"type\">, z$1.ZodObject<{\n scope: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"turn\">;\n turnId: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">;\n}, z$1.core.$strip>>, z$1.ZodIntersection;\n threadId: z$1.ZodString;\n direction: z$1.ZodLiteral<\"outbound\">;\n source: z$1.ZodEnum<{\n spawn: \"spawn\";\n tell: \"tell\";\n }>;\n initiator: z$1.ZodEnum<{\n system: \"system\";\n user: \"user\";\n agent: \"agent\";\n }>;\n request: z$1.ZodObject<{\n method: z$1.ZodEnum<{\n \"thread/start\": \"thread/start\";\n \"turn/start\": \"turn/start\";\n }>;\n params: z$1.ZodRecord;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"client/turn/requested\">;\n threadId: z$1.ZodString;\n direction: z$1.ZodLiteral<\"outbound\">;\n requestId: z$1.ZodString;\n source: z$1.ZodEnum<{\n spawn: \"spawn\";\n tell: \"tell\";\n }>;\n initiator: z$1.ZodEnum<{\n system: \"system\";\n user: \"user\";\n agent: \"agent\";\n }>;\n senderThreadId: z$1.ZodNullable;\n systemMessageKind: z$1.ZodOptional>;\n systemMessageSubject: z$1.ZodOptional;\n threadId: z$1.ZodString;\n threadName: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread-batch\">;\n count: z$1.ZodNumber;\n }, z$1.core.$strip>], \"kind\">>>;\n input: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n inputGroups: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>>>;\n target: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread-start\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"new-turn\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"auto\">;\n expectedTurnId: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"steer\">;\n expectedTurnId: z$1.ZodNullable;\n }, z$1.core.$strip>], \"kind\">;\n request: z$1.ZodObject<{\n method: z$1.ZodEnum<{\n \"thread/start\": \"thread/start\";\n \"turn/start\": \"turn/start\";\n }>;\n params: z$1.ZodRecord;\n }, z$1.core.$strip>;\n execution: z$1.ZodObject<{\n seq: z$1.ZodOptional;\n model: z$1.ZodString;\n serviceTier: z$1.ZodEnum<{\n default: \"default\";\n fast: \"fast\";\n }>;\n reasoningLevel: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n source: z$1.ZodEnum<{\n \"client/thread/start\": \"client/thread/start\";\n \"client/turn/requested\": \"client/turn/requested\";\n \"client/turn/start\": \"client/turn/start\";\n }>;\n permissionMode: z$1.ZodEnum<{\n readonly: \"readonly\";\n full: \"full\";\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n \"workspace-write\": \"workspace-write\";\n }>;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"client/turn/start\">;\n threadId: z$1.ZodString;\n direction: z$1.ZodLiteral<\"outbound\">;\n source: z$1.ZodEnum<{\n spawn: \"spawn\";\n tell: \"tell\";\n }>;\n initiator: z$1.ZodEnum<{\n system: \"system\";\n user: \"user\";\n agent: \"agent\";\n }>;\n request: z$1.ZodObject<{\n method: z$1.ZodEnum<{\n \"thread/start\": \"thread/start\";\n \"turn/start\": \"turn/start\";\n }>;\n params: z$1.ZodRecord;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"system/error\">;\n threadId: z$1.ZodString;\n code: z$1.ZodOptional;\n message: z$1.ZodString;\n detail: z$1.ZodOptional;\n reconnectAttempt: z$1.ZodOptional;\n reconnectTotal: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"system/manager/user_message\">;\n threadId: z$1.ZodString;\n text: z$1.ZodString;\n toolCallId: z$1.ZodOptional;\n turnId: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"system/thread/interrupted\">;\n threadId: z$1.ZodString;\n reason: z$1.ZodEnum<{\n \"manual-stop\": \"manual-stop\";\n \"host-daemon-restarted\": \"host-daemon-restarted\";\n \"provider-turn-idle\": \"provider-turn-idle\";\n }>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"system/operation\">;\n threadId: z$1.ZodString;\n operation: z$1.ZodString;\n status: z$1.ZodString;\n message: z$1.ZodString;\n operationId: z$1.ZodString;\n metadata: z$1.ZodOptional>>>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"system/permissionGrant/lifecycle\">;\n threadId: z$1.ZodString;\n interactionId: z$1.ZodString;\n providerId: z$1.ZodString;\n providerRequestId: z$1.ZodString;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n interrupted: \"interrupted\";\n resolving: \"resolving\";\n resolved: \"resolved\";\n }>;\n resolution: z$1.ZodDefault;\n grantedPermissions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"allow_for_session\">;\n grantedPermissions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"deny\">;\n }, z$1.core.$strip>], \"decision\">>>;\n statusReason: z$1.ZodDefault>;\n subject: z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"permission_grant\">;\n itemId: z$1.ZodString;\n toolName: z$1.ZodNullable;\n permissions: z$1.ZodObject<{\n network: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"system/userQuestion/lifecycle\">;\n threadId: z$1.ZodString;\n interactionId: z$1.ZodString;\n providerId: z$1.ZodString;\n providerRequestId: z$1.ZodString;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n interrupted: \"interrupted\";\n resolving: \"resolving\";\n resolved: \"resolved\";\n }>;\n resolution: z$1.ZodDefault;\n answers: z$1.ZodRecord;\n freeText: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>>;\n statusReason: z$1.ZodDefault>;\n payload: z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"user_question\">;\n questions: z$1.ZodArray;\n multiSelect: z$1.ZodBoolean;\n options: z$1.ZodOptional;\n }, z$1.core.$strip>>>;\n allowFreeText: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"system/thread-provisioning\">;\n threadId: z$1.ZodString;\n provisioningId: z$1.ZodString;\n status: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n active: \"active\";\n cancelled: \"cancelled\";\n }>;\n environmentId: z$1.ZodString;\n entries: z$1.ZodArray;\n key: z$1.ZodString;\n text: z$1.ZodString;\n startedAt: z$1.ZodOptional;\n status: z$1.ZodOptional>;\n metadata: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"system/provider-turn-watchdog\">;\n threadId: z$1.ZodString;\n reason: z$1.ZodLiteral<\"provider-turn-idle\">;\n thresholdMs: z$1.ZodNumber;\n elapsedMs: z$1.ZodNumber;\n activeTurnId: z$1.ZodString;\n activeTurnStartedAt: z$1.ZodNumber;\n lastActivityEventSequence: z$1.ZodNumber;\n lastActivityEventType: z$1.ZodString;\n lastActivityEventAt: z$1.ZodNumber;\n providerId: z$1.ZodString;\n providerThreadId: z$1.ZodNullable;\n firedAt: z$1.ZodNumber;\n}, z$1.core.$strip>]>, z$1.ZodObject<{\n scope: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"turn\">;\n turnId: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">;\n}, z$1.core.$strip>>]>>;\ntype ThreadEvent = z$1.infer;\ntype ThreadEventType = ThreadEvent[\"type\"];\n\ndeclare const providerInfoSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n displayName: z$1.ZodString;\n logoUrl: z$1.ZodNullable;\n capabilities: z$1.ZodObject<{\n supportsArchive: z$1.ZodBoolean;\n supportsRename: z$1.ZodBoolean;\n supportsServiceTier: z$1.ZodBoolean;\n supportsUserQuestion: z$1.ZodBoolean;\n supportsFork: z$1.ZodBoolean;\n supportedPermissionModes: z$1.ZodArray>;\n }, z$1.core.$strip>;\n composerActions: z$1.ZodArray;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plan\">;\n command: z$1.ZodObject<{\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n trailingText: z$1.ZodString;\n }, z$1.core.$strip>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"goal\">;\n command: z$1.ZodObject<{\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n trailingText: z$1.ZodString;\n }, z$1.core.$strip>;\n }, z$1.core.$strip>], \"kind\">>;\n available: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype ProviderInfo = z$1.infer;\n\ndeclare const threadEventScopeSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n}, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"turn\">;\n turnId: z$1.ZodString;\n}, z$1.core.$strip>], \"kind\">;\ntype ThreadEventScope = z$1.infer;\n\ntype ThreadEventByType = {\n [TType in ThreadEventType]: Extract;\n};\ntype ThreadEventForType = ThreadEventByType[TType];\ntype StoredThreadEventDataFromEvent = Omit;\ninterface ThreadEventRowBase {\n id: string;\n scope: ThreadEventScope;\n threadId: string;\n seq: number;\n createdAt: number;\n}\ntype ThreadEventRowFromEvent = ThreadEventRowBase & {\n type: TEvent[\"type\"];\n data: StoredThreadEventDataFromEvent;\n};\ntype ThreadEventRowOfType = ThreadEventRowFromEvent>;\ntype ThreadEventRow = {\n [TType in ThreadEventType]: ThreadEventRowOfType;\n}[ThreadEventType];\n\ndeclare const threadStatusSchema: z$1.ZodEnum<{\n error: \"error\";\n active: \"active\";\n starting: \"starting\";\n idle: \"idle\";\n stopping: \"stopping\";\n}>;\ntype ThreadStatus = z$1.infer;\n\ndeclare const threadTimelinePendingTodosSchema: z$1.ZodObject<{\n sourceSeq: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n items: z$1.ZodArray;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype ThreadTimelinePendingTodos = z$1.infer;\n\ndeclare const threadQueuedMessageSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n content: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n model: z$1.ZodString;\n reasoningLevel: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n permissionMode: z$1.ZodEnum<{\n full: \"full\";\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n }>;\n serviceTier: z$1.ZodEnum<{\n default: \"default\";\n fast: \"fast\";\n }>;\n groupWithNext: z$1.ZodBoolean;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype ThreadQueuedMessage = z$1.infer;\n\ndeclare const workspaceFileListResponseSchema: z$1.ZodObject<{\n files: z$1.ZodArray>;\n truncated: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype WorkspaceFileListResponse = z$1.infer;\ndeclare const workspacePathListResponseSchema: z$1.ZodObject<{\n paths: z$1.ZodArray;\n path: z$1.ZodString;\n name: z$1.ZodString;\n score: z$1.ZodNumber;\n positions: z$1.ZodArray;\n }, z$1.core.$strip>>;\n truncated: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype WorkspacePathListResponse = z$1.infer;\n\ndeclare const createProjectSourceRequestSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n hostId: z$1.ZodString;\n type: z$1.ZodLiteral<\"local_path\">;\n path: z$1.ZodPipe>;\n}, z$1.core.$strict>, z$1.ZodObject<{\n hostId: z$1.ZodString;\n type: z$1.ZodLiteral<\"clone\">;\n targetPath: z$1.ZodOptional>>;\n remoteUrl: z$1.ZodOptional;\n}, z$1.core.$strict>], \"type\">;\ntype CreateProjectSourceRequest = z$1.infer;\ndeclare const createProjectRequestSchema: z$1.ZodObject<{\n name: z$1.ZodString;\n source: z$1.ZodObject<{\n hostId: z$1.ZodString;\n type: z$1.ZodLiteral<\"local_path\">;\n path: z$1.ZodPipe>;\n }, z$1.core.$strict>;\n}, z$1.core.$strip>;\ntype CreateProjectRequest = z$1.infer;\ndeclare const threadSectionSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n name: z$1.ZodString;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n}, z$1.core.$strict>;\ntype ThreadSectionResponse = z$1.infer;\ndeclare const createThreadSectionRequestSchema: z$1.ZodObject<{\n name: z$1.ZodString;\n}, z$1.core.$strict>;\ntype CreateThreadSectionRequest = z$1.infer;\ndeclare const updateThreadSectionRequestSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n name: z$1.ZodString;\n}, z$1.core.$strict>;\ntype UpdateThreadSectionRequest = z$1.infer;\ndeclare const deleteThreadSectionRequestSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n}, z$1.core.$strict>;\ntype DeleteThreadSectionRequest = z$1.infer;\ndeclare const threadSectionMutationResponseSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n name: z$1.ZodString;\n updatedThreadCount: z$1.ZodNumber;\n}, z$1.core.$strict>;\ntype ThreadSectionMutationResponse = z$1.infer;\ndeclare const reorderProjectRequestSchema: z$1.ZodObject<{\n previousProjectId: z$1.ZodNullable;\n nextProjectId: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype ReorderProjectRequest = z$1.infer;\ndeclare const projectListQuerySchema: z$1.ZodObject<{\n include: z$1.ZodOptional;\n includePersonal: z$1.ZodOptional>;\n}, z$1.core.$strip>;\ntype ProjectListQuery = z$1.infer;\ndeclare const projectFilesQuerySchema: z$1.ZodObject<{\n query: z$1.ZodOptional>;\n limit: z$1.ZodOptional>;\n hostId: z$1.ZodOptional;\n environmentId: z$1.ZodOptional, z$1.ZodOptional>>;\n}, z$1.core.$strip>;\ntype ProjectFilesQuery = z$1.infer;\ndeclare const projectPathsQuerySchema: z$1.ZodObject<{\n query: z$1.ZodOptional>;\n limit: z$1.ZodOptional>;\n includeFiles: z$1.ZodEnum<{\n true: \"true\";\n false: \"false\";\n }>;\n includeDirectories: z$1.ZodEnum<{\n true: \"true\";\n false: \"false\";\n }>;\n hostId: z$1.ZodOptional;\n environmentId: z$1.ZodOptional, z$1.ZodOptional>>;\n}, z$1.core.$strip>;\ntype ProjectPathsQuery = z$1.infer;\ndeclare const projectFileContentQuerySchema: z$1.ZodObject<{\n path: z$1.ZodString;\n hostId: z$1.ZodOptional;\n environmentId: z$1.ZodOptional, z$1.ZodOptional>>;\n}, z$1.core.$strip>;\ntype ProjectFileContentQuery = z$1.infer;\ndeclare const projectBranchesQuerySchema: z$1.ZodObject<{\n query: z$1.ZodOptional;\n limit: z$1.ZodOptional;\n hostId: z$1.ZodString;\n selectedBranch: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype ProjectBranchesQuery = z$1.infer;\ndeclare const projectBranchesResponseSchema: z$1.ZodObject<{\n branches: z$1.ZodArray;\n branchesTruncated: z$1.ZodBoolean;\n checkout: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"branch\">;\n branchName: z$1.ZodString;\n headSha: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"detached\">;\n headSha: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unborn\">;\n branchName: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unknown\">;\n reason: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">;\n defaultBranch: z$1.ZodNullable;\n defaultBranchRelation: z$1.ZodNullable>;\n hasUncommittedChanges: z$1.ZodBoolean;\n operation: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"none\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"merge\">;\n hasConflicts: z$1.ZodBoolean;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"rebase\">;\n hasConflicts: z$1.ZodBoolean;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"cherry-pick\">;\n hasConflicts: z$1.ZodBoolean;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"revert\">;\n hasConflicts: z$1.ZodBoolean;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unknown\">;\n reason: z$1.ZodString;\n hasConflicts: z$1.ZodBoolean;\n }, z$1.core.$strip>], \"kind\">;\n originDefaultBranch: z$1.ZodNullable;\n remoteBranches: z$1.ZodArray;\n remoteBranchesTruncated: z$1.ZodBoolean;\n selectedBranch: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n defaultWorktreeBaseBranch: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype ProjectBranchesResponse = z$1.infer;\ndeclare const promptHistoryQuerySchema: z$1.ZodObject<{\n limit: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype PromptHistoryQuery = z$1.infer;\ndeclare const promptHistoryResponseSchema: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n}, z$1.core.$strip>>;\ntype PromptHistoryResponse = z$1.infer;\ndeclare const updateProjectRequestSchema: z$1.ZodObject<{\n name: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype UpdateProjectRequest = z$1.infer;\ndeclare const updateProjectSourceRequestSchema: z$1.ZodObject<{\n type: z$1.ZodLiteral<\"local_path\">;\n path: z$1.ZodOptional>>;\n isDefault: z$1.ZodOptional>;\n}, z$1.core.$strict>;\ntype UpdateProjectSourceRequest = z$1.infer;\ndeclare const commandListResponseSchema: z$1.ZodObject<{\n commands: z$1.ZodArray;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n description: z$1.ZodNullable;\n argumentHint: z$1.ZodNullable;\n pluginId: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype CommandListResponse = z$1.infer;\n/** Query for the complete command catalog available to a project and provider. */\ndeclare const projectCommandsQuerySchema: z$1.ZodObject<{\n provider: z$1.ZodString;\n hostId: z$1.ZodOptional;\n environmentId: z$1.ZodOptional, z$1.ZodOptional>>;\n}, z$1.core.$strict>;\ntype ProjectCommandsQuery = z$1.infer;\ndeclare const skillListResponseSchema: z$1.ZodObject<{\n skills: z$1.ZodArray;\n provider: z$1.ZodNullable>;\n scope: z$1.ZodEnum<{\n plugin: \"plugin\";\n \"bb-builtin\": \"bb-builtin\";\n \"bb-user\": \"bb-user\";\n \"bb-project\": \"bb-project\";\n \"claude-user\": \"claude-user\";\n \"claude-project\": \"claude-project\";\n \"codex-user\": \"codex-user\";\n \"codex-project\": \"codex-project\";\n }>;\n pluginId: z$1.ZodNullable;\n filePath: z$1.ZodString;\n manageable: z$1.ZodBoolean;\n registrySkillId: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype SkillListResponse = z$1.infer;\ndeclare const skillContentResponseSchema: z$1.ZodObject<{\n content: z$1.ZodString;\n revision: z$1.ZodString;\n}, z$1.core.$strip>;\ntype SkillContentResponse = z$1.infer;\ndeclare const skillFilesResponseSchema: z$1.ZodObject<{\n files: z$1.ZodArray;\n truncated: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype SkillFilesResponse = z$1.infer;\ndeclare const projectResponseSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodEnum<{\n personal: \"personal\";\n standard: \"standard\";\n }>;\n name: z$1.ZodString;\n gitRemoteUrl: z$1.ZodNullable;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n sources: z$1.ZodArray;\n hostId: z$1.ZodString;\n path: z$1.ZodString;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype ProjectResponse = z$1.infer;\ndeclare const projectWithThreadsResponseSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodEnum<{\n personal: \"personal\";\n standard: \"standard\";\n }>;\n name: z$1.ZodString;\n gitRemoteUrl: z$1.ZodNullable;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n sources: z$1.ZodArray;\n hostId: z$1.ZodString;\n path: z$1.ZodString;\n }, z$1.core.$strip>>;\n threads: z$1.ZodArray;\n providerId: z$1.ZodString;\n title: z$1.ZodNullable;\n titleFallback: z$1.ZodNullable;\n sectionId: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n error: \"error\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n }>;\n parentThreadId: z$1.ZodNullable;\n sourceThreadId: z$1.ZodNullable;\n originKind: z$1.ZodNullable>;\n childOrigin: z$1.ZodNullable>;\n originPluginId: z$1.ZodNullable;\n visibility: z$1.ZodEnum<{\n visible: \"visible\";\n hidden: \"hidden\";\n }>;\n archivedAt: z$1.ZodNullable;\n pinnedAt: z$1.ZodNullable;\n deletedAt: z$1.ZodNullable;\n lastReadAt: z$1.ZodNullable;\n latestAttentionAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n runtime: z$1.ZodObject<{\n displayStatus: z$1.ZodEnum<{\n error: \"error\";\n provisioning: \"provisioning\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n \"host-reconnecting\": \"host-reconnecting\";\n \"waiting-for-host\": \"waiting-for-host\";\n }>;\n hostReconnectGraceExpiresAt: z$1.ZodNullable;\n }, z$1.core.$strip>;\n activity: z$1.ZodObject<{\n activeWorkflowCount: z$1.ZodNumber;\n activeBackgroundAgentCount: z$1.ZodNumber;\n activeBackgroundCommandCount: z$1.ZodNumber;\n activePlanModeCount: z$1.ZodNumber;\n activeGoalCount: z$1.ZodNumber;\n }, z$1.core.$strip>;\n pinSortKey: z$1.ZodNullable;\n hasPendingInteraction: z$1.ZodBoolean;\n environmentHostId: z$1.ZodNullable;\n environmentName: z$1.ZodNullable;\n environmentBranchName: z$1.ZodNullable;\n environmentWorkspaceDisplayKind: z$1.ZodEnum<{\n \"managed-worktree\": \"managed-worktree\";\n \"unmanaged-worktree\": \"unmanaged-worktree\";\n other: \"other\";\n }>;\n }, z$1.core.$strip>>;\n defaultExecutionOptions: z$1.ZodNullable;\n reasoningLevel: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n permissionMode: z$1.ZodEnum<{\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n full: \"full\";\n }>;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype ProjectWithThreadsResponse = z$1.infer;\ndeclare const uploadedPromptAttachmentSchema: z$1.ZodObject<{\n type: z$1.ZodEnum<{\n localImage: \"localImage\";\n localFile: \"localFile\";\n }>;\n path: z$1.ZodString;\n name: z$1.ZodString;\n mimeType: z$1.ZodOptional;\n sizeBytes: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype UploadedPromptAttachment = z$1.infer;\ndeclare const copyProjectAttachmentsRequestSchema: z$1.ZodObject<{\n sourceProjectId: z$1.ZodString;\n paths: z$1.ZodArray;\n}, z$1.core.$strict>;\ntype CopyProjectAttachmentsRequest = z$1.infer;\n\ndeclare const registrySkillSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n source: z$1.ZodString;\n skillId: z$1.ZodString;\n name: z$1.ZodString;\n installs: z$1.ZodNumber;\n stars: z$1.ZodNullable;\n installUrl: z$1.ZodNullable;\n url: z$1.ZodString;\n topic: z$1.ZodNullable;\n summary: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype RegistrySkill = z$1.infer;\ndeclare const registrySkillsPageSchema: z$1.ZodObject<{\n skills: z$1.ZodArray;\n installUrl: z$1.ZodNullable;\n url: z$1.ZodString;\n topic: z$1.ZodNullable;\n summary: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n pagination: z$1.ZodObject<{\n page: z$1.ZodNumber;\n perPage: z$1.ZodNumber;\n total: z$1.ZodNumber;\n hasMore: z$1.ZodBoolean;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>;\ntype RegistrySkillsPage = z$1.infer;\ndeclare const registrySkillDetailSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n source: z$1.ZodString;\n skillId: z$1.ZodString;\n hash: z$1.ZodNullable;\n files: z$1.ZodNullable>>;\n}, z$1.core.$strip>;\ntype RegistrySkillDetail = z$1.infer;\ndeclare const registrySkillInstallResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n filePath: z$1.ZodString;\n}, z$1.core.$strip>;\ntype RegistrySkillInstallResponse = z$1.infer;\n\ndeclare const updateEnvironmentRequestSchema: z$1.ZodObject<{\n mergeBaseBranch: z$1.ZodOptional>;\n name: z$1.ZodOptional>;\n}, z$1.core.$strip>;\ntype UpdateEnvironmentRequest = z$1.infer;\n/**\n * Query for searching paths in an environment's workspace. Unlike the\n * project-scoped variant this needs no `environmentId` โ€” the environment is\n * the route param โ€” and is project-agnostic, so it works for projectless\n * (personal) environments too.\n */\ndeclare const environmentPathsQuerySchema: z$1.ZodObject<{\n query: z$1.ZodOptional;\n limit: z$1.ZodOptional;\n includeFiles: z$1.ZodEnum<{\n true: \"true\";\n false: \"false\";\n }>;\n includeDirectories: z$1.ZodEnum<{\n true: \"true\";\n false: \"false\";\n }>;\n}, z$1.core.$strip>;\ntype EnvironmentPathsQuery = z$1.infer;\ndeclare const environmentDiffBranchesQuerySchema: z$1.ZodObject<{\n query: z$1.ZodOptional;\n limit: z$1.ZodOptional;\n selectedBranch: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype EnvironmentDiffBranchesQuery = z$1.infer;\ndeclare const environmentDiffBranchesResponseSchema: z$1.ZodObject<{\n branches: z$1.ZodArray;\n branchesTruncated: z$1.ZodBoolean;\n remoteBranches: z$1.ZodArray;\n remoteBranchesTruncated: z$1.ZodBoolean;\n selectedBranch: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype EnvironmentDiffBranchesResponse = z$1.infer;\ndeclare const environmentStatusQuerySchema: z$1.ZodObject<{\n mergeBaseBranch: z$1.ZodOptional>;\n}, z$1.core.$strip>;\ntype EnvironmentStatusQuery = z$1.infer;\ndeclare const environmentDiffQuerySchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n target: z$1.ZodLiteral<\"uncommitted\">;\n}, z$1.core.$strip>, z$1.ZodObject<{\n target: z$1.ZodLiteral<\"branch_committed\">;\n mergeBaseBranch: z$1.ZodPipe;\n}, z$1.core.$strip>, z$1.ZodObject<{\n target: z$1.ZodLiteral<\"all\">;\n mergeBaseBranch: z$1.ZodPipe;\n}, z$1.core.$strip>, z$1.ZodObject<{\n target: z$1.ZodLiteral<\"commit\">;\n sha: z$1.ZodString;\n}, z$1.core.$strip>], \"target\">;\ntype EnvironmentDiffQuery = z$1.infer;\n/**\n * Query for fetching a single file's contents at one side of a diff target.\n * Used by the diff card to reparse the card's patch with full old/new contents\n * so `@pierre/diffs` can render expand-context buttons between hunks.\n *\n * For `branch_committed` / `all`, callers pass the resolved merge-base SHA\n * (`mergeBaseRef`, surfaced by `workspace.diff`) rather than the branch name\n * โ€” the diff itself was computed against that SHA, so reading the old side\n * from the same SHA keeps the file content aligned with the hunk line\n * numbers. Reading from the branch tip is wrong whenever the branch has\n * moved past the merge-base since the file existed there.\n */\ndeclare const environmentDiffFileQuerySchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n target: z$1.ZodLiteral<\"uncommitted\">;\n path: z$1.ZodString;\n side: z$1.ZodEnum<{\n new: \"new\";\n old: \"old\";\n }>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n target: z$1.ZodLiteral<\"branch_committed\">;\n mergeBaseRef: z$1.ZodString;\n path: z$1.ZodString;\n side: z$1.ZodEnum<{\n new: \"new\";\n old: \"old\";\n }>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n target: z$1.ZodLiteral<\"all\">;\n mergeBaseRef: z$1.ZodString;\n path: z$1.ZodString;\n side: z$1.ZodEnum<{\n new: \"new\";\n old: \"old\";\n }>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n target: z$1.ZodLiteral<\"commit\">;\n sha: z$1.ZodString;\n path: z$1.ZodString;\n side: z$1.ZodEnum<{\n new: \"new\";\n old: \"old\";\n }>;\n}, z$1.core.$strip>], \"target\">;\ntype EnvironmentDiffFileQuery = z$1.infer;\ndeclare const environmentDiffFileResponseSchema: z$1.ZodObject<{\n path: z$1.ZodString;\n content: z$1.ZodString;\n contentEncoding: z$1.ZodEnum<{\n base64: \"base64\";\n utf8: \"utf8\";\n }>;\n mimeType: z$1.ZodOptional;\n sizeBytes: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype EnvironmentDiffFileResponse = z$1.infer;\ndeclare const environmentArchiveThreadsResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n archivedThreadIds: z$1.ZodArray;\n}, z$1.core.$strip>;\ntype EnvironmentArchiveThreadsResponse = z$1.infer;\ndeclare const pullRequestMergeMethodSchema: z$1.ZodEnum<{\n merge: \"merge\";\n rebase: \"rebase\";\n squash: \"squash\";\n}>;\ntype PullRequestMergeMethod = z$1.infer;\ndeclare const commitActionResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n action: z$1.ZodLiteral<\"commit\">;\n message: z$1.ZodString;\n commitSha: z$1.ZodString;\n commitSubject: z$1.ZodString;\n}, z$1.core.$strip>;\ntype CommitActionResponse = z$1.infer;\ndeclare const squashMergeActionResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n action: z$1.ZodLiteral<\"squash_merge\">;\n merged: z$1.ZodBoolean;\n message: z$1.ZodString;\n commitSha: z$1.ZodString;\n commitSubject: z$1.ZodString;\n}, z$1.core.$strip>;\ntype SquashMergeActionResponse = z$1.infer;\ndeclare const pullRequestReadyActionResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n action: z$1.ZodLiteral<\"pull_request_ready\">;\n message: z$1.ZodString;\n}, z$1.core.$strip>;\ntype PullRequestReadyActionResponse = z$1.infer;\ndeclare const pullRequestMergeActionResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n action: z$1.ZodLiteral<\"pull_request_merge\">;\n method: z$1.ZodEnum<{\n merge: \"merge\";\n rebase: \"rebase\";\n squash: \"squash\";\n }>;\n message: z$1.ZodString;\n}, z$1.core.$strip>;\ntype PullRequestMergeActionResponse = z$1.infer;\ndeclare const pullRequestDraftActionResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n action: z$1.ZodLiteral<\"pull_request_draft\">;\n message: z$1.ZodString;\n}, z$1.core.$strip>;\ntype PullRequestDraftActionResponse = z$1.infer;\ndeclare const environmentStatusResponseSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n workspace: z$1.ZodObject<{\n workingTree: z$1.ZodObject<{\n insertions: z$1.ZodNumber;\n deletions: z$1.ZodNumber;\n files: z$1.ZodArray;\n insertions: z$1.ZodNullable;\n deletions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n hasUncommittedChanges: z$1.ZodBoolean;\n state: z$1.ZodEnum<{\n clean: \"clean\";\n untracked: \"untracked\";\n dirty_uncommitted: \"dirty_uncommitted\";\n committed_unmerged: \"committed_unmerged\";\n dirty_and_committed_unmerged: \"dirty_and_committed_unmerged\";\n }>;\n }, z$1.core.$strip>;\n checkout: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"branch\">;\n branchName: z$1.ZodString;\n headSha: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"detached\">;\n headSha: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unborn\">;\n branchName: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unknown\">;\n reason: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">;\n branch: z$1.ZodObject<{\n currentBranch: z$1.ZodNullable;\n defaultBranch: z$1.ZodString;\n }, z$1.core.$strip>;\n mergeBase: z$1.ZodNullable;\n insertions: z$1.ZodNullable;\n deletions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n mergeBaseBranch: z$1.ZodString;\n baseRef: z$1.ZodNullable;\n aheadCount: z$1.ZodNumber;\n behindCount: z$1.ZodNumber;\n hasCommittedUnmergedChanges: z$1.ZodBoolean;\n commits: z$1.ZodArray>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>;\n}, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"not_applicable\">;\n reason: z$1.ZodEnum<{\n non_git_environment: \"non_git_environment\";\n }>;\n message: z$1.ZodString;\n}, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"unavailable\">;\n failure: z$1.ZodObject<{\n code: z$1.ZodEnum<{\n unknown: \"unknown\";\n path_not_found: \"path_not_found\";\n not_git_repo: \"not_git_repo\";\n not_worktree: \"not_worktree\";\n workspace_type_mismatch: \"workspace_type_mismatch\";\n permission_denied: \"permission_denied\";\n unknown_environment: \"unknown_environment\";\n }>;\n workspacePath: z$1.ZodString;\n message: z$1.ZodString;\n }, z$1.core.$strict>;\n}, z$1.core.$strict>], \"outcome\">;\n/**\n * Structured pull-request lookup outcome. \"absent\" is a real answer โ€” the\n * host checked and the branch has no PR (non-git environments resolve to\n * \"absent\" without a daemon call). \"unavailable\" means the lookup itself\n * failed (gh missing, not authenticated, timeout, unreachable workspace), so\n * callers must not render it as \"no PR exists\".\n */\ndeclare const environmentPullRequestResponseSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n pullRequest: z$1.ZodObject<{\n number: z$1.ZodNumber;\n title: z$1.ZodString;\n state: z$1.ZodEnum<{\n merged: \"merged\";\n draft: \"draft\";\n open: \"open\";\n closed: \"closed\";\n }>;\n url: z$1.ZodString;\n baseRefName: z$1.ZodString;\n headRefName: z$1.ZodString;\n updatedAt: z$1.ZodString;\n checks: z$1.ZodObject<{\n state: z$1.ZodEnum<{\n unknown: \"unknown\";\n pending: \"pending\";\n passing: \"passing\";\n failing: \"failing\";\n no_checks: \"no_checks\";\n }>;\n totalCount: z$1.ZodNumber;\n passedCount: z$1.ZodNumber;\n failedCount: z$1.ZodNumber;\n pendingCount: z$1.ZodNumber;\n }, z$1.core.$strict>;\n review: z$1.ZodObject<{\n state: z$1.ZodEnum<{\n none: \"none\";\n approved: \"approved\";\n changes_requested: \"changes_requested\";\n review_required: \"review_required\";\n review_requested: \"review_requested\";\n }>;\n reviewRequestCount: z$1.ZodNumber;\n }, z$1.core.$strict>;\n mergeability: z$1.ZodObject<{\n state: z$1.ZodEnum<{\n unknown: \"unknown\";\n draft: \"draft\";\n mergeable: \"mergeable\";\n conflicts: \"conflicts\";\n blocked: \"blocked\";\n }>;\n mergeStateStatus: z$1.ZodNullable>;\n mergeable: z$1.ZodNullable>;\n }, z$1.core.$strict>;\n attention: z$1.ZodEnum<{\n none: \"none\";\n merged: \"merged\";\n draft: \"draft\";\n closed: \"closed\";\n changes_requested: \"changes_requested\";\n review_requested: \"review_requested\";\n conflicts: \"conflicts\";\n blocked: \"blocked\";\n checks_failed: \"checks_failed\";\n checks_pending: \"checks_pending\";\n ready_to_merge: \"ready_to_merge\";\n }>;\n }, z$1.core.$strict>;\n}, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"absent\">;\n}, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"unavailable\">;\n message: z$1.ZodString;\n}, z$1.core.$strict>], \"outcome\">;\ntype EnvironmentPullRequestResponse = z$1.infer;\ndeclare const environmentDiffResponseSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n diff: z$1.ZodObject<{\n diff: z$1.ZodString;\n truncated: z$1.ZodBoolean;\n shortstat: z$1.ZodString;\n files: z$1.ZodString;\n mergeBaseRef: z$1.ZodNullable;\n }, z$1.core.$strip>;\n}, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"not_applicable\">;\n reason: z$1.ZodEnum<{\n non_git_environment: \"non_git_environment\";\n }>;\n message: z$1.ZodString;\n}, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"unavailable\">;\n failure: z$1.ZodObject<{\n code: z$1.ZodEnum<{\n unknown: \"unknown\";\n path_not_found: \"path_not_found\";\n not_git_repo: \"not_git_repo\";\n not_worktree: \"not_worktree\";\n workspace_type_mismatch: \"workspace_type_mismatch\";\n permission_denied: \"permission_denied\";\n unknown_environment: \"unknown_environment\";\n }>;\n workspacePath: z$1.ZodString;\n message: z$1.ZodString;\n }, z$1.core.$strict>;\n}, z$1.core.$strict>], \"outcome\">;\ntype EnvironmentDiffResponse = z$1.infer;\ndeclare const environmentDiffFilesResponseSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n files: z$1.ZodArray;\n changeKind: z$1.ZodEnum<{\n deleted: \"deleted\";\n added: \"added\";\n modified: \"modified\";\n renamed: \"renamed\";\n copied: \"copied\";\n type_changed: \"type_changed\";\n }>;\n additions: z$1.ZodNumber;\n deletions: z$1.ZodNumber;\n binary: z$1.ZodBoolean;\n origin: z$1.ZodEnum<{\n untracked: \"untracked\";\n tracked: \"tracked\";\n }>;\n loadMode: z$1.ZodEnum<{\n auto: \"auto\";\n on_demand: \"on_demand\";\n too_large: \"too_large\";\n }>;\n }, z$1.core.$strip>>;\n shortstat: z$1.ZodString;\n mergeBaseRef: z$1.ZodNullable;\n initialPatches: z$1.ZodArray>;\n}, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"not_applicable\">;\n reason: z$1.ZodEnum<{\n non_git_environment: \"non_git_environment\";\n too_many_files: \"too_many_files\";\n }>;\n message: z$1.ZodString;\n}, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"unavailable\">;\n failure: z$1.ZodObject<{\n code: z$1.ZodEnum<{\n unknown: \"unknown\";\n path_not_found: \"path_not_found\";\n not_git_repo: \"not_git_repo\";\n not_worktree: \"not_worktree\";\n workspace_type_mismatch: \"workspace_type_mismatch\";\n permission_denied: \"permission_denied\";\n unknown_environment: \"unknown_environment\";\n }>;\n workspacePath: z$1.ZodString;\n message: z$1.ZodString;\n }, z$1.core.$strict>;\n}, z$1.core.$strict>], \"outcome\">;\ntype EnvironmentDiffFilesResponse = z$1.infer;\ndeclare const environmentDiffPatchResponseSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n patches: z$1.ZodArray>;\n}, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"not_applicable\">;\n reason: z$1.ZodEnum<{\n non_git_environment: \"non_git_environment\";\n }>;\n message: z$1.ZodString;\n}, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"unavailable\">;\n failure: z$1.ZodObject<{\n code: z$1.ZodEnum<{\n unknown: \"unknown\";\n path_not_found: \"path_not_found\";\n not_git_repo: \"not_git_repo\";\n not_worktree: \"not_worktree\";\n workspace_type_mismatch: \"workspace_type_mismatch\";\n permission_denied: \"permission_denied\";\n unknown_environment: \"unknown_environment\";\n }>;\n workspacePath: z$1.ZodString;\n message: z$1.ZodString;\n }, z$1.core.$strict>;\n}, z$1.core.$strict>], \"outcome\">;\ntype EnvironmentDiffPatchResponse = z$1.infer;\n/**\n * Body for `POST /diff/patch`: the diff target plus the list of new paths whose\n * patches the client wants. A POST (not GET) because the repeated `paths` array\n * cannot survive flat query parsing. The client supplies only new paths; the\n * server re-derives each file's rename/copy pairing (`previousPath`) from its\n * own TOC.\n */\ndeclare const environmentDiffPatchRequestSchema: z$1.ZodObject<{\n target: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"uncommitted\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"branch_committed\">;\n mergeBaseBranch: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"all\">;\n mergeBaseBranch: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"commit\">;\n sha: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">;\n paths: z$1.ZodArray;\n}, z$1.core.$strict>;\ntype EnvironmentDiffPatchRequest = z$1.infer;\ntype EnvironmentStatusResponse = z$1.infer;\n\ndeclare const providerUsageResponseSchema: z$1.ZodObject<{\n codex: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n status: z$1.ZodLiteral<\"ok\">;\n accountEmail: z$1.ZodNullable;\n planLabel: z$1.ZodNullable;\n windows: z$1.ZodArray;\n cost: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"not_installed\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"unauthenticated\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"expired\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"error\">;\n message: z$1.ZodString;\n }, z$1.core.$strip>], \"status\">;\n claudeCode: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n status: z$1.ZodLiteral<\"ok\">;\n accountEmail: z$1.ZodNullable;\n planLabel: z$1.ZodNullable;\n windows: z$1.ZodArray;\n cost: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"not_installed\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"unauthenticated\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"expired\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"error\">;\n message: z$1.ZodString;\n }, z$1.core.$strip>], \"status\">;\n cursor: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n status: z$1.ZodLiteral<\"ok\">;\n accountEmail: z$1.ZodNullable;\n planLabel: z$1.ZodNullable;\n windows: z$1.ZodArray;\n cost: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"not_installed\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"unauthenticated\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"expired\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"error\">;\n message: z$1.ZodString;\n }, z$1.core.$strip>], \"status\">;\n}, z$1.core.$strip>;\ntype ProviderUsageResponse = z$1.infer;\ntype HostDaemonCommandTransport = \"settled\" | \"onlineRpc\";\ntype HostDaemonCommandEnvironmentLane = \"read\" | \"write\";\ntype HostDaemonFlushEventsBeforeResult = boolean | \"when-initiated\";\ninterface HostDaemonCommandDescriptor {\n type: Type;\n schema: Schema;\n resultSchema: ResultSchema;\n transport: Transport;\n retryable: Retryable;\n flushEventsBeforeResult: HostDaemonFlushEventsBeforeResult;\n envLane: HostDaemonCommandEnvironmentLane | null;\n}\ndeclare const hostDaemonCommandRegistry: {\n \"thread.start\": HostDaemonCommandDescriptor<\"thread.start\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n threadId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n projectId: z$1.ZodString;\n providerId: z$1.ZodString;\n acpLaunchSpec: z$1.ZodOptional;\n env: z$1.ZodRecord;\n cwd: z$1.ZodOptional;\n modelCli: z$1.ZodOptional;\n selectFlag: z$1.ZodOptional;\n primaryModels: z$1.ZodArray;\n }, z$1.core.$strict>, z$1.ZodTransform<{\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n } | undefined, {\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n }>>>;\n reasoningCli: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n nativeReasoning: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n permissionCli: z$1.ZodOptional>;\n workspaceWrite: z$1.ZodOptional>;\n readonly: z$1.ZodOptional>;\n insertAfterArgs: z$1.ZodOptional;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>>;\n options: z$1.ZodIntersection;\n reasoningLevel: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n claudeCodePermissionMode: z$1.ZodOptional>;\n claudeCodeMockCliTraffic: z$1.ZodOptional>;\n workflowsEnabled: z$1.ZodBoolean;\n memoryEnabled: z$1.ZodOptional;\n providerSubagentsEnabled: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n permissionMode: z$1.ZodLiteral<\"accept-edits\">;\n permissionScope: z$1.ZodLiteral<\"workspace\">;\n approvalReviewer: z$1.ZodLiteral<\"user\">;\n permissionEscalation: z$1.ZodEnum<{\n ask: \"ask\";\n deny: \"deny\";\n }>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n permissionMode: z$1.ZodLiteral<\"auto\">;\n permissionScope: z$1.ZodLiteral<\"workspace\">;\n approvalReviewer: z$1.ZodLiteral<\"automatic\">;\n permissionEscalation: z$1.ZodEnum<{\n ask: \"ask\";\n deny: \"deny\";\n }>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n permissionMode: z$1.ZodLiteral<\"full\">;\n permissionScope: z$1.ZodLiteral<\"full\">;\n approvalReviewer: z$1.ZodNull;\n permissionEscalation: z$1.ZodNull;\n }, z$1.core.$strip>], \"permissionMode\">>;\n instructions: z$1.ZodString;\n dynamicTools: z$1.ZodArray>;\n injectedSkillSources: z$1.ZodArray;\n treeHash: z$1.ZodString;\n entryPath: z$1.ZodString;\n sourceType: z$1.ZodEnum<{\n builtin: \"builtin\";\n \"data-dir\": \"data-dir\";\n }>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n name: z$1.ZodString;\n description: z$1.ZodString;\n kind: z$1.ZodLiteral<\"workspace-path\">;\n sourceType: z$1.ZodLiteral<\"project\">;\n sourceRootPath: z$1.ZodString;\n skillFilePath: z$1.ZodString;\n }, z$1.core.$strict>], \"kind\">>;\n disallowedTools: z$1.ZodOptional>;\n instructionMode: z$1.ZodEnum<{\n append: \"append\";\n replace: \"replace\";\n }>;\n type: z$1.ZodLiteral<\"thread.start\">;\n requestId: z$1.ZodString;\n input: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n builtin: \"builtin\";\n project: \"project\";\n user: \"user\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n inputGroups: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n builtin: \"builtin\";\n project: \"project\";\n user: \"user\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>>>;\n threadStoragePath: z$1.ZodOptional;\n fork: z$1.ZodOptional>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n providerThreadId: z$1.ZodString;\n }, z$1.core.$strip>, \"settled\", false>;\n \"turn.submit\": HostDaemonCommandDescriptor<\"turn.submit\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n threadId: z$1.ZodString;\n type: z$1.ZodLiteral<\"turn.submit\">;\n requestId: z$1.ZodString;\n input: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n builtin: \"builtin\";\n project: \"project\";\n user: \"user\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n inputGroups: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n builtin: \"builtin\";\n project: \"project\";\n user: \"user\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>>>;\n options: z$1.ZodIntersection;\n reasoningLevel: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n claudeCodePermissionMode: z$1.ZodOptional>;\n claudeCodeMockCliTraffic: z$1.ZodOptional>;\n workflowsEnabled: z$1.ZodBoolean;\n memoryEnabled: z$1.ZodOptional;\n providerSubagentsEnabled: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n permissionMode: z$1.ZodLiteral<\"accept-edits\">;\n permissionScope: z$1.ZodLiteral<\"workspace\">;\n approvalReviewer: z$1.ZodLiteral<\"user\">;\n permissionEscalation: z$1.ZodEnum<{\n ask: \"ask\";\n deny: \"deny\";\n }>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n permissionMode: z$1.ZodLiteral<\"auto\">;\n permissionScope: z$1.ZodLiteral<\"workspace\">;\n approvalReviewer: z$1.ZodLiteral<\"automatic\">;\n permissionEscalation: z$1.ZodEnum<{\n ask: \"ask\";\n deny: \"deny\";\n }>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n permissionMode: z$1.ZodLiteral<\"full\">;\n permissionScope: z$1.ZodLiteral<\"full\">;\n approvalReviewer: z$1.ZodNull;\n permissionEscalation: z$1.ZodNull;\n }, z$1.core.$strip>], \"permissionMode\">>;\n acpLaunchSpec: z$1.ZodOptional;\n env: z$1.ZodRecord;\n cwd: z$1.ZodOptional;\n modelCli: z$1.ZodOptional;\n selectFlag: z$1.ZodOptional;\n primaryModels: z$1.ZodArray;\n }, z$1.core.$strict>, z$1.ZodTransform<{\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n } | undefined, {\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n }>>>;\n reasoningCli: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n nativeReasoning: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n permissionCli: z$1.ZodOptional>;\n workspaceWrite: z$1.ZodOptional>;\n readonly: z$1.ZodOptional>;\n insertAfterArgs: z$1.ZodOptional;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>>;\n resumeContext: z$1.ZodObject<{\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n instructionMode: z$1.ZodEnum<{\n append: \"append\";\n replace: \"replace\";\n }>;\n projectId: z$1.ZodString;\n providerId: z$1.ZodString;\n acpLaunchSpec: z$1.ZodOptional;\n env: z$1.ZodRecord;\n cwd: z$1.ZodOptional;\n modelCli: z$1.ZodOptional;\n selectFlag: z$1.ZodOptional;\n primaryModels: z$1.ZodArray;\n }, z$1.core.$strict>, z$1.ZodTransform<{\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n } | undefined, {\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n }>>>;\n reasoningCli: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n nativeReasoning: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n permissionCli: z$1.ZodOptional>;\n workspaceWrite: z$1.ZodOptional>;\n readonly: z$1.ZodOptional>;\n insertAfterArgs: z$1.ZodOptional;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>>;\n instructions: z$1.ZodString;\n dynamicTools: z$1.ZodArray>;\n injectedSkillSources: z$1.ZodArray;\n treeHash: z$1.ZodString;\n entryPath: z$1.ZodString;\n sourceType: z$1.ZodEnum<{\n builtin: \"builtin\";\n \"data-dir\": \"data-dir\";\n }>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n name: z$1.ZodString;\n description: z$1.ZodString;\n kind: z$1.ZodLiteral<\"workspace-path\">;\n sourceType: z$1.ZodLiteral<\"project\">;\n sourceRootPath: z$1.ZodString;\n skillFilePath: z$1.ZodString;\n }, z$1.core.$strict>], \"kind\">>;\n disallowedTools: z$1.ZodOptional>;\n providerThreadId: z$1.ZodString;\n }, z$1.core.$strict>;\n target: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n mode: z$1.ZodLiteral<\"start\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n mode: z$1.ZodLiteral<\"auto\">;\n expectedTurnId: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n mode: z$1.ZodLiteral<\"steer\">;\n expectedTurnId: z$1.ZodNullable;\n }, z$1.core.$strip>], \"mode\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n appliedAs: z$1.ZodEnum<{\n steer: \"steer\";\n \"new-turn\": \"new-turn\";\n }>;\n }, z$1.core.$strip>, \"settled\", false>;\n \"thread.stop\": HostDaemonCommandDescriptor<\"thread.stop\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n threadId: z$1.ZodString;\n type: z$1.ZodLiteral<\"thread.stop\">;\n }, z$1.core.$strict>, z$1.ZodObject<{}, z$1.core.$strip>, \"settled\", false>;\n \"thread.goal.clear\": HostDaemonCommandDescriptor<\"thread.goal.clear\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n threadId: z$1.ZodString;\n type: z$1.ZodLiteral<\"thread.goal.clear\">;\n options: z$1.ZodIntersection;\n reasoningLevel: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n claudeCodePermissionMode: z$1.ZodOptional>;\n claudeCodeMockCliTraffic: z$1.ZodOptional>;\n workflowsEnabled: z$1.ZodBoolean;\n memoryEnabled: z$1.ZodOptional;\n providerSubagentsEnabled: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n permissionMode: z$1.ZodLiteral<\"accept-edits\">;\n permissionScope: z$1.ZodLiteral<\"workspace\">;\n approvalReviewer: z$1.ZodLiteral<\"user\">;\n permissionEscalation: z$1.ZodEnum<{\n ask: \"ask\";\n deny: \"deny\";\n }>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n permissionMode: z$1.ZodLiteral<\"auto\">;\n permissionScope: z$1.ZodLiteral<\"workspace\">;\n approvalReviewer: z$1.ZodLiteral<\"automatic\">;\n permissionEscalation: z$1.ZodEnum<{\n ask: \"ask\";\n deny: \"deny\";\n }>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n permissionMode: z$1.ZodLiteral<\"full\">;\n permissionScope: z$1.ZodLiteral<\"full\">;\n approvalReviewer: z$1.ZodNull;\n permissionEscalation: z$1.ZodNull;\n }, z$1.core.$strip>], \"permissionMode\">>;\n acpLaunchSpec: z$1.ZodOptional;\n env: z$1.ZodRecord;\n cwd: z$1.ZodOptional;\n modelCli: z$1.ZodOptional;\n selectFlag: z$1.ZodOptional;\n primaryModels: z$1.ZodArray;\n }, z$1.core.$strict>, z$1.ZodTransform<{\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n } | undefined, {\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n }>>>;\n reasoningCli: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n nativeReasoning: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n permissionCli: z$1.ZodOptional>;\n workspaceWrite: z$1.ZodOptional>;\n readonly: z$1.ZodOptional>;\n insertAfterArgs: z$1.ZodOptional;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>>;\n resumeContext: z$1.ZodObject<{\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n instructionMode: z$1.ZodEnum<{\n append: \"append\";\n replace: \"replace\";\n }>;\n projectId: z$1.ZodString;\n providerId: z$1.ZodString;\n acpLaunchSpec: z$1.ZodOptional;\n env: z$1.ZodRecord;\n cwd: z$1.ZodOptional;\n modelCli: z$1.ZodOptional;\n selectFlag: z$1.ZodOptional;\n primaryModels: z$1.ZodArray;\n }, z$1.core.$strict>, z$1.ZodTransform<{\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n } | undefined, {\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n }>>>;\n reasoningCli: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n nativeReasoning: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n permissionCli: z$1.ZodOptional>;\n workspaceWrite: z$1.ZodOptional>;\n readonly: z$1.ZodOptional>;\n insertAfterArgs: z$1.ZodOptional;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>>;\n instructions: z$1.ZodString;\n dynamicTools: z$1.ZodArray>;\n injectedSkillSources: z$1.ZodArray;\n treeHash: z$1.ZodString;\n entryPath: z$1.ZodString;\n sourceType: z$1.ZodEnum<{\n builtin: \"builtin\";\n \"data-dir\": \"data-dir\";\n }>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n name: z$1.ZodString;\n description: z$1.ZodString;\n kind: z$1.ZodLiteral<\"workspace-path\">;\n sourceType: z$1.ZodLiteral<\"project\">;\n sourceRootPath: z$1.ZodString;\n skillFilePath: z$1.ZodString;\n }, z$1.core.$strict>], \"kind\">>;\n disallowedTools: z$1.ZodOptional>;\n providerThreadId: z$1.ZodString;\n }, z$1.core.$strict>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n cleared: z$1.ZodBoolean;\n }, z$1.core.$strict>, \"settled\", false>;\n \"thread.plan.cancel\": HostDaemonCommandDescriptor<\"thread.plan.cancel\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n threadId: z$1.ZodString;\n type: z$1.ZodLiteral<\"thread.plan.cancel\">;\n expectedTurnId: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n cancelled: z$1.ZodBoolean;\n }, z$1.core.$strict>, \"settled\", false>;\n \"thread.rename\": HostDaemonCommandDescriptor<\"thread.rename\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n threadId: z$1.ZodString;\n type: z$1.ZodLiteral<\"thread.rename\">;\n title: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{}, z$1.core.$strip>, \"settled\", false>;\n \"thread.archive\": HostDaemonCommandDescriptor<\"thread.archive\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n threadId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"thread.archive\">;\n providerId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{}, z$1.core.$strip>, \"settled\", false>;\n \"thread.unarchive\": HostDaemonCommandDescriptor<\"thread.unarchive\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n threadId: z$1.ZodString;\n type: z$1.ZodLiteral<\"thread.unarchive\">;\n providerId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{}, z$1.core.$strip>, \"settled\", false>;\n \"interactive.resolve\": HostDaemonCommandDescriptor<\"interactive.resolve\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n threadId: z$1.ZodString;\n type: z$1.ZodLiteral<\"interactive.resolve\">;\n interactionId: z$1.ZodString;\n providerId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n providerRequestId: z$1.ZodString;\n resolution: z$1.ZodUnion;\n grantedPermissions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"allow_for_session\">;\n grantedPermissions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"deny\">;\n }, z$1.core.$strip>], \"decision\">, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"user_answer\">;\n answers: z$1.ZodRecord;\n freeText: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin_submitted\">;\n }, z$1.core.$strip>]>;\n }, z$1.core.$strict>, z$1.ZodObject<{}, z$1.core.$strip>, \"settled\", false>;\n \"codex.inference.complete\": HostDaemonCommandDescriptor<\"codex.inference.complete\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"codex.inference.complete\">;\n model: z$1.ZodString;\n prompt: z$1.ZodString;\n outputSchema: z$1.ZodType>;\n timeoutMs: z$1.ZodNumber;\n }, z$1.core.$strict>, z$1.ZodObject<{\n model: z$1.ZodString;\n value: z$1.ZodType>;\n }, z$1.core.$strip>, \"settled\", false>;\n \"codex.voice.transcribe\": HostDaemonCommandDescriptor<\"codex.voice.transcribe\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"codex.voice.transcribe\">;\n model: z$1.ZodString;\n audioBase64: z$1.ZodString;\n mimeType: z$1.ZodString;\n filename: z$1.ZodString;\n prompt: z$1.ZodNullable;\n timeoutMs: z$1.ZodNumber;\n }, z$1.core.$strict>, z$1.ZodObject<{\n model: z$1.ZodString;\n text: z$1.ZodString;\n }, z$1.core.$strip>, \"settled\", false>;\n \"environment.provision\": HostDaemonCommandDescriptor<\"environment.provision\", z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n environmentId: z$1.ZodString;\n type: z$1.ZodLiteral<\"environment.provision\">;\n initiator: z$1.ZodNullable>;\n workspaceProvisionType: z$1.ZodLiteral<\"unmanaged\">;\n path: z$1.ZodString;\n checkout: z$1.ZodOptional;\n name: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"new\">;\n name: z$1.ZodString;\n baseBranch: z$1.ZodString;\n }, z$1.core.$strict>], \"kind\">>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodString;\n type: z$1.ZodLiteral<\"environment.provision\">;\n initiator: z$1.ZodNullable>;\n sourcePath: z$1.ZodString;\n targetPath: z$1.ZodString;\n branchName: z$1.ZodString;\n baseBranch: z$1.ZodNullable;\n setupTimeoutMs: z$1.ZodNumber;\n workspaceProvisionType: z$1.ZodLiteral<\"managed-worktree\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodString;\n type: z$1.ZodLiteral<\"environment.provision\">;\n initiator: z$1.ZodNullable>;\n workspaceProvisionType: z$1.ZodLiteral<\"personal\">;\n targetPath: z$1.ZodString;\n }, z$1.core.$strict>], \"workspaceProvisionType\">, z$1.ZodObject<{\n path: z$1.ZodString;\n isGitRepo: z$1.ZodBoolean;\n isWorktree: z$1.ZodBoolean;\n branchName: z$1.ZodNullable;\n defaultBranch: z$1.ZodNullable;\n transcript: z$1.ZodArray;\n key: z$1.ZodString;\n text: z$1.ZodString;\n startedAt: z$1.ZodOptional;\n status: z$1.ZodOptional>;\n metadata: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, \"settled\", false>;\n \"project.clone\": HostDaemonCommandDescriptor<\"project.clone\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"project.clone\">;\n remoteUrl: z$1.ZodString;\n projectSlug: z$1.ZodString;\n targetPath: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodObject<{\n path: z$1.ZodString;\n gitRemoteUrl: z$1.ZodNullable;\n }, z$1.core.$strict>, \"settled\", false>;\n \"environment.provision.cancel\": HostDaemonCommandDescriptor<\"environment.provision.cancel\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n type: z$1.ZodLiteral<\"environment.provision.cancel\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n aborted: z$1.ZodBoolean;\n }, z$1.core.$strip>, \"settled\", false>;\n \"environment.destroy\": HostDaemonCommandDescriptor<\"environment.destroy\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"environment.destroy\">;\n }, z$1.core.$strict>, z$1.ZodObject<{}, z$1.core.$strip>, \"settled\", false>;\n \"workspace.commit\": HostDaemonCommandDescriptor<\"workspace.commit\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.commit\">;\n message: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n commitSha: z$1.ZodString;\n commitSubject: z$1.ZodString;\n }, z$1.core.$strip>, \"settled\", false>;\n \"workspace.squash_merge\": HostDaemonCommandDescriptor<\"workspace.squash_merge\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.squash_merge\">;\n targetBranch: z$1.ZodString;\n commitMessage: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n commitSha: z$1.ZodString;\n commitSubject: z$1.ZodString;\n merged: z$1.ZodBoolean;\n }, z$1.core.$strip>, \"settled\", false>;\n \"workspace.pull_request_action\": HostDaemonCommandDescriptor<\"workspace.pull_request_action\", z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.pull_request_action\">;\n operation: z$1.ZodLiteral<\"ready\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.pull_request_action\">;\n operation: z$1.ZodLiteral<\"draft\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.pull_request_action\">;\n operation: z$1.ZodLiteral<\"merge\">;\n method: z$1.ZodEnum<{\n merge: \"merge\";\n squash: \"squash\";\n rebase: \"rebase\";\n }>;\n }, z$1.core.$strict>], \"operation\">, z$1.ZodObject<{}, z$1.core.$strict>, \"settled\", false>;\n \"host.list_files\": HostDaemonCommandDescriptor<\"host.list_files\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.list_files\">;\n path: z$1.ZodString;\n query: z$1.ZodOptional;\n limit: z$1.ZodNumber;\n }, z$1.core.$strip>, z$1.ZodObject<{\n files: z$1.ZodArray>;\n truncated: z$1.ZodBoolean;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"host.list_paths\": HostDaemonCommandDescriptor<\"host.list_paths\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.list_paths\">;\n path: z$1.ZodString;\n query: z$1.ZodOptional;\n limit: z$1.ZodNumber;\n includeFiles: z$1.ZodBoolean;\n includeDirectories: z$1.ZodBoolean;\n }, z$1.core.$strip>, z$1.ZodObject<{\n paths: z$1.ZodArray;\n path: z$1.ZodString;\n name: z$1.ZodString;\n score: z$1.ZodNumber;\n positions: z$1.ZodArray;\n }, z$1.core.$strip>>;\n truncated: z$1.ZodBoolean;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"host.mkdir\": HostDaemonCommandDescriptor<\"host.mkdir\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.mkdir\">;\n path: z$1.ZodString;\n rootPath: z$1.ZodOptional;\n recursive: z$1.ZodBoolean;\n }, z$1.core.$strict>, z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n }, z$1.core.$strict>, \"onlineRpc\", false>;\n \"host.move_path\": HostDaemonCommandDescriptor<\"host.move_path\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.move_path\">;\n sourcePath: z$1.ZodString;\n destinationPath: z$1.ZodString;\n rootPath: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n }, z$1.core.$strict>, \"onlineRpc\", false>;\n \"host.remove_path\": HostDaemonCommandDescriptor<\"host.remove_path\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.remove_path\">;\n path: z$1.ZodString;\n rootPath: z$1.ZodOptional;\n recursive: z$1.ZodBoolean;\n }, z$1.core.$strict>, z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n }, z$1.core.$strict>, \"onlineRpc\", false>;\n \"host.browse_directory\": HostDaemonCommandDescriptor<\"host.browse_directory\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.browse_directory\">;\n path: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n directory: z$1.ZodString;\n parent: z$1.ZodNullable;\n entries: z$1.ZodArray;\n name: z$1.ZodString;\n path: z$1.ZodString;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"host.paths_exist\": HostDaemonCommandDescriptor<\"host.paths_exist\", z$1.ZodObject<{\n paths: z$1.ZodPipe, z$1.ZodTransform>;\n type: z$1.ZodLiteral<\"host.paths_exist\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n existence: z$1.ZodRecord;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"project.inspect\": HostDaemonCommandDescriptor<\"project.inspect\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"project.inspect\">;\n path: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n path: z$1.ZodString;\n gitRemoteUrl: z$1.ZodNullable;\n }, z$1.core.$strict>, \"onlineRpc\", true>;\n \"project.clone_default_path\": HostDaemonCommandDescriptor<\"project.clone_default_path\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"project.clone_default_path\">;\n projectSlug: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n path: z$1.ZodString;\n }, z$1.core.$strict>, \"onlineRpc\", true>;\n \"host.pick_folder\": HostDaemonCommandDescriptor<\"host.pick_folder\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.pick_folder\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, \"onlineRpc\", false>;\n \"host.caffeinate\": HostDaemonCommandDescriptor<\"host.caffeinate\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.caffeinate\">;\n enabled: z$1.ZodBoolean;\n }, z$1.core.$strict>, z$1.ZodObject<{\n enabled: z$1.ZodBoolean;\n supported: z$1.ZodBoolean;\n }, z$1.core.$strict>, \"onlineRpc\", false>;\n \"connect-tunnel.ensure-identity\": HostDaemonCommandDescriptor<\"connect-tunnel.ensure-identity\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"connect-tunnel.ensure-identity\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n label: z$1.ZodString;\n baseDomain: z$1.ZodString;\n }, z$1.core.$strict>, \"onlineRpc\", true>;\n \"host.list_commands\": HostDaemonCommandDescriptor<\"host.list_commands\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.list_commands\">;\n providerId: z$1.ZodString;\n cwd: z$1.ZodNullable;\n }, z$1.core.$strict>, z$1.ZodObject<{\n commands: z$1.ZodArray;\n origin: z$1.ZodEnum<{\n project: \"project\";\n user: \"user\";\n }>;\n description: z$1.ZodNullable;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"host.list_skills\": HostDaemonCommandDescriptor<\"host.list_skills\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.list_skills\">;\n providerId: z$1.ZodString;\n cwd: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n skills: z$1.ZodArray;\n filePath: z$1.ZodString;\n rootKind: z$1.ZodEnum<{\n plugin: \"plugin\";\n \"bb-project\": \"bb-project\";\n \"bb-data-dir\": \"bb-data-dir\";\n \"bb-builtin\": \"bb-builtin\";\n \"provider-project\": \"provider-project\";\n \"provider-user\": \"provider-user\";\n }>;\n linked: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"host.delete_skill\": HostDaemonCommandDescriptor<\"host.delete_skill\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.delete_skill\">;\n scope: z$1.ZodEnum<{\n \"bb-project\": \"bb-project\";\n \"bb-user\": \"bb-user\";\n \"claude-user\": \"claude-user\";\n \"claude-project\": \"claude-project\";\n \"codex-user\": \"codex-user\";\n \"codex-project\": \"codex-project\";\n }>;\n name: z$1.ZodString;\n cwd: z$1.ZodNullable;\n rootPath: z$1.ZodNullable;\n }, z$1.core.$strict>, z$1.ZodObject<{\n deletedPath: z$1.ZodString;\n }, z$1.core.$strip>, \"onlineRpc\", false>;\n \"host.write_skill\": HostDaemonCommandDescriptor<\"host.write_skill\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.write_skill\">;\n scope: z$1.ZodEnum<{\n \"bb-project\": \"bb-project\";\n \"bb-user\": \"bb-user\";\n }>;\n name: z$1.ZodString;\n cwd: z$1.ZodNullable;\n content: z$1.ZodString;\n expectedSha256: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"written\">;\n filePath: z$1.ZodString;\n sha256: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"conflict\">;\n currentSha256: z$1.ZodNullable;\n }, z$1.core.$strip>], \"outcome\">, \"onlineRpc\", false>;\n \"host.list_branches\": HostDaemonCommandDescriptor<\"host.list_branches\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.list_branches\">;\n path: z$1.ZodString;\n query: z$1.ZodOptional;\n selectedBranch: z$1.ZodOptional;\n limit: z$1.ZodNumber;\n }, z$1.core.$strip>, z$1.ZodObject<{\n branches: z$1.ZodArray;\n branchesTruncated: z$1.ZodBoolean;\n checkout: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"branch\">;\n branchName: z$1.ZodString;\n headSha: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"detached\">;\n headSha: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unborn\">;\n branchName: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unknown\">;\n reason: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">;\n defaultBranch: z$1.ZodNullable;\n defaultBranchRelation: z$1.ZodNullable>;\n hasUncommittedChanges: z$1.ZodBoolean;\n operation: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"none\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"merge\">;\n hasConflicts: z$1.ZodBoolean;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"rebase\">;\n hasConflicts: z$1.ZodBoolean;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"cherry-pick\">;\n hasConflicts: z$1.ZodBoolean;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"revert\">;\n hasConflicts: z$1.ZodBoolean;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unknown\">;\n reason: z$1.ZodString;\n hasConflicts: z$1.ZodBoolean;\n }, z$1.core.$strip>], \"kind\">;\n originDefaultBranch: z$1.ZodNullable;\n remoteBranches: z$1.ZodArray;\n remoteBranchesTruncated: z$1.ZodBoolean;\n selectedBranch: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"host.file_metadata\": HostDaemonCommandDescriptor<\"host.file_metadata\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.file_metadata\">;\n path: z$1.ZodString;\n rootPath: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodObject<{\n path: z$1.ZodString;\n modifiedAtMs: z$1.ZodNumber;\n sizeBytes: z$1.ZodNumber;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"host.read_file\": HostDaemonCommandDescriptor<\"host.read_file\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.read_file\">;\n path: z$1.ZodString;\n rootPath: z$1.ZodOptional;\n ref: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n path: z$1.ZodString;\n content: z$1.ZodString;\n contentEncoding: z$1.ZodEnum<{\n base64: \"base64\";\n utf8: \"utf8\";\n }>;\n mimeType: z$1.ZodOptional;\n sizeBytes: z$1.ZodNumber;\n modifiedAtMs: z$1.ZodOptional;\n sha256: z$1.ZodString;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"host.read_file_relative\": HostDaemonCommandDescriptor<\"host.read_file_relative\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.read_file_relative\">;\n rootPath: z$1.ZodString;\n path: z$1.ZodString;\n dotfiles: z$1.ZodEnum<{\n deny: \"deny\";\n allow: \"allow\";\n }>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n path: z$1.ZodString;\n content: z$1.ZodString;\n contentEncoding: z$1.ZodEnum<{\n base64: \"base64\";\n utf8: \"utf8\";\n }>;\n mimeType: z$1.ZodOptional;\n sizeBytes: z$1.ZodNumber;\n modifiedAtMs: z$1.ZodOptional;\n sha256: z$1.ZodString;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"host.write_file\": HostDaemonCommandDescriptor<\"host.write_file\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.write_file\">;\n path: z$1.ZodString;\n rootPath: z$1.ZodOptional;\n content: z$1.ZodString;\n contentEncoding: z$1.ZodEnum<{\n base64: \"base64\";\n utf8: \"utf8\";\n }>;\n createParents: z$1.ZodBoolean;\n expectedSha256: z$1.ZodOptional>;\n mode: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"written\">;\n sha256: z$1.ZodString;\n sizeBytes: z$1.ZodNumber;\n }, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"conflict\">;\n currentSha256: z$1.ZodNullable;\n }, z$1.core.$strict>], \"outcome\">, \"onlineRpc\", false>;\n \"provider.list_models\": HostDaemonCommandDescriptor<\"provider.list_models\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"provider.list_models\">;\n providerId: z$1.ZodString;\n acpLaunchSpec: z$1.ZodOptional;\n env: z$1.ZodRecord;\n cwd: z$1.ZodOptional;\n modelCli: z$1.ZodOptional;\n selectFlag: z$1.ZodOptional;\n primaryModels: z$1.ZodArray;\n }, z$1.core.$strict>, z$1.ZodTransform<{\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n } | undefined, {\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n }>>>;\n reasoningCli: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n nativeReasoning: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n permissionCli: z$1.ZodOptional>;\n workspaceWrite: z$1.ZodOptional>;\n readonly: z$1.ZodOptional>;\n insertAfterArgs: z$1.ZodOptional;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n models: z$1.ZodArray;\n description: z$1.ZodString;\n }, z$1.core.$strip>>;\n defaultReasoningEffort: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n isDefault: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n selectedOnlyModels: z$1.ZodArray;\n description: z$1.ZodString;\n }, z$1.core.$strip>>;\n defaultReasoningEffort: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n isDefault: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"known_acp_agents.status\": HostDaemonCommandDescriptor<\"known_acp_agents.status\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"known_acp_agents.status\">;\n agents: z$1.ZodArray>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n agents: z$1.ZodArray;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>, \"onlineRpc\", true>;\n \"provider.usage\": HostDaemonCommandDescriptor<\"provider.usage\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"provider.usage\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n codex: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n status: z$1.ZodLiteral<\"ok\">;\n accountEmail: z$1.ZodNullable;\n planLabel: z$1.ZodNullable;\n windows: z$1.ZodArray;\n cost: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"not_installed\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"unauthenticated\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"expired\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"error\">;\n message: z$1.ZodString;\n }, z$1.core.$strip>], \"status\">;\n claudeCode: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n status: z$1.ZodLiteral<\"ok\">;\n accountEmail: z$1.ZodNullable;\n planLabel: z$1.ZodNullable;\n windows: z$1.ZodArray;\n cost: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"not_installed\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"unauthenticated\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"expired\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"error\">;\n message: z$1.ZodString;\n }, z$1.core.$strip>], \"status\">;\n cursor: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n status: z$1.ZodLiteral<\"ok\">;\n accountEmail: z$1.ZodNullable;\n planLabel: z$1.ZodNullable;\n windows: z$1.ZodArray;\n cost: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"not_installed\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"unauthenticated\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"expired\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"error\">;\n message: z$1.ZodString;\n }, z$1.core.$strip>], \"status\">;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"provider_cli.status\": HostDaemonCommandDescriptor<\"provider_cli.status\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"provider_cli.status\">;\n }, z$1.core.$strict>, z$1.ZodRecord, z$1.ZodObject<{\n displayName: z$1.ZodString;\n executableName: z$1.ZodString;\n executablePath: z$1.ZodNullable;\n installed: z$1.ZodBoolean;\n installSource: z$1.ZodEnum<{\n external: \"external\";\n notInstalled: \"notInstalled\";\n npmGlobal: \"npmGlobal\";\n }>;\n currentVersion: z$1.ZodNullable;\n latestVersion: z$1.ZodNullable;\n minimumSupportedVersion: z$1.ZodNullable;\n npmPackageName: z$1.ZodNullable;\n npmGlobalPackageVersion: z$1.ZodNullable;\n installAction: z$1.ZodNullable;\n label: z$1.ZodEnum<{\n Install: \"Install\";\n Update: \"Update\";\n }>;\n commandKind: z$1.ZodEnum<{\n exec: \"exec\";\n shell: \"shell\";\n }>;\n command: z$1.ZodString;\n }, z$1.core.$strip>>;\n needsUpdate: z$1.ZodBoolean;\n versionUnsupported: z$1.ZodBoolean;\n }, z$1.core.$strip>>, \"onlineRpc\", true>;\n \"provider_cli.install\": HostDaemonCommandDescriptor<\"provider_cli.install\", z$1.ZodObject<{\n provider: z$1.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n }>;\n actionKind: z$1.ZodEnum<{\n install: \"install\";\n update: \"update\";\n }>;\n type: z$1.ZodLiteral<\"provider_cli.install\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n events: z$1.ZodArray;\n provider: z$1.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n }>;\n command: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"output\">;\n provider: z$1.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n }>;\n stream: z$1.ZodEnum<{\n stdout: \"stdout\";\n stderr: \"stderr\";\n }>;\n text: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"completed\">;\n provider: z$1.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n }>;\n exitCode: z$1.ZodNullable;\n signal: z$1.ZodNullable;\n success: z$1.ZodBoolean;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"error\">;\n provider: z$1.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n }>;\n message: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">>;\n }, z$1.core.$strict>, \"onlineRpc\", false>;\n \"workspace.status\": HostDaemonCommandDescriptor<\"workspace.status\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.status\">;\n mergeBaseBranch: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n workspaceStatus: z$1.ZodObject<{\n workingTree: z$1.ZodObject<{\n insertions: z$1.ZodNumber;\n deletions: z$1.ZodNumber;\n files: z$1.ZodArray;\n insertions: z$1.ZodNullable;\n deletions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n hasUncommittedChanges: z$1.ZodBoolean;\n state: z$1.ZodEnum<{\n clean: \"clean\";\n untracked: \"untracked\";\n dirty_uncommitted: \"dirty_uncommitted\";\n committed_unmerged: \"committed_unmerged\";\n dirty_and_committed_unmerged: \"dirty_and_committed_unmerged\";\n }>;\n }, z$1.core.$strip>;\n checkout: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"branch\">;\n branchName: z$1.ZodString;\n headSha: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"detached\">;\n headSha: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unborn\">;\n branchName: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unknown\">;\n reason: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">;\n branch: z$1.ZodObject<{\n currentBranch: z$1.ZodNullable;\n defaultBranch: z$1.ZodString;\n }, z$1.core.$strip>;\n mergeBase: z$1.ZodNullable;\n insertions: z$1.ZodNullable;\n deletions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n mergeBaseBranch: z$1.ZodString;\n baseRef: z$1.ZodNullable;\n aheadCount: z$1.ZodNumber;\n behindCount: z$1.ZodNumber;\n hasCommittedUnmergedChanges: z$1.ZodBoolean;\n commits: z$1.ZodArray>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"unavailable\">;\n failure: z$1.ZodObject<{\n code: z$1.ZodEnum<{\n path_not_found: \"path_not_found\";\n not_git_repo: \"not_git_repo\";\n not_worktree: \"not_worktree\";\n workspace_type_mismatch: \"workspace_type_mismatch\";\n permission_denied: \"permission_denied\";\n unknown_environment: \"unknown_environment\";\n unknown: \"unknown\";\n }>;\n workspacePath: z$1.ZodString;\n message: z$1.ZodString;\n }, z$1.core.$strict>;\n }, z$1.core.$strict>], \"outcome\">, \"onlineRpc\", true>;\n \"workspace.diff\": HostDaemonCommandDescriptor<\"workspace.diff\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.diff\">;\n target: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"uncommitted\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"branch_committed\">;\n mergeBaseBranch: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"all\">;\n mergeBaseBranch: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"commit\">;\n sha: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">;\n maxDiffBytes: z$1.ZodNumber;\n maxFileListBytes: z$1.ZodNumber;\n }, z$1.core.$strict>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n diff: z$1.ZodObject<{\n diff: z$1.ZodString;\n truncated: z$1.ZodBoolean;\n shortstat: z$1.ZodString;\n files: z$1.ZodString;\n mergeBaseRef: z$1.ZodNullable;\n }, z$1.core.$strip>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"unavailable\">;\n failure: z$1.ZodObject<{\n code: z$1.ZodEnum<{\n path_not_found: \"path_not_found\";\n not_git_repo: \"not_git_repo\";\n not_worktree: \"not_worktree\";\n workspace_type_mismatch: \"workspace_type_mismatch\";\n permission_denied: \"permission_denied\";\n unknown_environment: \"unknown_environment\";\n unknown: \"unknown\";\n }>;\n workspacePath: z$1.ZodString;\n message: z$1.ZodString;\n }, z$1.core.$strict>;\n }, z$1.core.$strict>], \"outcome\">, \"onlineRpc\", true>;\n \"workspace.diffFiles\": HostDaemonCommandDescriptor<\"workspace.diffFiles\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.diffFiles\">;\n target: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"uncommitted\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"branch_committed\">;\n mergeBaseBranch: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"all\">;\n mergeBaseBranch: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"commit\">;\n sha: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">;\n }, z$1.core.$strict>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n files: z$1.ZodArray;\n statusLetter: z$1.ZodEnum<{\n M: \"M\";\n A: \"A\";\n D: \"D\";\n R: \"R\";\n C: \"C\";\n T: \"T\";\n }>;\n additions: z$1.ZodNumber;\n deletions: z$1.ZodNumber;\n binary: z$1.ZodBoolean;\n origin: z$1.ZodEnum<{\n untracked: \"untracked\";\n tracked: \"tracked\";\n }>;\n }, z$1.core.$strip>>;\n shortstat: z$1.ZodString;\n mergeBaseRef: z$1.ZodNullable;\n }, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"unavailable\">;\n failure: z$1.ZodObject<{\n code: z$1.ZodEnum<{\n path_not_found: \"path_not_found\";\n not_git_repo: \"not_git_repo\";\n not_worktree: \"not_worktree\";\n workspace_type_mismatch: \"workspace_type_mismatch\";\n permission_denied: \"permission_denied\";\n unknown_environment: \"unknown_environment\";\n unknown: \"unknown\";\n }>;\n workspacePath: z$1.ZodString;\n message: z$1.ZodString;\n }, z$1.core.$strict>;\n }, z$1.core.$strict>], \"outcome\">, \"onlineRpc\", true>;\n \"workspace.diffPatch\": HostDaemonCommandDescriptor<\"workspace.diffPatch\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.diffPatch\">;\n target: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"uncommitted\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"branch_committed\">;\n mergeBaseBranch: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"all\">;\n mergeBaseBranch: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"commit\">;\n sha: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">;\n paths: z$1.ZodArray;\n maxBytesPerFile: z$1.ZodNumber;\n }, z$1.core.$strict>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n patches: z$1.ZodArray>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"unavailable\">;\n failure: z$1.ZodObject<{\n code: z$1.ZodEnum<{\n path_not_found: \"path_not_found\";\n not_git_repo: \"not_git_repo\";\n not_worktree: \"not_worktree\";\n workspace_type_mismatch: \"workspace_type_mismatch\";\n permission_denied: \"permission_denied\";\n unknown_environment: \"unknown_environment\";\n unknown: \"unknown\";\n }>;\n workspacePath: z$1.ZodString;\n message: z$1.ZodString;\n }, z$1.core.$strict>;\n }, z$1.core.$strict>], \"outcome\">, \"onlineRpc\", true>;\n \"workspace.pull_request\": HostDaemonCommandDescriptor<\"workspace.pull_request\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.pull_request\">;\n }, z$1.core.$strict>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n pullRequest: z$1.ZodObject<{\n number: z$1.ZodNumber;\n title: z$1.ZodString;\n state: z$1.ZodEnum<{\n OPEN: \"OPEN\";\n CLOSED: \"CLOSED\";\n MERGED: \"MERGED\";\n }>;\n url: z$1.ZodString;\n isDraft: z$1.ZodBoolean;\n baseRefName: z$1.ZodString;\n headRefName: z$1.ZodString;\n updatedAt: z$1.ZodString;\n checks: z$1.ZodArray;\n conclusion: z$1.ZodNullable>;\n url: z$1.ZodNullable;\n }, z$1.core.$strict>>;\n reviewDecision: z$1.ZodNullable>;\n reviewRequestCount: z$1.ZodNumber;\n mergeStateStatus: z$1.ZodNullable>;\n mergeable: z$1.ZodNullable>;\n }, z$1.core.$strict>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"absent\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"unavailable\">;\n message: z$1.ZodString;\n }, z$1.core.$strict>], \"outcome\">, \"onlineRpc\", true>;\n};\ntype HostDaemonCommandRegistry = typeof hostDaemonCommandRegistry;\ntype AnyHostDaemonCommandDescriptor = HostDaemonCommandRegistry[keyof HostDaemonCommandRegistry];\ntype HostDaemonCommandDescriptorForTransport = Extract;\ntype HostDaemonResultSchemaMapForTransport = {\n [Descriptor in HostDaemonCommandDescriptorForTransport as Descriptor[\"type\"]]: Descriptor[\"resultSchema\"];\n};\ntype HostDaemonOnlineRpcResultSchemaMap = HostDaemonResultSchemaMapForTransport<\"onlineRpc\">;\ntype HostDaemonOnlineRpcResultByType = {\n [K in keyof HostDaemonOnlineRpcResultSchemaMap]: z$1.infer;\n};\n\ndeclare const pickFolderResponseSchema: z$1.ZodObject<{\n path: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype PickFolderResponse = z$1.infer;\ndeclare const pathsExistRequestSchema: z$1.ZodObject<{\n paths: z$1.ZodPipe, z$1.ZodTransform>;\n}, z$1.core.$strip>;\ntype PathsExistRequest = z$1.infer;\ndeclare const pathsExistResponseSchema: z$1.ZodObject<{\n existence: z$1.ZodRecord;\n}, z$1.core.$strip>;\ntype PathsExistResponse = z$1.infer;\ndeclare const providerCliStatusResponseSchema: z$1.ZodRecord, z$1.ZodObject<{\n displayName: z$1.ZodString;\n executableName: z$1.ZodString;\n executablePath: z$1.ZodNullable;\n installed: z$1.ZodBoolean;\n installSource: z$1.ZodEnum<{\n external: \"external\";\n notInstalled: \"notInstalled\";\n npmGlobal: \"npmGlobal\";\n }>;\n currentVersion: z$1.ZodNullable;\n latestVersion: z$1.ZodNullable;\n minimumSupportedVersion: z$1.ZodNullable;\n npmPackageName: z$1.ZodNullable;\n npmGlobalPackageVersion: z$1.ZodNullable;\n installAction: z$1.ZodNullable;\n label: z$1.ZodEnum<{\n Install: \"Install\";\n Update: \"Update\";\n }>;\n commandKind: z$1.ZodEnum<{\n exec: \"exec\";\n shell: \"shell\";\n }>;\n command: z$1.ZodString;\n }, z$1.core.$strip>>;\n needsUpdate: z$1.ZodBoolean;\n versionUnsupported: z$1.ZodBoolean;\n}, z$1.core.$strip>>;\ntype ProviderCliStatusResponse = z$1.infer;\ndeclare const providerCliInstallRequestSchema: z$1.ZodObject<{\n provider: z$1.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n }>;\n actionKind: z$1.ZodEnum<{\n install: \"install\";\n update: \"update\";\n }>;\n}, z$1.core.$strip>;\ntype ProviderCliInstallRequest = z$1.infer;\ndeclare const providerCliInstallEventSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"started\">;\n provider: z$1.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n }>;\n command: z$1.ZodString;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"output\">;\n provider: z$1.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n }>;\n stream: z$1.ZodEnum<{\n stdout: \"stdout\";\n stderr: \"stderr\";\n }>;\n text: z$1.ZodString;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"completed\">;\n provider: z$1.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n }>;\n exitCode: z$1.ZodNullable;\n signal: z$1.ZodNullable;\n success: z$1.ZodBoolean;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"error\">;\n provider: z$1.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n }>;\n message: z$1.ZodString;\n}, z$1.core.$strip>], \"type\">;\ntype ProviderCliInstallEvent = z$1.infer;\n\ninterface CreateFilePreviewResponse {\n baseUrl: string;\n expiresAtMs: number;\n}\ntype HostFileReadResponse = HostDaemonOnlineRpcResultByType[\"host.read_file\"];\ntype HostFileWriteResponse = HostDaemonOnlineRpcResultByType[\"host.write_file\"];\ntype HostFileListResponse = HostDaemonOnlineRpcResultByType[\"host.list_files\"];\ntype HostPathListResponse = HostDaemonOnlineRpcResultByType[\"host.list_paths\"];\ntype HostMkdirResponse = HostDaemonOnlineRpcResultByType[\"host.mkdir\"];\ntype HostMovePathResponse = HostDaemonOnlineRpcResultByType[\"host.move_path\"];\ntype HostRemovePathResponse = HostDaemonOnlineRpcResultByType[\"host.remove_path\"];\n\n/**\n * Query for `GET /hosts/:id/directory`, the interactive path browser's\n * single-level directory read. `path` is an absolute directory on the host;\n * omitting it lists the host's home directory (the daemon resolves it, since a\n * remote caller cannot know the host's home).\n */\ndeclare const hostDirectoryQuerySchema: z$1.ZodObject<{\n path: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype HostDirectoryQuery = z$1.infer;\ndeclare const hostDirectoryListingSchema: z$1.ZodObject<{\n directory: z$1.ZodString;\n parent: z$1.ZodNullable;\n entries: z$1.ZodArray;\n name: z$1.ZodString;\n path: z$1.ZodString;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype HostDirectoryListing = z$1.infer;\n/** Project name is sent so the daemon can derive its host-local checkout path. */\ndeclare const hostCloneDefaultPathQuerySchema: z$1.ZodObject<{\n projectId: z$1.ZodString;\n}, z$1.core.$strip>;\ntype HostCloneDefaultPathQuery = z$1.infer;\ndeclare const hostCloneDefaultPathResponseSchema: z$1.ZodObject<{\n path: z$1.ZodString;\n}, z$1.core.$strict>;\ntype HostCloneDefaultPathResponse = z$1.infer;\ndeclare const createHostJoinCodeResponseSchema: z$1.ZodObject<{\n joinCode: z$1.ZodString;\n hostId: z$1.ZodString;\n expiresAt: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype CreateHostJoinCodeResponse = z$1.infer;\ndeclare const updateHostRequestSchema: z$1.ZodObject<{\n name: z$1.ZodString;\n}, z$1.core.$strict>;\ntype UpdateHostRequest = z$1.infer;\ndeclare const hostRetryUpdateResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n}, z$1.core.$strict>;\ntype HostRetryUpdateResponse = z$1.infer;\ntype HostPathsExistRequest = PathsExistRequest;\ntype HostPathsExistResponse = PathsExistResponse;\ndeclare const hostPickFolderRequestSchema: z$1.ZodObject<{\n clientHostId: z$1.ZodString;\n}, z$1.core.$strict>;\ntype HostPickFolderRequest = z$1.infer;\ntype HostPickFolderResponse = PickFolderResponse;\ntype HostProviderCliStatusResponse = ProviderCliStatusResponse;\ntype HostProviderCliInstallRequest = ProviderCliInstallRequest;\ntype HostProviderCliInstallEvent = ProviderCliInstallEvent;\n\ndeclare const pluginUpdateCheckEntrySchema: z$1.ZodObject<{\n id: z$1.ZodString;\n outcome: z$1.ZodEnum<{\n unavailable: \"unavailable\";\n incompatible: \"incompatible\";\n current: \"current\";\n \"update-available\": \"update-available\";\n pinned: \"pinned\";\n }>;\n devMode: z$1.ZodOptional>;\n installed: z$1.ZodObject<{\n version: z$1.ZodString;\n display: z$1.ZodString;\n }, z$1.core.$strip>;\n candidate: z$1.ZodOptional>;\n blocked: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n detail: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype PluginUpdateCheckEntry = z$1.infer;\ndeclare const pluginApplyUpdateResultSchema: z$1.ZodObject<{\n applied: z$1.ZodBoolean;\n from: z$1.ZodObject<{\n version: z$1.ZodString;\n display: z$1.ZodString;\n }, z$1.core.$strip>;\n to: z$1.ZodOptional>;\n outcome: z$1.ZodEnum<{\n current: \"current\";\n updated: \"updated\";\n \"rolled-back\": \"rolled-back\";\n }>;\n detail: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype PluginApplyUpdateResult$1 = z$1.infer;\ndeclare const pluginSourceDetailSchema: z$1.ZodObject<{\n requested: z$1.ZodString;\n resolved: z$1.ZodString;\n integrity: z$1.ZodOptional;\n registry: z$1.ZodOptional;\n engines: z$1.ZodObject<{\n bb: z$1.ZodOptional;\n bbPluginSdk: z$1.ZodOptional;\n }, z$1.core.$strip>;\n installedAt: z$1.ZodOptional;\n history: z$1.ZodArray>;\n}, z$1.core.$strip>;\ntype PluginSourceDetail = z$1.infer;\ndeclare const installedPluginSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n source: z$1.ZodString;\n rootDir: z$1.ZodString;\n version: z$1.ZodString;\n provenance: z$1.ZodEnum<{\n builtin: \"builtin\";\n direct: \"direct\";\n catalog: \"catalog\";\n }>;\n isOrphanedBuiltin: z$1.ZodBoolean;\n catalogEntryId: z$1.ZodOptional;\n sourceDisplay: z$1.ZodString;\n updateState: z$1.ZodObject<{\n outcome: z$1.ZodOptional>;\n availableVersion: z$1.ZodOptional;\n blockedVersion: z$1.ZodOptional;\n blockedReasons: z$1.ZodOptional>;\n lastCheckAt: z$1.ZodOptional;\n lastFailure: z$1.ZodOptional>;\n }, z$1.core.$strip>;\n enabled: z$1.ZodBoolean;\n description: z$1.ZodNullable;\n name: z$1.ZodNullable;\n icon: z$1.ZodNullable;\n experimental_iconUrl: z$1.ZodDefault>;\n status: z$1.ZodEnum<{\n error: \"error\";\n running: \"running\";\n missing: \"missing\";\n incompatible: \"incompatible\";\n disabled: \"disabled\";\n degraded: \"degraded\";\n \"needs-configuration\": \"needs-configuration\";\n }>;\n statusDetail: z$1.ZodNullable;\n handlerStats: z$1.ZodObject<{\n count: z$1.ZodNumber;\n totalMs: z$1.ZodNumber;\n maxMs: z$1.ZodNumber;\n errorCount: z$1.ZodNumber;\n }, z$1.core.$strip>;\n services: z$1.ZodArray;\n }, z$1.core.$strip>>;\n schedules: z$1.ZodArray;\n lastStatus: z$1.ZodNullable>;\n lastError: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n cliCommand: z$1.ZodNullable>;\n hasSettings: z$1.ZodBoolean;\n app: z$1.ZodObject<{\n hasApp: z$1.ZodBoolean;\n bundle: z$1.ZodNullable;\n hash: z$1.ZodString;\n sdkMajor: z$1.ZodNumber;\n sdkVersion: z$1.ZodString;\n compatible: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>;\n logoUrl: z$1.ZodNullable;\n logoDarkUrl: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype InstalledPlugin = z$1.infer;\ndeclare const pluginListResponseSchema: z$1.ZodObject<{\n enabled: z$1.ZodBoolean;\n plugins: z$1.ZodArray;\n isOrphanedBuiltin: z$1.ZodBoolean;\n catalogEntryId: z$1.ZodOptional;\n sourceDisplay: z$1.ZodString;\n updateState: z$1.ZodObject<{\n outcome: z$1.ZodOptional>;\n availableVersion: z$1.ZodOptional;\n blockedVersion: z$1.ZodOptional;\n blockedReasons: z$1.ZodOptional>;\n lastCheckAt: z$1.ZodOptional;\n lastFailure: z$1.ZodOptional>;\n }, z$1.core.$strip>;\n enabled: z$1.ZodBoolean;\n description: z$1.ZodNullable;\n name: z$1.ZodNullable;\n icon: z$1.ZodNullable;\n experimental_iconUrl: z$1.ZodDefault>;\n status: z$1.ZodEnum<{\n error: \"error\";\n running: \"running\";\n missing: \"missing\";\n incompatible: \"incompatible\";\n disabled: \"disabled\";\n degraded: \"degraded\";\n \"needs-configuration\": \"needs-configuration\";\n }>;\n statusDetail: z$1.ZodNullable;\n handlerStats: z$1.ZodObject<{\n count: z$1.ZodNumber;\n totalMs: z$1.ZodNumber;\n maxMs: z$1.ZodNumber;\n errorCount: z$1.ZodNumber;\n }, z$1.core.$strip>;\n services: z$1.ZodArray;\n }, z$1.core.$strip>>;\n schedules: z$1.ZodArray;\n lastStatus: z$1.ZodNullable>;\n lastError: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n cliCommand: z$1.ZodNullable>;\n hasSettings: z$1.ZodBoolean;\n app: z$1.ZodObject<{\n hasApp: z$1.ZodBoolean;\n bundle: z$1.ZodNullable;\n hash: z$1.ZodString;\n sdkMajor: z$1.ZodNumber;\n sdkVersion: z$1.ZodString;\n compatible: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>;\n logoUrl: z$1.ZodNullable;\n logoDarkUrl: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype PluginListResponse = z$1.infer;\ndeclare const pluginReloadResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n plugins: z$1.ZodArray;\n isOrphanedBuiltin: z$1.ZodBoolean;\n catalogEntryId: z$1.ZodOptional;\n sourceDisplay: z$1.ZodString;\n updateState: z$1.ZodObject<{\n outcome: z$1.ZodOptional>;\n availableVersion: z$1.ZodOptional;\n blockedVersion: z$1.ZodOptional;\n blockedReasons: z$1.ZodOptional>;\n lastCheckAt: z$1.ZodOptional;\n lastFailure: z$1.ZodOptional>;\n }, z$1.core.$strip>;\n enabled: z$1.ZodBoolean;\n description: z$1.ZodNullable;\n name: z$1.ZodNullable;\n icon: z$1.ZodNullable;\n experimental_iconUrl: z$1.ZodDefault>;\n status: z$1.ZodEnum<{\n error: \"error\";\n running: \"running\";\n missing: \"missing\";\n incompatible: \"incompatible\";\n disabled: \"disabled\";\n degraded: \"degraded\";\n \"needs-configuration\": \"needs-configuration\";\n }>;\n statusDetail: z$1.ZodNullable;\n handlerStats: z$1.ZodObject<{\n count: z$1.ZodNumber;\n totalMs: z$1.ZodNumber;\n maxMs: z$1.ZodNumber;\n errorCount: z$1.ZodNumber;\n }, z$1.core.$strip>;\n services: z$1.ZodArray;\n }, z$1.core.$strip>>;\n schedules: z$1.ZodArray;\n lastStatus: z$1.ZodNullable>;\n lastError: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n cliCommand: z$1.ZodNullable>;\n hasSettings: z$1.ZodBoolean;\n app: z$1.ZodObject<{\n hasApp: z$1.ZodBoolean;\n bundle: z$1.ZodNullable;\n hash: z$1.ZodString;\n sdkMajor: z$1.ZodNumber;\n sdkVersion: z$1.ZodString;\n compatible: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>;\n logoUrl: z$1.ZodNullable;\n logoDarkUrl: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype PluginReloadResponse = z$1.infer;\ndeclare const pluginRemoveResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n}, z$1.core.$strip>;\ntype PluginRemoveResponse = z$1.infer;\ndeclare const pluginSettingsResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n schema: z$1.ZodRecord;\n secret: z$1.ZodOptional>;\n default: z$1.ZodOptional;\n label: z$1.ZodString;\n description: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"boolean\">;\n default: z$1.ZodOptional;\n label: z$1.ZodString;\n description: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"select\">;\n options: z$1.ZodArray;\n default: z$1.ZodOptional;\n label: z$1.ZodString;\n description: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"project\">;\n default: z$1.ZodOptional;\n label: z$1.ZodString;\n description: z$1.ZodOptional;\n }, z$1.core.$strict>], \"type\">>;\n values: z$1.ZodRecord>>;\n}, z$1.core.$strip>;\ntype PluginSettingsResponse = z$1.infer;\ndeclare const pluginTokenResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n token: z$1.ZodString;\n}, z$1.core.$strip>;\ntype PluginTokenResponse = z$1.infer;\ndeclare const pluginCatalogStatusSchema: z$1.ZodObject<{\n pluginCount: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype PluginCatalogStatus = z$1.infer;\ndeclare const pluginCatalogSearchResultSchema: z$1.ZodObject<{\n entryId: z$1.ZodString;\n pluginId: z$1.ZodString;\n displayName: z$1.ZodString;\n description: z$1.ZodString;\n icon: z$1.ZodNullable;\n category: z$1.ZodString;\n source: z$1.ZodString;\n installed: z$1.ZodBoolean;\n compatible: z$1.ZodBoolean;\n incompatibleReason: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype PluginCatalogSearchResult$1 = z$1.infer;\n\ndeclare const systemExecutionOptionsResponseSchema: z$1.ZodObject<{\n providers: z$1.ZodArray;\n capabilities: z$1.ZodObject<{\n supportsArchive: z$1.ZodBoolean;\n supportsRename: z$1.ZodBoolean;\n supportsServiceTier: z$1.ZodBoolean;\n supportsUserQuestion: z$1.ZodBoolean;\n supportsFork: z$1.ZodBoolean;\n supportedPermissionModes: z$1.ZodArray>;\n }, z$1.core.$strip>;\n composerActions: z$1.ZodArray;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plan\">;\n command: z$1.ZodObject<{\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n trailingText: z$1.ZodString;\n }, z$1.core.$strip>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"goal\">;\n command: z$1.ZodObject<{\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n trailingText: z$1.ZodString;\n }, z$1.core.$strip>;\n }, z$1.core.$strip>], \"kind\">>;\n available: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n models: z$1.ZodArray;\n description: z$1.ZodString;\n }, z$1.core.$strip>>;\n defaultReasoningEffort: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n isDefault: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n selectedOnlyModels: z$1.ZodArray;\n description: z$1.ZodString;\n }, z$1.core.$strip>>;\n defaultReasoningEffort: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n isDefault: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n modelLoadError: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype SystemExecutionOptionsResponse = z$1.infer;\ndeclare const systemExecutionOptionsQuerySchema: z$1.ZodObject<{\n providerId: z$1.ZodOptional;\n hostId: z$1.ZodOptional;\n environmentId: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype SystemExecutionOptionsQuery = z$1.infer;\n/** Omission preserves the existing behavior of reading the primary machine. */\ndeclare const systemUsageLimitsQuerySchema: z$1.ZodObject<{\n hostId: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype SystemUsageLimitsQuery = z$1.infer;\ndeclare const systemVoiceTranscriptionResponseSchema: z$1.ZodObject<{\n text: z$1.ZodString;\n}, z$1.core.$strip>;\ntype SystemVoiceTranscriptionResponse = z$1.infer;\ndeclare const systemConfigResponseSchema: z$1.ZodObject<{\n generalSettings: z$1.ZodObject<{\n caffeinate: z$1.ZodBoolean;\n showKeyboardHints: z$1.ZodBoolean;\n showUnhandledProviderEvents: z$1.ZodBoolean;\n codexMemoryEnabled: z$1.ZodBoolean;\n claudeCodeMemoryEnabled: z$1.ZodBoolean;\n codexSubagentsDisabled: z$1.ZodBoolean;\n claudeCodeSubagentsDisabled: z$1.ZodBoolean;\n claudeCodeWorkflowsDisabled: z$1.ZodBoolean;\n }, z$1.core.$strict>;\n keybindings: z$1.ZodArray;\n desktopOnly: z$1.ZodBoolean;\n shortcut: z$1.ZodObject<{\n key: z$1.ZodString;\n mod: z$1.ZodBoolean;\n meta: z$1.ZodBoolean;\n control: z$1.ZodBoolean;\n alt: z$1.ZodBoolean;\n shift: z$1.ZodBoolean;\n }, z$1.core.$strict>;\n when: z$1.ZodObject<{\n all: z$1.ZodArray>;\n none: z$1.ZodArray>;\n }, z$1.core.$strict>;\n }, z$1.core.$strict>>;\n defaultKeybindings: z$1.ZodArray;\n desktopOnly: z$1.ZodBoolean;\n shortcut: z$1.ZodObject<{\n key: z$1.ZodString;\n mod: z$1.ZodBoolean;\n meta: z$1.ZodBoolean;\n control: z$1.ZodBoolean;\n alt: z$1.ZodBoolean;\n shift: z$1.ZodBoolean;\n }, z$1.core.$strict>;\n when: z$1.ZodObject<{\n all: z$1.ZodArray>;\n none: z$1.ZodArray>;\n }, z$1.core.$strict>;\n }, z$1.core.$strict>>;\n keybindingOverrides: z$1.ZodArray;\n shortcut: z$1.ZodNullable>;\n }, z$1.core.$strict>>;\n experiments: z$1.ZodObject<{\n claudeCodeMockCliTraffic: z$1.ZodBoolean;\n plugins: z$1.ZodBoolean;\n toolsHub: z$1.ZodBoolean;\n sideChatPlugin: z$1.ZodBoolean;\n }, z$1.core.$strip>;\n appearance: z$1.ZodObject<{\n themeId: z$1.ZodString;\n customCss: z$1.ZodNullable;\n faviconColor: z$1.ZodEnum<{\n default: \"default\";\n red: \"red\";\n orange: \"orange\";\n yellow: \"yellow\";\n green: \"green\";\n teal: \"teal\";\n blue: \"blue\";\n purple: \"purple\";\n pink: \"pink\";\n }>;\n }, z$1.core.$strip>;\n customThemes: z$1.ZodArray;\n pluginThemes: z$1.ZodArray;\n }, z$1.core.$strip>>;\n featureFlags: z$1.ZodObject<{\n placeholder: z$1.ZodBoolean;\n }, z$1.core.$strip>;\n hostDaemonPort: z$1.ZodNullable;\n primaryHostId: z$1.ZodNullable;\n primaryHostPlatform: z$1.ZodNullable>;\n voiceTranscriptionEnabled: z$1.ZodBoolean;\n dataDir: z$1.ZodString;\n}, z$1.core.$strip>;\ntype SystemConfigResponse = z$1.infer;\ndeclare const systemAttentionResponseSchema: z$1.ZodObject<{\n hasAttention: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype SystemAttentionResponse = z$1.infer;\n/**\n * Theme catalog: the on-disk custom-theme directory plus the discovered custom\n * themes and the active palette. Drives `bb theme list` / `bb theme dir`.\n */\ndeclare const themeCatalogResponseSchema: z$1.ZodObject<{\n dir: z$1.ZodString;\n custom: z$1.ZodArray;\n plugins: z$1.ZodArray;\n }, z$1.core.$strip>>;\n active: z$1.ZodObject<{\n themeId: z$1.ZodString;\n customCss: z$1.ZodNullable;\n faviconColor: z$1.ZodEnum<{\n default: \"default\";\n red: \"red\";\n orange: \"orange\";\n yellow: \"yellow\";\n green: \"green\";\n teal: \"teal\";\n blue: \"blue\";\n purple: \"purple\";\n pink: \"pink\";\n }>;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>;\ntype ThemeCatalogResponse = z$1.infer;\ndeclare const systemVersionResponseSchema: z$1.ZodObject<{\n currentVersion: z$1.ZodString;\n latestVersion: z$1.ZodNullable;\n source: z$1.ZodLiteral<\"npm\">;\n updateAvailable: z$1.ZodBoolean;\n isDevelopment: z$1.ZodBoolean;\n upgradeCommand: z$1.ZodString;\n}, z$1.core.$strip>;\ntype SystemVersionResponse = z$1.infer;\ndeclare const systemConfigReloadResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n}, z$1.core.$strip>;\ntype SystemConfigReloadResponse = z$1.infer;\n\ndeclare const terminalSessionSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodNullable;\n environmentId: z$1.ZodNullable;\n hostId: z$1.ZodString;\n title: z$1.ZodString;\n initialCwd: z$1.ZodString;\n cols: z$1.ZodNumber;\n rows: z$1.ZodNumber;\n status: z$1.ZodEnum<{\n starting: \"starting\";\n disconnected: \"disconnected\";\n running: \"running\";\n exited: \"exited\";\n }>;\n exitCode: z$1.ZodNullable;\n closeReason: z$1.ZodNullable>;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n lastUserInputAt: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype TerminalSession = z$1.infer;\ndeclare const terminalListResponseSchema: z$1.ZodObject<{\n sessions: z$1.ZodArray;\n environmentId: z$1.ZodNullable;\n hostId: z$1.ZodString;\n title: z$1.ZodString;\n initialCwd: z$1.ZodString;\n cols: z$1.ZodNumber;\n rows: z$1.ZodNumber;\n status: z$1.ZodEnum<{\n starting: \"starting\";\n disconnected: \"disconnected\";\n running: \"running\";\n exited: \"exited\";\n }>;\n exitCode: z$1.ZodNullable;\n closeReason: z$1.ZodNullable>;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n lastUserInputAt: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype TerminalListResponse = z$1.infer;\ndeclare const createTerminalRequestSchema: z$1.ZodObject<{\n cols: z$1.ZodNumber;\n rows: z$1.ZodNumber;\n start: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodObject<{\n mode: z$1.ZodLiteral<\"command\">;\n command: z$1.ZodString;\n }, z$1.core.$strict>], \"mode\">>;\n target: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"environment\">;\n environmentId: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"host_path\">;\n hostId: z$1.ZodString;\n cwd: z$1.ZodNullable;\n }, z$1.core.$strict>], \"kind\">;\n title: z$1.ZodOptional;\n}, z$1.core.$strict>;\ntype CreateTerminalRequest = z$1.infer;\ndeclare const updateTerminalRequestSchema: z$1.ZodObject<{\n title: z$1.ZodString;\n}, z$1.core.$strict>;\ntype UpdateTerminalRequest = z$1.infer;\ndeclare const terminalInputRequestSchema: z$1.ZodObject<{\n dataBase64: z$1.ZodString;\n}, z$1.core.$strict>;\ntype TerminalInputRequest = z$1.infer;\ndeclare const terminalResizeRequestSchema: z$1.ZodObject<{\n cols: z$1.ZodNumber;\n rows: z$1.ZodNumber;\n}, z$1.core.$strict>;\ntype TerminalResizeRequest = z$1.infer;\ndeclare const terminalOutputQuerySchema: z$1.ZodObject<{\n sinceSeq: z$1.ZodOptional>;\n tailBytes: z$1.ZodOptional>;\n limitChunks: z$1.ZodOptional>;\n}, z$1.core.$strict>;\ntype TerminalOutputQuery = z$1.infer;\ndeclare const terminalOutputResponseSchema: z$1.ZodObject<{\n chunks: z$1.ZodArray>;\n nextSeq: z$1.ZodNumber;\n truncated: z$1.ZodBoolean;\n}, z$1.core.$strict>;\ntype TerminalOutputResponse = z$1.infer;\n\ndeclare const timelineRowStatusSchema: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n}>;\ntype TimelineRowStatus = z$1.infer;\ndeclare const timelineRowBaseSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype TimelineRowBase = z$1.infer;\ndeclare const timelineConversationRowSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"conversation\">;\n text: z$1.ZodString;\n attachments: z$1.ZodNullable;\n localImagePaths: z$1.ZodArray;\n localFilePaths: z$1.ZodArray;\n }, z$1.core.$strip>>;\n role: z$1.ZodLiteral<\"user\">;\n initiator: z$1.ZodEnum<{\n user: \"user\";\n agent: \"agent\";\n system: \"system\";\n }>;\n senderThreadId: z$1.ZodNullable;\n systemMessageKind: z$1.ZodEnum<{\n \"ownership-assigned\": \"ownership-assigned\";\n \"ownership-removed\": \"ownership-removed\";\n \"child-needs-attention\": \"child-needs-attention\";\n \"child-completed\": \"child-completed\";\n \"child-failed\": \"child-failed\";\n \"child-interrupted\": \"child-interrupted\";\n \"child-outcome-batch\": \"child-outcome-batch\";\n unlabeled: \"unlabeled\";\n }>;\n systemMessageSubject: z$1.ZodNullable;\n threadId: z$1.ZodString;\n threadName: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread-batch\">;\n count: z$1.ZodNumber;\n }, z$1.core.$strip>], \"kind\">>;\n turnRequest: z$1.ZodObject<{\n kind: z$1.ZodEnum<{\n message: \"message\";\n steer: \"steer\";\n }>;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n accepted: \"accepted\";\n }>;\n }, z$1.core.$strip>;\n mentions: z$1.ZodArray, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"conversation\">;\n text: z$1.ZodString;\n attachments: z$1.ZodNullable;\n localImagePaths: z$1.ZodArray;\n localFilePaths: z$1.ZodArray;\n }, z$1.core.$strip>>;\n role: z$1.ZodLiteral<\"assistant\">;\n turnRequest: z$1.ZodNull;\n}, z$1.core.$strip>], \"role\">;\ntype TimelineConversationRow = z$1.infer;\ndeclare const timelineSystemRowSchema: z$1.ZodUnion;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"system\">;\n title: z$1.ZodString;\n detail: z$1.ZodNullable;\n status: z$1.ZodNullable>;\n systemKind: z$1.ZodEnum<{\n error: \"error\";\n debug: \"debug\";\n reconnect: \"reconnect\";\n }>;\n}, z$1.core.$strip>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"system\">;\n title: z$1.ZodString;\n detail: z$1.ZodNullable;\n status: z$1.ZodNullable>;\n systemKind: z$1.ZodLiteral<\"operation\">;\n operationKind: z$1.ZodEnum<{\n generic: \"generic\";\n compaction: \"compaction\";\n \"thread-provisioning\": \"thread-provisioning\";\n \"thread-interrupted\": \"thread-interrupted\";\n \"provider-unhandled\": \"provider-unhandled\";\n warning: \"warning\";\n deprecation: \"deprecation\";\n }>;\n completedAt: z$1.ZodNullable;\n}, z$1.core.$strip>, z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"system\">;\n title: z$1.ZodString;\n detail: z$1.ZodNullable;\n systemKind: z$1.ZodLiteral<\"operation\">;\n operationKind: z$1.ZodLiteral<\"parent-change\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n parentChange: z$1.ZodObject<{\n action: z$1.ZodEnum<{\n assign: \"assign\";\n release: \"release\";\n transfer: \"transfer\";\n }>;\n previousParentThreadId: z$1.ZodNullable;\n previousParentThreadTitle: z$1.ZodNullable;\n nextParentThreadId: z$1.ZodNullable;\n nextParentThreadTitle: z$1.ZodNullable;\n }, z$1.core.$strip>;\n completedAt: z$1.ZodNullable;\n}, z$1.core.$strip>], \"operationKind\">]>;\ntype TimelineSystemRow = z$1.infer;\ninterface TimelineWorkRowBase extends TimelineRowBase {\n kind: \"work\";\n status: TimelineRowStatus;\n}\ndeclare const timelineCommandWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"command\">;\n callId: z$1.ZodString;\n command: z$1.ZodString;\n cwd: z$1.ZodNullable;\n source: z$1.ZodNullable;\n output: z$1.ZodString;\n exitCode: z$1.ZodNullable;\n completedAt: z$1.ZodNullable;\n approvalStatus: z$1.ZodNullable>;\n activityIntents: z$1.ZodArray;\n command: z$1.ZodString;\n name: z$1.ZodString;\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"list_files\">;\n command: z$1.ZodString;\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"search\">;\n command: z$1.ZodString;\n query: z$1.ZodNullable;\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"unknown\">;\n command: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">>;\n}, z$1.core.$strip>;\ntype TimelineCommandWorkRow = z$1.infer;\ndeclare const timelineToolWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"tool\">;\n callId: z$1.ZodString;\n toolName: z$1.ZodString;\n toolArgs: z$1.ZodNullable>>>;\n output: z$1.ZodString;\n completedAt: z$1.ZodNullable;\n approvalStatus: z$1.ZodNullable>;\n activityIntents: z$1.ZodArray;\n command: z$1.ZodString;\n name: z$1.ZodString;\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"list_files\">;\n command: z$1.ZodString;\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"search\">;\n command: z$1.ZodString;\n query: z$1.ZodNullable;\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"unknown\">;\n command: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">>;\n}, z$1.core.$strip>;\ntype TimelineToolWorkRow = z$1.infer;\ndeclare const timelineFileChangeWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"file-change\">;\n callId: z$1.ZodString;\n change: z$1.ZodObject<{\n path: z$1.ZodString;\n kind: z$1.ZodNullable;\n movePath: z$1.ZodNullable;\n diff: z$1.ZodNullable;\n diffStats: z$1.ZodObject<{\n added: z$1.ZodNumber;\n removed: z$1.ZodNumber;\n }, z$1.core.$strip>;\n }, z$1.core.$strip>;\n stdout: z$1.ZodNullable;\n stderr: z$1.ZodNullable;\n approvalStatus: z$1.ZodNullable>;\n}, z$1.core.$strip>;\ntype TimelineFileChangeWorkRow = z$1.infer;\ndeclare const timelineWebSearchWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"web-search\">;\n callId: z$1.ZodString;\n queries: z$1.ZodArray;\n completedAt: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype TimelineWebSearchWorkRow = z$1.infer;\ndeclare const timelineWebFetchWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"web-fetch\">;\n callId: z$1.ZodString;\n url: z$1.ZodString;\n prompt: z$1.ZodNullable;\n pattern: z$1.ZodNullable;\n completedAt: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype TimelineWebFetchWorkRow = z$1.infer;\ndeclare const timelineImageViewWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"image-view\">;\n callId: z$1.ZodString;\n path: z$1.ZodString;\n completedAt: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype TimelineImageViewWorkRow = z$1.infer;\ndeclare const timelineApprovalWorkRowSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"approval\">;\n interactionId: z$1.ZodString;\n target: z$1.ZodObject<{\n itemId: z$1.ZodString;\n toolName: z$1.ZodNullable;\n }, z$1.core.$strip>;\n approvalKind: z$1.ZodLiteral<\"file-edit\">;\n lifecycle: z$1.ZodEnum<{\n denied: \"denied\";\n waiting: \"waiting\";\n }>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"approval\">;\n interactionId: z$1.ZodString;\n target: z$1.ZodObject<{\n itemId: z$1.ZodString;\n toolName: z$1.ZodNullable;\n }, z$1.core.$strip>;\n approvalKind: z$1.ZodLiteral<\"permission-grant\">;\n lifecycle: z$1.ZodEnum<{\n pending: \"pending\";\n interrupted: \"interrupted\";\n denied: \"denied\";\n resolving: \"resolving\";\n granted: \"granted\";\n }>;\n grantScope: z$1.ZodNullable>;\n statusReason: z$1.ZodNullable;\n}, z$1.core.$strip>], \"approvalKind\">;\ntype TimelineApprovalWorkRow = z$1.infer;\ndeclare const timelineQuestionWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"question\">;\n interactionId: z$1.ZodString;\n lifecycle: z$1.ZodEnum<{\n pending: \"pending\";\n interrupted: \"interrupted\";\n resolving: \"resolving\";\n answered: \"answered\";\n }>;\n questions: z$1.ZodArray;\n multiSelect: z$1.ZodBoolean;\n options: z$1.ZodOptional;\n }, z$1.core.$strip>>>;\n allowFreeText: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n answers: z$1.ZodNullable;\n freeText: z$1.ZodOptional;\n }, z$1.core.$strip>>>;\n statusReason: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype TimelineQuestionWorkRow = z$1.infer;\ninterface TimelineDelegationWorkRow extends TimelineWorkRowBase {\n workKind: \"delegation\";\n callId: string;\n toolName: string;\n subagentType: string | null;\n description: string | null;\n output: string;\n completedAt: number | null;\n childRows: TimelineRow[];\n}\n/**\n * A provider background task โ€” a dynamic workflow (Claude Code Workflow tool)\n * or a backgrounded shell command (Bash run_in_background), discriminated by\n * `taskType`. The row outlives its spawning turn: progress and terminal state\n * arrive via thread-scoped events folded into this single row. `workflow` is\n * the merged phase/agent tree, present only for workflows; null for shell\n * commands and for workflows the provider reported no progress records for\n * (degraded rendering falls back to description + summary).\n */\ndeclare const timelineWorkflowWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"workflow\">;\n itemId: z$1.ZodString;\n taskType: z$1.ZodString;\n workflowName: z$1.ZodNullable;\n description: z$1.ZodString;\n taskStatus: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n running: \"running\";\n paused: \"paused\";\n failed: \"failed\";\n killed: \"killed\";\n stopped: \"stopped\";\n }>;\n workflow: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n agents: z$1.ZodArray;\n model: z$1.ZodString;\n attempt: z$1.ZodNumber;\n cached: z$1.ZodBoolean;\n lastProgressAt: z$1.ZodNumber;\n phaseIndex: z$1.ZodOptional;\n phaseTitle: z$1.ZodOptional;\n agentType: z$1.ZodOptional;\n isolation: z$1.ZodOptional;\n queuedAt: z$1.ZodOptional;\n startedAt: z$1.ZodOptional;\n lastToolName: z$1.ZodOptional;\n lastToolSummary: z$1.ZodOptional;\n promptPreview: z$1.ZodOptional;\n resultPreview: z$1.ZodOptional;\n error: z$1.ZodOptional;\n tokens: z$1.ZodOptional;\n toolCalls: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n usage: z$1.ZodNullable>;\n summary: z$1.ZodNullable;\n error: z$1.ZodNullable;\n completedAt: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype TimelineWorkflowWorkRow = z$1.infer;\ntype TimelineWorkRow = TimelineCommandWorkRow | TimelineToolWorkRow | TimelineFileChangeWorkRow | TimelineWebSearchWorkRow | TimelineWebFetchWorkRow | TimelineImageViewWorkRow | TimelineApprovalWorkRow | TimelineQuestionWorkRow | TimelineDelegationWorkRow | TimelineWorkflowWorkRow;\ninterface TimelineTurnRow extends TimelineRowBase {\n kind: \"turn\";\n turnId: string;\n status: TimelineRowStatus;\n summaryCount: number;\n completedAt: number | null;\n children: TimelineRow[] | null;\n}\ntype TimelineSourceRow = TimelineConversationRow | TimelineWorkRow | TimelineSystemRow;\ntype TimelineRow = TimelineSourceRow | TimelineTurnRow;\n\ndeclare const createThreadRequestSchema: z$1.ZodObject<{\n projectId: z$1.ZodString;\n providerId: z$1.ZodOptional;\n origin: z$1.ZodEnum<{\n plugin: \"plugin\";\n app: \"app\";\n cli: \"cli\";\n sdk: \"sdk\";\n }>;\n originPluginId: z$1.ZodOptional;\n visibility: z$1.ZodOptional>;\n title: z$1.ZodOptional;\n input: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n model: z$1.ZodOptional;\n serviceTier: z$1.ZodOptional>;\n reasoningLevel: z$1.ZodOptional>;\n permissionMode: z$1.ZodOptional, z$1.ZodLiteral<\"workspace-write\">]>, z$1.ZodTransform<\"auto\" | \"accept-edits\" | \"full\", \"auto\" | \"accept-edits\" | \"full\" | \"workspace-write\">>>;\n executionInputSources: z$1.ZodOptional>;\n model: z$1.ZodOptional>;\n serviceTier: z$1.ZodOptional>;\n reasoningLevel: z$1.ZodOptional>;\n permissionMode: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n environment: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"reuse\">;\n environmentId: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host\">;\n hostId: z$1.ZodOptional;\n workspace: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"unmanaged\">;\n path: z$1.ZodNullable;\n branch: z$1.ZodOptional;\n name: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"new\">;\n baseBranch: z$1.ZodString;\n }, z$1.core.$strict>], \"kind\">>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"managed-worktree\">;\n baseBranch: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"named\">;\n name: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"default\">;\n }, z$1.core.$strip>], \"kind\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"personal\">;\n }, z$1.core.$strip>], \"type\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"project-default\">;\n }, z$1.core.$strip>], \"type\">;\n parentThreadId: z$1.ZodOptional;\n sectionId: z$1.ZodOptional>;\n sourceThreadId: z$1.ZodOptional;\n sourceSeqEnd: z$1.ZodOptional;\n startedOnBehalfOf: z$1.ZodDefault;\n senderThreadId: z$1.ZodString;\n }, z$1.core.$strip>>>;\n originKind: z$1.ZodDefault>>;\n childOrigin: z$1.ZodDefault>>;\n}, z$1.core.$strip>;\ntype CreateThreadRequest = z$1.infer;\ndeclare const forkThreadRequestSchema: z$1.ZodObject<{\n sourceThreadId: z$1.ZodString;\n sourceSeqEnd: z$1.ZodOptional;\n input: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>>;\n agentContextSeed: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">, z$1.ZodObject<{\n visibility: z$1.ZodLiteral<\"agent-only\">;\n }, z$1.core.$strip>>>>;\n title: z$1.ZodOptional;\n permissionMode: z$1.ZodOptional, z$1.ZodLiteral<\"workspace-write\">]>, z$1.ZodTransform<\"auto\" | \"accept-edits\" | \"full\", \"auto\" | \"accept-edits\" | \"full\" | \"workspace-write\">>>;\n visibility: z$1.ZodDefault>;\n workspace: z$1.ZodDefault>;\n origin: z$1.ZodDefault>;\n originPluginId: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype ForkThreadRequest = z$1.infer;\ndeclare const sendMessageRequestSchema: z$1.ZodObject<{\n input: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n model: z$1.ZodOptional;\n serviceTier: z$1.ZodOptional>;\n reasoningLevel: z$1.ZodOptional>;\n permissionMode: z$1.ZodOptional, z$1.ZodLiteral<\"workspace-write\">]>, z$1.ZodTransform<\"auto\" | \"accept-edits\" | \"full\", \"auto\" | \"accept-edits\" | \"full\" | \"workspace-write\">>>;\n executionInputSources: z$1.ZodOptional>;\n serviceTier: z$1.ZodOptional>;\n reasoningLevel: z$1.ZodOptional>;\n permissionMode: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n mode: z$1.ZodEnum<{\n steer: \"steer\";\n start: \"start\";\n auto: \"auto\";\n \"queue-if-active\": \"queue-if-active\";\n \"steer-if-active\": \"steer-if-active\";\n }>;\n senderThreadId: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype SendMessageRequest = z$1.infer;\ndeclare const createQueuedMessageRequestSchema: z$1.ZodObject<{\n input: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n model: z$1.ZodOptional;\n serviceTier: z$1.ZodOptional>;\n reasoningLevel: z$1.ZodOptional>;\n permissionMode: z$1.ZodOptional, z$1.ZodLiteral<\"workspace-write\">]>, z$1.ZodTransform<\"auto\" | \"accept-edits\" | \"full\", \"auto\" | \"accept-edits\" | \"full\" | \"workspace-write\">>>;\n executionInputSources: z$1.ZodOptional>;\n serviceTier: z$1.ZodOptional>;\n reasoningLevel: z$1.ZodOptional>;\n permissionMode: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n senderThreadId: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype CreateQueuedMessageRequest = z$1.infer;\ndeclare const updateQueuedMessageRequestSchema: z$1.ZodObject<{\n expectedUpdatedAt: z$1.ZodNumber;\n input: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n}, z$1.core.$strip>;\ntype UpdateQueuedMessageRequest = z$1.infer;\ndeclare const sendQueuedMessageRequestSchema: z$1.ZodObject<{\n mode: z$1.ZodEnum<{\n steer: \"steer\";\n auto: \"auto\";\n }>;\n}, z$1.core.$strip>;\ntype SendQueuedMessageRequest = z$1.infer;\ndeclare const reorderQueuedMessageRequestSchema: z$1.ZodObject<{\n previousQueuedMessageId: z$1.ZodNullable;\n nextQueuedMessageId: z$1.ZodNullable;\n groupBoundaryQueuedMessageId: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype ReorderQueuedMessageRequest = z$1.infer;\ndeclare const setQueuedMessageGroupBoundaryRequestSchema: z$1.ZodObject<{\n expectedGroupedPrefixQueuedMessageIds: z$1.ZodArray;\n groupBoundaryQueuedMessageId: z$1.ZodString;\n}, z$1.core.$strip>;\ntype SetQueuedMessageGroupBoundaryRequest = z$1.infer;\ndeclare const sendQueuedMessageResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n queuedMessage: z$1.ZodObject<{\n id: z$1.ZodString;\n content: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n model: z$1.ZodString;\n reasoningLevel: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n permissionMode: z$1.ZodEnum<{\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n full: \"full\";\n }>;\n serviceTier: z$1.ZodEnum<{\n default: \"default\";\n fast: \"fast\";\n }>;\n groupWithNext: z$1.ZodBoolean;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>;\ntype SendQueuedMessageResponse = z$1.infer;\ndeclare const threadListResponseSchema: z$1.ZodArray;\n providerId: z$1.ZodString;\n title: z$1.ZodNullable;\n titleFallback: z$1.ZodNullable;\n sectionId: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n error: \"error\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n }>;\n parentThreadId: z$1.ZodNullable;\n sourceThreadId: z$1.ZodNullable;\n originKind: z$1.ZodNullable>;\n childOrigin: z$1.ZodNullable>;\n originPluginId: z$1.ZodNullable;\n visibility: z$1.ZodEnum<{\n visible: \"visible\";\n hidden: \"hidden\";\n }>;\n archivedAt: z$1.ZodNullable;\n pinnedAt: z$1.ZodNullable;\n deletedAt: z$1.ZodNullable;\n lastReadAt: z$1.ZodNullable;\n latestAttentionAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n runtime: z$1.ZodObject<{\n displayStatus: z$1.ZodEnum<{\n error: \"error\";\n provisioning: \"provisioning\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n \"host-reconnecting\": \"host-reconnecting\";\n \"waiting-for-host\": \"waiting-for-host\";\n }>;\n hostReconnectGraceExpiresAt: z$1.ZodNullable;\n }, z$1.core.$strip>;\n activity: z$1.ZodObject<{\n activeWorkflowCount: z$1.ZodNumber;\n activeBackgroundAgentCount: z$1.ZodNumber;\n activeBackgroundCommandCount: z$1.ZodNumber;\n activePlanModeCount: z$1.ZodNumber;\n activeGoalCount: z$1.ZodNumber;\n }, z$1.core.$strip>;\n pinSortKey: z$1.ZodNullable;\n hasPendingInteraction: z$1.ZodBoolean;\n environmentHostId: z$1.ZodNullable;\n environmentName: z$1.ZodNullable;\n environmentBranchName: z$1.ZodNullable;\n environmentWorkspaceDisplayKind: z$1.ZodEnum<{\n \"managed-worktree\": \"managed-worktree\";\n \"unmanaged-worktree\": \"unmanaged-worktree\";\n other: \"other\";\n }>;\n}, z$1.core.$strip>>;\ntype ThreadListResponse = z$1.infer;\ndeclare const threadSearchResponseSchema: z$1.ZodObject<{\n active: z$1.ZodObject<{\n total: z$1.ZodNumber;\n results: z$1.ZodArray;\n providerId: z$1.ZodString;\n title: z$1.ZodNullable;\n titleFallback: z$1.ZodNullable;\n sectionId: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n error: \"error\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n }>;\n parentThreadId: z$1.ZodNullable;\n sourceThreadId: z$1.ZodNullable;\n originKind: z$1.ZodNullable>;\n childOrigin: z$1.ZodNullable>;\n originPluginId: z$1.ZodNullable;\n visibility: z$1.ZodEnum<{\n visible: \"visible\";\n hidden: \"hidden\";\n }>;\n archivedAt: z$1.ZodNullable;\n pinnedAt: z$1.ZodNullable;\n deletedAt: z$1.ZodNullable;\n lastReadAt: z$1.ZodNullable;\n latestAttentionAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n runtime: z$1.ZodObject<{\n displayStatus: z$1.ZodEnum<{\n error: \"error\";\n provisioning: \"provisioning\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n \"host-reconnecting\": \"host-reconnecting\";\n \"waiting-for-host\": \"waiting-for-host\";\n }>;\n hostReconnectGraceExpiresAt: z$1.ZodNullable;\n }, z$1.core.$strip>;\n activity: z$1.ZodObject<{\n activeWorkflowCount: z$1.ZodNumber;\n activeBackgroundAgentCount: z$1.ZodNumber;\n activeBackgroundCommandCount: z$1.ZodNumber;\n activePlanModeCount: z$1.ZodNumber;\n activeGoalCount: z$1.ZodNumber;\n }, z$1.core.$strip>;\n pinSortKey: z$1.ZodNullable;\n hasPendingInteraction: z$1.ZodBoolean;\n environmentHostId: z$1.ZodNullable;\n environmentName: z$1.ZodNullable;\n environmentBranchName: z$1.ZodNullable;\n environmentWorkspaceDisplayKind: z$1.ZodEnum<{\n \"managed-worktree\": \"managed-worktree\";\n \"unmanaged-worktree\": \"unmanaged-worktree\";\n other: \"other\";\n }>;\n }, z$1.core.$strip>;\n matches: z$1.ZodArray;\n text: z$1.ZodString;\n highlightRanges: z$1.ZodArray>;\n sourceSeq: z$1.ZodNullable;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>;\n archived: z$1.ZodObject<{\n total: z$1.ZodNumber;\n results: z$1.ZodArray;\n providerId: z$1.ZodString;\n title: z$1.ZodNullable;\n titleFallback: z$1.ZodNullable;\n sectionId: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n error: \"error\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n }>;\n parentThreadId: z$1.ZodNullable;\n sourceThreadId: z$1.ZodNullable;\n originKind: z$1.ZodNullable>;\n childOrigin: z$1.ZodNullable>;\n originPluginId: z$1.ZodNullable;\n visibility: z$1.ZodEnum<{\n visible: \"visible\";\n hidden: \"hidden\";\n }>;\n archivedAt: z$1.ZodNullable;\n pinnedAt: z$1.ZodNullable;\n deletedAt: z$1.ZodNullable;\n lastReadAt: z$1.ZodNullable;\n latestAttentionAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n runtime: z$1.ZodObject<{\n displayStatus: z$1.ZodEnum<{\n error: \"error\";\n provisioning: \"provisioning\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n \"host-reconnecting\": \"host-reconnecting\";\n \"waiting-for-host\": \"waiting-for-host\";\n }>;\n hostReconnectGraceExpiresAt: z$1.ZodNullable;\n }, z$1.core.$strip>;\n activity: z$1.ZodObject<{\n activeWorkflowCount: z$1.ZodNumber;\n activeBackgroundAgentCount: z$1.ZodNumber;\n activeBackgroundCommandCount: z$1.ZodNumber;\n activePlanModeCount: z$1.ZodNumber;\n activeGoalCount: z$1.ZodNumber;\n }, z$1.core.$strip>;\n pinSortKey: z$1.ZodNullable;\n hasPendingInteraction: z$1.ZodBoolean;\n environmentHostId: z$1.ZodNullable;\n environmentName: z$1.ZodNullable;\n environmentBranchName: z$1.ZodNullable;\n environmentWorkspaceDisplayKind: z$1.ZodEnum<{\n \"managed-worktree\": \"managed-worktree\";\n \"unmanaged-worktree\": \"unmanaged-worktree\";\n other: \"other\";\n }>;\n }, z$1.core.$strip>;\n matches: z$1.ZodArray;\n text: z$1.ZodString;\n highlightRanges: z$1.ZodArray>;\n sourceSeq: z$1.ZodNullable;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>;\n}, z$1.core.$strict>;\ntype ThreadSearchResponse = z$1.infer;\ndeclare const threadResponseSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n projectId: z$1.ZodString;\n environmentId: z$1.ZodNullable;\n providerId: z$1.ZodString;\n title: z$1.ZodNullable;\n titleFallback: z$1.ZodNullable;\n sectionId: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n error: \"error\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n }>;\n parentThreadId: z$1.ZodNullable;\n sourceThreadId: z$1.ZodNullable;\n originKind: z$1.ZodNullable>;\n childOrigin: z$1.ZodNullable>;\n originPluginId: z$1.ZodNullable;\n visibility: z$1.ZodEnum<{\n visible: \"visible\";\n hidden: \"hidden\";\n }>;\n archivedAt: z$1.ZodNullable;\n pinnedAt: z$1.ZodNullable;\n deletedAt: z$1.ZodNullable;\n lastReadAt: z$1.ZodNullable;\n latestAttentionAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n runtime: z$1.ZodObject<{\n displayStatus: z$1.ZodEnum<{\n error: \"error\";\n provisioning: \"provisioning\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n \"host-reconnecting\": \"host-reconnecting\";\n \"waiting-for-host\": \"waiting-for-host\";\n }>;\n hostReconnectGraceExpiresAt: z$1.ZodNullable;\n }, z$1.core.$strip>;\n canSpawnChild: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype ThreadResponse = z$1.infer;\ndeclare const threadGetQuerySchema: z$1.ZodObject<{\n include: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype ThreadGetQuery = z$1.infer;\ndeclare const threadWithIncludesResponseSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n projectId: z$1.ZodString;\n environmentId: z$1.ZodNullable;\n providerId: z$1.ZodString;\n title: z$1.ZodNullable;\n titleFallback: z$1.ZodNullable;\n sectionId: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n error: \"error\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n }>;\n parentThreadId: z$1.ZodNullable;\n sourceThreadId: z$1.ZodNullable;\n originKind: z$1.ZodNullable>;\n childOrigin: z$1.ZodNullable>;\n originPluginId: z$1.ZodNullable;\n visibility: z$1.ZodEnum<{\n visible: \"visible\";\n hidden: \"hidden\";\n }>;\n archivedAt: z$1.ZodNullable;\n pinnedAt: z$1.ZodNullable;\n deletedAt: z$1.ZodNullable;\n lastReadAt: z$1.ZodNullable;\n latestAttentionAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n runtime: z$1.ZodObject<{\n displayStatus: z$1.ZodEnum<{\n error: \"error\";\n provisioning: \"provisioning\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n \"host-reconnecting\": \"host-reconnecting\";\n \"waiting-for-host\": \"waiting-for-host\";\n }>;\n hostReconnectGraceExpiresAt: z$1.ZodNullable;\n }, z$1.core.$strip>;\n canSpawnChild: z$1.ZodBoolean;\n environment: z$1.ZodOptional;\n projectId: z$1.ZodString;\n hostId: z$1.ZodString;\n path: z$1.ZodNullable;\n managed: z$1.ZodBoolean;\n isGitRepo: z$1.ZodBoolean;\n isWorktree: z$1.ZodBoolean;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n branchName: z$1.ZodNullable;\n baseBranch: z$1.ZodNullable;\n defaultBranch: z$1.ZodNullable;\n mergeBaseBranch: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n error: \"error\";\n provisioning: \"provisioning\";\n ready: \"ready\";\n retiring: \"retiring\";\n destroying: \"destroying\";\n destroyed: \"destroyed\";\n }>;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n }, z$1.core.$strip>>>;\n host: z$1.ZodOptional;\n status: z$1.ZodEnum<{\n disconnected: \"disconnected\";\n connected: \"connected\";\n }>;\n lastSeenAt: z$1.ZodNullable;\n lastRejectedProtocolVersion: z$1.ZodNullable;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n }, z$1.core.$strip>>>;\n}, z$1.core.$strip>;\ntype ThreadWithIncludesResponse = z$1.infer;\ndeclare const threadPendingInteractionsResponseSchema: z$1.ZodArray;\n statusReason: z$1.ZodNullable;\n createdAt: z$1.ZodNumber;\n expiresAt: z$1.ZodOptional>;\n resolvedAt: z$1.ZodNullable;\n turnId: z$1.ZodString;\n providerId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n providerRequestId: z$1.ZodString;\n origin: z$1.ZodOptional;\n providerId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n providerRequestId: z$1.ZodString;\n }, z$1.core.$strip>>;\n payload: z$1.ZodUnion;\n subject: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n itemId: z$1.ZodString;\n command: z$1.ZodString;\n cwd: z$1.ZodNullable;\n actions: z$1.ZodArray;\n command: z$1.ZodString;\n name: z$1.ZodString;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"listFiles\">;\n command: z$1.ZodString;\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"search\">;\n command: z$1.ZodString;\n query: z$1.ZodNullable;\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"unknown\">;\n command: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">>;\n sessionGrant: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"file_change\">;\n itemId: z$1.ZodString;\n writeScope: z$1.ZodNullable;\n sessionGrant: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"permission_grant\">;\n itemId: z$1.ZodString;\n toolName: z$1.ZodNullable;\n permissions: z$1.ZodObject<{\n network: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>;\n }, z$1.core.$strip>], \"kind\">;\n reason: z$1.ZodNullable;\n availableDecisions: z$1.ZodArray>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"user_question\">;\n questions: z$1.ZodArray;\n multiSelect: z$1.ZodBoolean;\n options: z$1.ZodOptional;\n }, z$1.core.$strip>>>;\n allowFreeText: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>]>;\n resolution: z$1.ZodNullable;\n grantedPermissions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"allow_for_session\">;\n grantedPermissions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"deny\">;\n }, z$1.core.$strip>], \"decision\">, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"user_answer\">;\n answers: z$1.ZodRecord;\n freeText: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>]>>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n interrupted: \"interrupted\";\n resolving: \"resolving\";\n resolved: \"resolved\";\n }>;\n statusReason: z$1.ZodNullable;\n createdAt: z$1.ZodNumber;\n expiresAt: z$1.ZodOptional>;\n resolvedAt: z$1.ZodNullable;\n turnId: z$1.ZodNullable;\n origin: z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n rendererId: z$1.ZodString;\n }, z$1.core.$strip>;\n payload: z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n title: z$1.ZodString;\n data: z$1.ZodType>;\n }, z$1.core.$strip>;\n resolution: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>]>>;\ntype ThreadPendingInteractionsResponse = z$1.infer;\ndeclare const threadQueuedMessageListResponseSchema: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n model: z$1.ZodString;\n reasoningLevel: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n permissionMode: z$1.ZodEnum<{\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n full: \"full\";\n }>;\n serviceTier: z$1.ZodEnum<{\n default: \"default\";\n fast: \"fast\";\n }>;\n groupWithNext: z$1.ZodBoolean;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n}, z$1.core.$strip>>;\ntype ThreadQueuedMessageListResponse = z$1.infer;\ndeclare const threadChildSummaryResponseSchema: z$1.ZodObject<{\n nonDeletedChildCount: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype ThreadChildSummaryResponse = z$1.infer;\ndeclare const deleteThreadRequestSchema: z$1.ZodObject<{\n childThreadsConfirmed: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype DeleteThreadRequest = z$1.infer;\ndeclare const updateThreadRequestSchema: z$1.ZodObject<{\n title: z$1.ZodOptional>;\n sectionId: z$1.ZodOptional>;\n parentThreadId: z$1.ZodOptional>;\n model: z$1.ZodOptional>;\n reasoningLevel: z$1.ZodOptional>>;\n visibility: z$1.ZodOptional>;\n}, z$1.core.$strip>;\ntype UpdateThreadRequest = z$1.infer;\ndeclare const reorderPinnedThreadRequestSchema: z$1.ZodObject<{\n previousThreadId: z$1.ZodNullable;\n nextThreadId: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype ReorderPinnedThreadRequest = z$1.infer;\n/**\n * Requested placement for a thread opened in the app's split layout. Edge\n * placements add panes through the eighth pane; at the cap they replace the\n * focused pane. `replace` always replaces the focused pane.\n */\ndeclare const threadOpenSplitSchema: z$1.ZodEnum<{\n right: \"right\";\n down: \"down\";\n left: \"left\";\n top: \"top\";\n replace: \"replace\";\n}>;\ntype ThreadOpenSplit = z$1.infer;\n/** Optional secondary-panel file to open with a thread. */\ndeclare const threadOpenFileSchema: z$1.ZodObject<{\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n path: z$1.ZodString;\n lineNumber: z$1.ZodNullable;\n}, z$1.core.$strict>;\ntype ThreadOpenFile = z$1.infer;\n/** Response for POST /threads/:id/open: how many connected clients received it. */\ndeclare const threadOpenResponseSchema: z$1.ZodObject<{\n delivered: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype ThreadOpenResponse = z$1.infer;\n/** Presentation action for one thread pane in each connected app window. */\ndeclare const threadPaneActionSchema: z$1.ZodEnum<{\n maximize: \"maximize\";\n restore: \"restore\";\n toggle: \"toggle\";\n}>;\ntype ThreadPaneAction = z$1.infer;\n/** Number of connected app clients that received the pane action. */\ndeclare const threadPaneActionResponseSchema: z$1.ZodObject<{\n delivered: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype ThreadPaneActionResponse = z$1.infer;\ndeclare const threadArchiveAllResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n archivedThreadIds: z$1.ZodArray;\n}, z$1.core.$strip>;\ntype ThreadArchiveAllResponse = z$1.infer;\ndeclare const threadListQuerySchema: z$1.ZodObject<{\n projectId: z$1.ZodOptional;\n parentThreadId: z$1.ZodOptional;\n sourceThreadId: z$1.ZodOptional;\n archived: z$1.ZodOptional>;\n sectionId: z$1.ZodOptional;\n unsectioned: z$1.ZodOptional>;\n hasParent: z$1.ZodOptional>;\n originKind: z$1.ZodOptional>;\n excludeSideChats: z$1.ZodOptional>;\n childOrigin: z$1.ZodOptional>;\n includeHidden: z$1.ZodOptional>;\n limit: z$1.ZodOptional;\n offset: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype ThreadListQuery = z$1.infer;\ndeclare const threadSearchQuerySchema: z$1.ZodObject<{\n query: z$1.ZodString;\n limitPerGroup: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype ThreadSearchQuery = z$1.infer;\ndeclare const threadTimelineQuerySchema: z$1.ZodObject<{\n includeNestedRows: z$1.ZodOptional>;\n segmentLimit: z$1.ZodOptional;\n beforeAnchorSeq: z$1.ZodOptional;\n beforeAnchorId: z$1.ZodOptional;\n summaryOnly: z$1.ZodOptional>;\n afterSequence: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype ThreadTimelineQuery = z$1.infer;\ndeclare const timelineTurnSummaryDetailsQuerySchema: z$1.ZodObject<{\n turnId: z$1.ZodString;\n sourceSeqStart: z$1.ZodString;\n sourceSeqEnd: z$1.ZodString;\n}, z$1.core.$strip>;\ntype TimelineTurnSummaryDetailsQuery = z$1.infer;\ndeclare const threadStorageFilesQuerySchema: z$1.ZodObject<{\n query: z$1.ZodOptional;\n limit: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype ThreadStorageFilesQuery = z$1.infer;\ndeclare const threadStoragePathsQuerySchema: z$1.ZodObject<{\n query: z$1.ZodOptional;\n limit: z$1.ZodOptional;\n includeFiles: z$1.ZodEnum<{\n true: \"true\";\n false: \"false\";\n }>;\n includeDirectories: z$1.ZodEnum<{\n true: \"true\";\n false: \"false\";\n }>;\n}, z$1.core.$strip>;\ntype ThreadStoragePathsQuery = z$1.infer;\ndeclare const timelineTurnSummaryDetailsResponseSchema: z$1.ZodObject<{\n rows: z$1.ZodArray>>;\n}, z$1.core.$strip>;\ntype TimelineTurnSummaryDetailsResponse = z$1.infer;\ndeclare const threadTimelineResponseSchema: z$1.ZodObject<{\n rows: z$1.ZodArray>>;\n activePromptMode: z$1.ZodNullable;\n providerId: z$1.ZodEnum<{\n \"claude-code\": \"claude-code\";\n codex: \"codex\";\n }>;\n prompt: z$1.ZodString;\n }, z$1.core.$strict>>;\n activeThinking: z$1.ZodNullable>;\n activeWorkflows: z$1.ZodArray;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"workflow\">;\n itemId: z$1.ZodString;\n taskType: z$1.ZodString;\n workflowName: z$1.ZodNullable;\n description: z$1.ZodString;\n taskStatus: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n running: \"running\";\n paused: \"paused\";\n failed: \"failed\";\n killed: \"killed\";\n stopped: \"stopped\";\n }>;\n workflow: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n agents: z$1.ZodArray;\n model: z$1.ZodString;\n attempt: z$1.ZodNumber;\n cached: z$1.ZodBoolean;\n lastProgressAt: z$1.ZodNumber;\n phaseIndex: z$1.ZodOptional;\n phaseTitle: z$1.ZodOptional;\n agentType: z$1.ZodOptional;\n isolation: z$1.ZodOptional;\n queuedAt: z$1.ZodOptional;\n startedAt: z$1.ZodOptional;\n lastToolName: z$1.ZodOptional;\n lastToolSummary: z$1.ZodOptional;\n promptPreview: z$1.ZodOptional;\n resultPreview: z$1.ZodOptional;\n error: z$1.ZodOptional;\n tokens: z$1.ZodOptional;\n toolCalls: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n usage: z$1.ZodNullable>;\n summary: z$1.ZodNullable;\n error: z$1.ZodNullable;\n completedAt: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n activeBackgroundCommands: z$1.ZodArray;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"workflow\">;\n itemId: z$1.ZodString;\n taskType: z$1.ZodString;\n workflowName: z$1.ZodNullable;\n description: z$1.ZodString;\n taskStatus: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n running: \"running\";\n paused: \"paused\";\n failed: \"failed\";\n killed: \"killed\";\n stopped: \"stopped\";\n }>;\n workflow: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n agents: z$1.ZodArray;\n model: z$1.ZodString;\n attempt: z$1.ZodNumber;\n cached: z$1.ZodBoolean;\n lastProgressAt: z$1.ZodNumber;\n phaseIndex: z$1.ZodOptional;\n phaseTitle: z$1.ZodOptional;\n agentType: z$1.ZodOptional;\n isolation: z$1.ZodOptional;\n queuedAt: z$1.ZodOptional;\n startedAt: z$1.ZodOptional;\n lastToolName: z$1.ZodOptional;\n lastToolSummary: z$1.ZodOptional;\n promptPreview: z$1.ZodOptional;\n resultPreview: z$1.ZodOptional;\n error: z$1.ZodOptional;\n tokens: z$1.ZodOptional;\n toolCalls: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n usage: z$1.ZodNullable>;\n summary: z$1.ZodNullable;\n error: z$1.ZodNullable;\n completedAt: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n pendingTodos: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n goal: z$1.ZodNullable;\n tokenBudget: z$1.ZodNullable;\n tokensUsed: z$1.ZodNumber;\n timeUsedSeconds: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n modelFallback: z$1.ZodNullable;\n message: z$1.ZodString;\n }, z$1.core.$strip>>;\n contextWindowUsage: z$1.ZodOptional>;\n timelinePage: z$1.ZodObject<{\n kind: z$1.ZodEnum<{\n latest: \"latest\";\n older: \"older\";\n }>;\n segmentLimit: z$1.ZodNumber;\n returnedSegmentCount: z$1.ZodNumber;\n hasOlderRows: z$1.ZodBoolean;\n olderCursor: z$1.ZodNullable>;\n }, z$1.core.$strict>;\n maxSeq: z$1.ZodNumber;\n delta: z$1.ZodOptional>>;\n rowOrder: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype ThreadTimelineResponse = z$1.infer;\ndeclare const threadConversationOutlineResponseSchema: z$1.ZodObject<{\n items: z$1.ZodArray;\n preview: z$1.ZodString;\n attachmentSummary: z$1.ZodNullable>;\n }, z$1.core.$strict>>;\n maxSeq: z$1.ZodNumber;\n}, z$1.core.$strict>;\ntype ThreadConversationOutlineResponse = z$1.infer;\ndeclare const threadStorageFileListResponseSchema: z$1.ZodObject<{\n files: z$1.ZodArray>;\n truncated: z$1.ZodBoolean;\n storageRootPath: z$1.ZodString;\n}, z$1.core.$strip>;\ntype ThreadStorageFileListResponse = z$1.infer;\ndeclare const threadStoragePathListResponseSchema: z$1.ZodObject<{\n paths: z$1.ZodArray;\n path: z$1.ZodString;\n name: z$1.ZodString;\n score: z$1.ZodNumber;\n positions: z$1.ZodArray;\n }, z$1.core.$strip>>;\n truncated: z$1.ZodBoolean;\n storageRootPath: z$1.ZodString;\n}, z$1.core.$strip>;\ntype ThreadStoragePathListResponse = z$1.infer;\n\ndeclare const threadTabsResponseSchema: z$1.ZodObject<{\n revision: z$1.ZodNumber;\n tabs: z$1.ZodArray;\n }, z$1.core.$strict>, z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"git-diff\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n actionId: z$1.ZodString;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"plugin-panel\">;\n paramsJson: z$1.ZodNullable;\n pluginId: z$1.ZodString;\n title: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"workspace-file-preview\">;\n lineRange: z$1.ZodNullable>;\n path: z$1.ZodString;\n projectId: z$1.ZodNullable;\n source: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"working-tree\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"head\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"merge-base\">;\n ref: z$1.ZodString;\n }, z$1.core.$strict>], \"kind\">;\n statusLabel: z$1.ZodNullable>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"host-file-preview\">;\n lineRange: z$1.ZodNullable>;\n path: z$1.ZodString;\n threadId: z$1.ZodNullable;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable;\n id: z$1.ZodString;\n isPinned: z$1.ZodBoolean;\n kind: z$1.ZodLiteral<\"thread-storage-file-preview\">;\n lineRange: z$1.ZodNullable>;\n path: z$1.ZodString;\n threadId: z$1.ZodNullable;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"browser\">;\n title: z$1.ZodNullable;\n url: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"new-tab\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"side-chat\">;\n sourceMessageText: z$1.ZodString;\n sourceSeqEnd: z$1.ZodNullable;\n threadId: z$1.ZodNullable;\n title: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"terminal\">;\n terminalId: z$1.ZodString;\n }, z$1.core.$strict>], \"kind\">>;\n}, z$1.core.$strict>;\ntype ThreadTabsResponse = z$1.infer;\ndeclare const updateThreadTabsRequestSchema: z$1.ZodObject<{\n expectedRevision: z$1.ZodNumber;\n tabs: z$1.ZodArray;\n }, z$1.core.$strict>, z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"git-diff\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n actionId: z$1.ZodString;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"plugin-panel\">;\n paramsJson: z$1.ZodNullable;\n pluginId: z$1.ZodString;\n title: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"workspace-file-preview\">;\n lineRange: z$1.ZodNullable>;\n path: z$1.ZodString;\n projectId: z$1.ZodNullable;\n source: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"working-tree\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"head\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"merge-base\">;\n ref: z$1.ZodString;\n }, z$1.core.$strict>], \"kind\">;\n statusLabel: z$1.ZodNullable>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"host-file-preview\">;\n lineRange: z$1.ZodNullable>;\n path: z$1.ZodString;\n threadId: z$1.ZodNullable;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable;\n id: z$1.ZodString;\n isPinned: z$1.ZodBoolean;\n kind: z$1.ZodLiteral<\"thread-storage-file-preview\">;\n lineRange: z$1.ZodNullable>;\n path: z$1.ZodString;\n threadId: z$1.ZodNullable;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"browser\">;\n title: z$1.ZodNullable;\n url: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"new-tab\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"side-chat\">;\n sourceMessageText: z$1.ZodString;\n sourceSeqEnd: z$1.ZodNullable;\n threadId: z$1.ZodNullable;\n title: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"terminal\">;\n terminalId: z$1.ZodString;\n }, z$1.core.$strict>], \"kind\">>;\n}, z$1.core.$strict>;\ntype UpdateThreadTabsRequest = z$1.infer;\n\ninterface EnvironmentActionArgs {\n environmentId: string;\n}\ninterface EnvironmentGetArgs extends EnvironmentActionArgs {\n signal?: AbortSignal;\n}\ntype EnvironmentMergeBaseBranchUpdateValue = Exclude;\ntype EnvironmentNameUpdateValue = Exclude;\ninterface EnvironmentMergeBaseBranchUpdate {\n mergeBaseBranch: EnvironmentMergeBaseBranchUpdateValue;\n name?: EnvironmentNameUpdateValue;\n}\ninterface EnvironmentNameUpdate {\n mergeBaseBranch?: EnvironmentMergeBaseBranchUpdateValue;\n name: EnvironmentNameUpdateValue;\n}\ntype EnvironmentUpdateFields = EnvironmentMergeBaseBranchUpdate | EnvironmentNameUpdate;\ntype EnvironmentUpdateArgs = EnvironmentUpdateFields & {\n environmentId: string;\n};\ninterface EnvironmentStatusArgs extends EnvironmentStatusQuery {\n environmentId: string;\n signal?: AbortSignal;\n}\ntype EnvironmentDiffArgs = EnvironmentDiffQuery & {\n environmentId: string;\n signal?: AbortSignal;\n};\ntype EnvironmentDiffFileArgs = EnvironmentDiffFileQuery & {\n environmentId: string;\n signal?: AbortSignal;\n};\ninterface EnvironmentDiffBranchesArgs extends EnvironmentDiffBranchesQuery {\n environmentId: string;\n signal?: AbortSignal;\n}\ninterface EnvironmentCommitArgs {\n environmentId: string;\n}\ninterface EnvironmentSquashMergeArgs {\n environmentId: string;\n mergeBaseBranch: string;\n}\ninterface EnvironmentPullRequestMergeArgs {\n environmentId: string;\n method: PullRequestMergeMethod;\n}\ntype EnvironmentDiffPatchArgs = EnvironmentDiffPatchRequest & {\n environmentId: string;\n signal?: AbortSignal;\n};\ninterface EnvironmentPathsArgs extends EnvironmentPathsQuery {\n environmentId: string;\n signal?: AbortSignal;\n}\ntype EnvironmentArchiveThreadsResult = EnvironmentArchiveThreadsResponse;\ntype EnvironmentCommitResult = CommitActionResponse;\ntype EnvironmentDiffResult = EnvironmentDiffResponse;\ntype EnvironmentDiffBranchesResult = EnvironmentDiffBranchesResponse;\ntype EnvironmentDiffFileResult = EnvironmentDiffFileResponse;\ntype EnvironmentDiffFilesResult = EnvironmentDiffFilesResponse;\ntype EnvironmentDiffPatchResult = EnvironmentDiffPatchResponse;\ntype EnvironmentGetResult = Environment;\ntype EnvironmentMarkPullRequestDraftResult = PullRequestDraftActionResponse;\ntype EnvironmentMarkPullRequestReadyResult = PullRequestReadyActionResponse;\ntype EnvironmentMergePullRequestResult = PullRequestMergeActionResponse;\ntype EnvironmentPathsResult = WorkspacePathListResponse;\ntype EnvironmentPullRequestResult = EnvironmentPullRequestResponse;\ntype EnvironmentSquashMergeResult = SquashMergeActionResponse;\ntype EnvironmentStatusResult = EnvironmentStatusResponse;\ntype EnvironmentUpdateResult = Environment;\ninterface EnvironmentsArea {\n archiveThreads(args: EnvironmentActionArgs): Promise;\n commit(args: EnvironmentCommitArgs): Promise;\n diff(args: EnvironmentDiffArgs): Promise;\n diffBranches(args: EnvironmentDiffBranchesArgs): Promise;\n diffFile(args: EnvironmentDiffFileArgs): Promise;\n diffFiles(args: EnvironmentDiffArgs): Promise;\n diffPatch(args: EnvironmentDiffPatchArgs): Promise;\n get(args: EnvironmentGetArgs): Promise;\n pullRequest(args: EnvironmentGetArgs): Promise;\n markPullRequestDraft(args: EnvironmentActionArgs): Promise;\n markPullRequestReady(args: EnvironmentActionArgs): Promise;\n mergePullRequest(args: EnvironmentPullRequestMergeArgs): Promise;\n paths(args: EnvironmentPathsArgs): Promise;\n squashMerge(args: EnvironmentSquashMergeArgs): Promise;\n status(args: EnvironmentStatusArgs): Promise;\n update(args: EnvironmentUpdateArgs): Promise;\n}\n\n/**\n * Host file primitives. `hostId` may be omitted to target the server's\n * primary (local) host. `rootPath`, when set, confines the target beneath\n * that absolute root on the host (symlink-safe).\n */\ninterface FileReadArgs {\n hostId?: string;\n path: string;\n rootPath?: string;\n signal?: AbortSignal;\n}\ninterface FileWriteArgs {\n hostId?: string;\n path: string;\n rootPath?: string;\n content: string;\n /** Defaults to \"utf8\". */\n contentEncoding?: \"utf8\" | \"base64\";\n /** Defaults to false. */\n createParents?: boolean;\n /**\n * Optimistic-concurrency guard: omitted โ†’ unconditional write; a hash โ†’\n * write only when the current content hashes to it (use `read().sha256`);\n * null โ†’ create-only. A failed guard resolves to the `conflict` outcome.\n */\n expectedSha256?: string | null;\n /** POSIX permission bits used when creating a file (for example 0o600). */\n mode?: number;\n}\ninterface FileListArgs {\n hostId?: string;\n path: string;\n query?: string;\n limit?: number;\n signal?: AbortSignal;\n}\ninterface PathListArgs extends FileListArgs {\n includeFiles: boolean;\n includeDirectories: boolean;\n}\ninterface FileMkdirArgs {\n hostId?: string;\n path: string;\n rootPath?: string;\n recursive?: boolean;\n}\ninterface FileMoveArgs {\n hostId?: string;\n sourcePath: string;\n destinationPath: string;\n rootPath?: string;\n}\ninterface FileRemoveArgs {\n hostId?: string;\n path: string;\n rootPath?: string;\n recursive?: boolean;\n}\ninterface FilePreviewArgs {\n hostId?: string;\n rootPath: string;\n signal?: AbortSignal;\n ttlMs?: number;\n}\ntype FileReadResult = HostFileReadResponse;\ntype FileWriteResult = HostFileWriteResponse;\ntype FileListResult = HostFileListResponse;\ntype PathListResult = HostPathListResponse;\ntype FileMkdirResult = HostMkdirResponse;\ntype FileMoveResult = HostMovePathResponse;\ntype FileRemoveResult = HostRemovePathResponse;\ntype FilePreviewResult = CreateFilePreviewResponse;\ninterface FilesArea {\n read(args: FileReadArgs): Promise;\n write(args: FileWriteArgs): Promise;\n list(args: FileListArgs): Promise;\n listPaths(args: PathListArgs): Promise;\n mkdir(args: FileMkdirArgs): Promise;\n move(args: FileMoveArgs): Promise;\n remove(args: FileRemoveArgs): Promise;\n createPreview(args: FilePreviewArgs): Promise;\n}\n\ninterface GuideRenderArgs {\n chapter?: string;\n}\ninterface GuideRenderResult {\n chapter?: string;\n content: string;\n}\ninterface GuideArea {\n render(args?: GuideRenderArgs): GuideRenderResult;\n}\n\ninterface HostGetArgs {\n hostId: string;\n signal?: AbortSignal;\n}\ninterface HostDeleteArgs {\n hostId: string;\n}\ninterface HostUpdateArgs extends UpdateHostRequest {\n hostId: string;\n}\ninterface HostRetryUpdateArgs {\n hostId: string;\n}\ninterface HostDirectoryArgs extends HostDirectoryQuery {\n hostId: string;\n signal?: AbortSignal;\n}\ninterface HostCloneDefaultPathArgs extends HostCloneDefaultPathQuery {\n hostId: string;\n signal?: AbortSignal;\n}\ninterface HostPathsExistArgs extends HostPathsExistRequest {\n hostId: string;\n signal?: AbortSignal;\n}\ninterface HostPickFolderArgs extends HostPickFolderRequest {\n hostId: string;\n signal?: AbortSignal;\n}\ninterface HostProviderCliInstallArgs extends HostProviderCliInstallRequest {\n hostId: string;\n}\ninterface HostListArgs {\n signal?: AbortSignal;\n}\ntype HostCreateJoinCodeResult = CreateHostJoinCodeResponse;\ntype HostDeleteResult = {\n ok: true;\n};\ntype HostDirectoryResult = HostDirectoryListing;\ntype HostGetResult = Host;\ntype HostCloneDefaultPathResult = HostCloneDefaultPathResponse;\ntype HostProviderCliInstallResult = HostProviderCliInstallEvent[];\ntype HostListResult = Host[];\ntype HostPathsExistResult = HostPathsExistResponse;\ntype HostPickFolderResult = HostPickFolderResponse;\ntype HostProviderCliStatusResult = HostProviderCliStatusResponse;\ntype HostRetryUpdateResult = HostRetryUpdateResponse;\ntype HostUpdateResult = Host;\ninterface HostsArea {\n createJoinCode(): Promise;\n delete(args: HostDeleteArgs): Promise;\n directory(args: HostDirectoryArgs): Promise;\n get(args: HostGetArgs): Promise;\n cloneDefaultPath(args: HostCloneDefaultPathArgs): Promise;\n installProviderCli(args: HostProviderCliInstallArgs): Promise;\n list(args?: HostListArgs): Promise;\n pathsExist(args: HostPathsExistArgs): Promise;\n pickFolder(args: HostPickFolderArgs): Promise;\n providerCliStatus(args: HostGetArgs): Promise;\n retryUpdate(args: HostRetryUpdateArgs): Promise;\n update(args: HostUpdateArgs): Promise;\n}\n\ninterface ProjectListArgs {\n include?: ProjectListQuery[\"include\"];\n /** Include the singleton personal project. Defaults to false for compatibility. */\n includePersonal?: boolean;\n signal?: AbortSignal;\n}\ninterface ProjectCreateArgs extends CreateProjectRequest {\n}\ninterface ProjectGetArgs {\n projectId: string;\n signal?: AbortSignal;\n}\ninterface ProjectUpdateArgs extends UpdateProjectRequest {\n projectId: string;\n}\ninterface ProjectDeleteArgs {\n projectId: string;\n}\ninterface ProjectReorderArgs extends ReorderProjectRequest {\n projectId: string;\n}\ninterface ProjectPromptHistoryArgs extends PromptHistoryQuery {\n projectId: string;\n signal?: AbortSignal;\n}\n/** Select one project workspace source, or omit both for the primary host. */\ntype ProjectWorkspaceRoutingArgs = {\n environmentId: string;\n hostId?: never;\n} | {\n environmentId?: never;\n hostId: string;\n} | {\n environmentId?: never;\n hostId?: never;\n};\ntype ProjectFilesArgs = ProjectWorkspaceRoutingArgs & Omit & {\n projectId: string;\n signal?: AbortSignal;\n};\ntype ProjectPathsArgs = ProjectWorkspaceRoutingArgs & Omit & {\n projectId: string;\n signal?: AbortSignal;\n};\ntype ProjectCommandsArgs = ProjectWorkspaceRoutingArgs & Omit & {\n projectId: string;\n signal?: AbortSignal;\n};\ntype ProjectFileContentArgs = ProjectWorkspaceRoutingArgs & Omit & {\n projectId: string;\n signal?: AbortSignal;\n};\ninterface ProjectBranchesArgs extends ProjectBranchesQuery {\n projectId: string;\n signal?: AbortSignal;\n}\ninterface ProjectDefaultExecutionOptionsArgs {\n projectId: string;\n signal?: AbortSignal;\n}\ninterface ProjectAttachmentFileLike {\n arrayBuffer(): Promise;\n readonly name: string;\n readonly type?: string;\n}\ninterface ProjectAttachmentUploadArgsBase {\n /** MIME override. Omit to use the File/Blob type, when available. */\n mimeType?: string;\n projectId: string;\n}\n/**\n * Upload bytes owned by this SDK client. A bare Blob/byte buffer needs an\n * explicit filename; File-like values can supply their own name.\n */\ntype ProjectAttachmentUploadArgs = ProjectAttachmentUploadArgsBase & ({\n clientFile: ProjectAttachmentFileLike;\n filename?: string;\n} | {\n clientFile: ArrayBuffer | Blob | Uint8Array;\n filename: string;\n});\ninterface ProjectAttachmentReadArgs {\n path: string;\n projectId: string;\n signal?: AbortSignal;\n}\ninterface ProjectAttachmentCopyArgs extends CopyProjectAttachmentsRequest {\n projectId: string;\n}\ntype ProjectSourceAddArgs = CreateProjectSourceRequest & {\n projectId: string;\n};\ninterface ProjectSourceUpdateArgs extends UpdateProjectSourceRequest {\n projectId: string;\n sourceId: string;\n}\ninterface ProjectSourceDeleteArgs {\n projectId: string;\n sourceId: string;\n}\ntype ProjectBranchesResult = ProjectBranchesResponse;\ninterface ProjectAttachmentReadResult {\n bytes: Uint8Array;\n mimeType: string;\n sizeBytes: number;\n}\ntype ProjectAttachmentUploadResult = UploadedPromptAttachment;\ntype ProjectCommandsResult = CommandListResponse;\ntype ProjectCreateResult = ProjectResponse;\ntype ProjectDefaultExecutionOptionsResult = ProjectExecutionDefaults | null;\ntype ProjectDeleteResult = {\n ok: true;\n};\ninterface ProjectFileContentResult {\n /** UTF-8 text or base64, as selected by `contentEncoding`. */\n content: string;\n contentEncoding: \"utf8\" | \"base64\";\n mimeType: string;\n sizeBytes: number;\n}\ntype ProjectFilesResult = WorkspaceFileListResponse;\ntype ProjectGetResult = ProjectResponse;\ntype ProjectListResult = ProjectResponse[] | ProjectWithThreadsResponse[];\ntype ProjectPathsResult = WorkspacePathListResponse;\ntype ProjectPromptHistoryResult = PromptHistoryResponse;\ntype ProjectReorderResult = ProjectResponse[];\ntype ProjectSourceAddResult = ProjectSource;\ntype ProjectSourceDeleteResult = {\n ok: true;\n};\ntype ProjectSourceUpdateResult = ProjectSource;\ntype ProjectUpdateResult = ProjectResponse;\ninterface ProjectSourcesArea {\n add(args: ProjectSourceAddArgs): Promise;\n delete(args: ProjectSourceDeleteArgs): Promise;\n update(args: ProjectSourceUpdateArgs): Promise;\n}\ninterface ProjectAttachmentsArea {\n copy(args: ProjectAttachmentCopyArgs): Promise;\n read(args: ProjectAttachmentReadArgs): Promise;\n upload(args: ProjectAttachmentUploadArgs): Promise;\n}\ninterface ProjectsArea {\n attachments: ProjectAttachmentsArea;\n branches(args: ProjectBranchesArgs): Promise;\n commands(args: ProjectCommandsArgs): Promise;\n create(args: ProjectCreateArgs): Promise;\n defaultExecutionOptions(args: ProjectDefaultExecutionOptionsArgs): Promise;\n delete(args: ProjectDeleteArgs): Promise;\n fileContent(args: ProjectFileContentArgs): Promise;\n files(args: ProjectFilesArgs): Promise;\n get(args: ProjectGetArgs): Promise;\n list(args?: ProjectListArgs): Promise;\n paths(args: ProjectPathsArgs): Promise;\n promptHistory(args: ProjectPromptHistoryArgs): Promise;\n reorder(args: ProjectReorderArgs): Promise;\n sources: ProjectSourcesArea;\n update(args: ProjectUpdateArgs): Promise;\n}\n\n/** Select exactly one provider-discovery host source, or omit both for primary. */\ntype ProviderHostRoutingArgs = {\n environmentId: string;\n hostId?: never;\n} | {\n environmentId?: never;\n hostId: string;\n} | {\n environmentId?: never;\n hostId?: never;\n};\ntype ProviderListArgs = ProviderHostRoutingArgs & {\n signal?: AbortSignal;\n};\ntype ProviderModelsArgs = ProviderHostRoutingArgs & {\n providerId?: string;\n signal?: AbortSignal;\n};\ntype ProviderListResult = ProviderInfo[];\ntype ProviderModelsResult = SystemExecutionOptionsResponse;\ninterface ProvidersArea {\n /** List providers on the environment host, explicit host, or primary host. */\n list(args?: ProviderListArgs): Promise;\n /** List models on the environment host, explicit host, or primary host. */\n models(args?: ProviderModelsArgs): Promise;\n}\n\ninterface PluginIdArgs {\n pluginId: string;\n}\n/** Install directly from a path:, git:, npm:, or builtin: source spec. */\ninterface PluginInstallArgs {\n source: string;\n}\n/** Install an entry from BB's official catalog. */\ninterface PluginCatalogInstallArgs {\n entryId: string;\n}\ninterface PluginReloadArgs {\n pluginId?: string;\n}\ninterface PluginSettingsUpdateArgs extends PluginIdArgs {\n values: Record;\n}\ninterface PluginTokenArgs extends PluginIdArgs {\n rotate?: boolean;\n}\ninterface PluginCheckUpdatesArgs {\n pluginId?: string;\n signal?: AbortSignal;\n}\ninterface PluginRpcArgs extends PluginIdArgs {\n input?: JsonValue;\n method: string;\n outputSchema: z$1.ZodType;\n}\ninterface PluginCatalogSearchArgs {\n query: string;\n signal?: AbortSignal;\n}\ninterface PluginCatalogStatusArgs {\n signal?: AbortSignal;\n}\ninterface PluginGetSettingsArgs extends PluginIdArgs {\n signal?: AbortSignal;\n}\ninterface PluginGetSourceArgs extends PluginIdArgs {\n signal?: AbortSignal;\n}\ninterface PluginListArgs {\n signal?: AbortSignal;\n}\ninterface PluginListUpdateResultsArgs {\n signal?: AbortSignal;\n}\ntype PluginDisableResult = InstalledPlugin;\ntype PluginEnableResult = InstalledPlugin;\ntype PluginGetSettingsResult = PluginSettingsResponse;\ntype PluginInstallResult = InstalledPlugin;\ntype PluginListResult = PluginListResponse;\ntype PluginReloadResult = PluginReloadResponse;\ntype PluginRemoveResult = PluginRemoveResponse;\ntype PluginTokenResult = PluginTokenResponse;\ntype PluginUpdateSettingsResult = PluginSettingsResponse;\ntype PluginGetSourceResult = PluginSourceDetail;\ntype PluginCheckUpdatesResult = PluginUpdateCheckEntry[];\ntype PluginApplyUpdateResult = PluginApplyUpdateResult$1;\ntype PluginCatalogStatusResult = PluginCatalogStatus;\ntype PluginCatalogSearchResult = PluginCatalogSearchResult$1[];\ninterface PluginCatalogArea {\n install(args: PluginCatalogInstallArgs): Promise;\n search(args: PluginCatalogSearchArgs): Promise;\n status(args?: PluginCatalogStatusArgs): Promise;\n}\ninterface PluginsArea {\n applyUpdate(args: PluginIdArgs): Promise;\n callRpc(args: PluginRpcArgs): Promise;\n checkUpdates(args?: PluginCheckUpdatesArgs): Promise;\n catalog: PluginCatalogArea;\n disable(args: PluginIdArgs): Promise;\n enable(args: PluginIdArgs): Promise;\n getSettings(args: PluginGetSettingsArgs): Promise;\n getSource(args: PluginGetSourceArgs): Promise;\n install(args: PluginInstallArgs): Promise;\n list(args?: PluginListArgs): Promise;\n listUpdateResults(args?: PluginListUpdateResultsArgs): Promise;\n reload(args?: PluginReloadArgs): Promise;\n remove(args: PluginIdArgs): Promise;\n token(args: PluginTokenArgs): Promise;\n updateSettings(args: PluginSettingsUpdateArgs): Promise;\n}\n\ntype BbRealtimeUnsubscribe = () => void;\ntype BbRealtimeEventName = \"thread:changed\" | \"project:changed\" | \"environment:changed\" | \"host:changed\" | \"system:changed\" | \"system:config-changed\" | \"realtime:connection\";\ntype ThreadRealtimeEvent = Extract;\ntype ProjectRealtimeEvent = Extract;\ntype EnvironmentRealtimeEvent = Extract;\ntype HostRealtimeEvent = Extract;\ntype SystemRealtimeEvent = Extract;\ntype BbRealtimeConnectionState = \"connecting\" | \"connected\" | \"disconnected\";\ninterface BbRealtimeConnectionEvent {\n reconnectDelayMs: number | null;\n reconnected: boolean;\n state: BbRealtimeConnectionState;\n}\n/**\n * Entity-changed events are delivered as one shared object to every matching\n * listener; their payload types are readonly so a listener cannot mutate what\n * the next listener receives.\n */\ninterface BbRealtimeEventMap {\n \"thread:changed\": ThreadRealtimeEvent;\n \"project:changed\": ProjectRealtimeEvent;\n \"environment:changed\": EnvironmentRealtimeEvent;\n \"host:changed\": HostRealtimeEvent;\n \"system:changed\": SystemRealtimeEvent;\n \"system:config-changed\": SystemRealtimeEvent;\n \"realtime:connection\": BbRealtimeConnectionEvent;\n}\ntype BbRealtimeCallback = (event: BbRealtimeEventMap[TEventName]) => void;\ninterface ThreadRealtimeSubscribeArgs {\n callback: BbRealtimeCallback<\"thread:changed\">;\n event: \"thread:changed\";\n threadId?: string;\n}\ninterface ProjectRealtimeSubscribeArgs {\n callback: BbRealtimeCallback<\"project:changed\">;\n event: \"project:changed\";\n projectId?: string;\n}\ninterface EnvironmentRealtimeSubscribeArgs {\n callback: BbRealtimeCallback<\"environment:changed\">;\n environmentId?: string;\n event: \"environment:changed\";\n}\ninterface HostRealtimeSubscribeArgs {\n callback: BbRealtimeCallback<\"host:changed\">;\n event: \"host:changed\";\n hostId?: string;\n}\ninterface SystemRealtimeSubscribeArgs {\n callback: BbRealtimeCallback<\"system:changed\">;\n event: \"system:changed\";\n}\ninterface SystemConfigRealtimeSubscribeArgs {\n callback: BbRealtimeCallback<\"system:config-changed\">;\n event: \"system:config-changed\";\n}\n/**\n * Connection listeners are pure observers โ€” they never open or hold the\n * socket. A listener registered while a socket already exists receives the\n * latest connection event as a snapshot on the next microtask, so a status\n * UI mounted after connect still learns the current state.\n */\ninterface RealtimeConnectionSubscribeArgs {\n callback: BbRealtimeCallback<\"realtime:connection\">;\n event: \"realtime:connection\";\n}\ntype BbRealtimeSubscribeArgsUnion = ThreadRealtimeSubscribeArgs | ProjectRealtimeSubscribeArgs | EnvironmentRealtimeSubscribeArgs | HostRealtimeSubscribeArgs | SystemRealtimeSubscribeArgs | SystemConfigRealtimeSubscribeArgs | RealtimeConnectionSubscribeArgs;\ntype BbRealtimeSubscribeArgs = Extract;\ninterface BbRealtime {\n subscribe(args: BbRealtimeSubscribeArgs): BbRealtimeUnsubscribe;\n}\n\ninterface StatusGetArgs {\n projectId?: string;\n signal?: AbortSignal;\n threadId?: string;\n}\ninterface StatusThreadSummary {\n environmentId: string | null;\n id: string;\n parentThreadId: string | null;\n pinnedAt: number | null;\n projectId: string;\n status: ThreadStatus;\n title: string | null;\n}\ntype StatusProject = ProjectResponse;\ntype StatusChildThreads = ThreadListResponse;\ninterface StatusResult {\n childThreads: StatusChildThreads | null;\n pendingTodos: ThreadTimelinePendingTodos | null;\n project: StatusProject | null;\n thread: StatusThreadSummary | null;\n}\ninterface StatusArea {\n get(args?: StatusGetArgs): Promise;\n}\n\ninterface SkillWorkspaceArgs {\n projectId: string;\n environmentId: string | null;\n}\ninterface SkillListArgs extends SkillWorkspaceArgs {\n signal?: AbortSignal;\n}\ninterface SkillIdentityArgs extends SkillListArgs {\n skillId: string;\n}\ninterface SkillContentArgs extends SkillIdentityArgs {\n path: string;\n}\ninterface SkillUpdateArgs extends SkillWorkspaceArgs {\n skillId: string;\n content: string;\n revision: string;\n}\ninterface SkillDeleteArgs extends SkillWorkspaceArgs {\n skillId: string;\n}\ninterface RegistrySkillsSearchArgs {\n query?: string;\n page?: number;\n perPage?: number;\n}\ninterface RegistrySkillIdArgs {\n registrySkillId: string;\n}\ninterface RegistrySkillSourceArgs {\n source: string;\n skillId: string;\n}\ntype RegistrySkillInstallArgs = RegistrySkillIdArgs;\ninterface SkillsRegistryArea {\n detail(args: RegistrySkillSourceArgs): Promise;\n get(args: RegistrySkillIdArgs): Promise;\n install(args: RegistrySkillInstallArgs): Promise;\n search(args?: RegistrySkillsSearchArgs): Promise;\n}\ninterface SkillsArea {\n getContent(args: SkillContentArgs): Promise;\n list(args: SkillListArgs): Promise;\n listFiles(args: SkillIdentityArgs): Promise;\n registry: SkillsRegistryArea;\n remove(args: SkillDeleteArgs): Promise<{\n deletedPath: string;\n }>;\n update(args: SkillUpdateArgs): Promise<{\n filePath: string;\n revision: string;\n }>;\n}\n\ntype ThemeGetResult = AppTheme;\ntype ThemeCatalogResult = ThemeCatalogResponse;\ntype ThemeSetInput = AppThemeSelection;\ntype ThemeSetResult = AppTheme;\ninterface ThemeCatalogArgs {\n signal?: AbortSignal;\n}\ninterface ThemeGetArgs {\n signal?: AbortSignal;\n}\ninterface ThemeArea {\n /** The active app palette, resolved server-side (built-in id or custom CSS). */\n get(args?: ThemeGetArgs): Promise;\n /** The custom-theme directory plus discovered themes and the active palette. */\n catalog(args?: ThemeCatalogArgs): Promise;\n /** Set the complete app appearance selection in one request. */\n set(selection: ThemeSetInput): Promise;\n /**\n * Activate a palette by id while preserving the active favicon color. This\n * compatibility shorthand reads the active appearance before writing the\n * complete selection; prefer the object form when both values are known.\n */\n set(themeId: string): Promise;\n}\n\ninterface SystemAttentionArgs {\n signal?: AbortSignal;\n}\ninterface SystemConfigArgs {\n signal?: AbortSignal;\n}\ninterface SystemExecutionOptionsArgs extends SystemExecutionOptionsQuery {\n signal?: AbortSignal;\n}\ninterface SystemUsageLimitsArgs extends SystemUsageLimitsQuery {\n signal?: AbortSignal;\n}\ninterface SystemVersionArgs {\n force?: boolean;\n signal?: AbortSignal;\n}\ninterface SystemVoiceTranscriptionArgs {\n file: Blob;\n prompt?: string;\n signal?: AbortSignal;\n}\ntype SystemAttentionResult = SystemAttentionResponse;\ntype SystemConfigResult = SystemConfigResponse;\ntype SystemExecutionOptionsResult = SystemExecutionOptionsResponse;\ntype SystemReloadConfigResult = SystemConfigReloadResponse;\ntype SystemVoiceTranscriptionResult = SystemVoiceTranscriptionResponse;\ntype SystemUpdateExperimentsResult = Experiments;\ntype SystemUpdateGeneralSettingsResult = AppSettings;\ntype SystemUpdateKeyboardSettingsResult = AppKeybindingOverrides;\ntype SystemUsageLimitsResult = ProviderUsageResponse;\ntype SystemVersionResult = SystemVersionResponse;\ninterface SystemArea {\n attention(args?: SystemAttentionArgs): Promise;\n config(args?: SystemConfigArgs): Promise;\n executionOptions(args?: SystemExecutionOptionsArgs): Promise;\n reloadConfig(): Promise;\n transcribeVoice(args: SystemVoiceTranscriptionArgs): Promise;\n updateExperiments(args: Experiments): Promise;\n updateGeneralSettings(args: AppSettings): Promise;\n updateKeyboardSettings(args: AppKeybindingOverrides): Promise;\n usageLimits(args?: SystemUsageLimitsArgs): Promise;\n version(args?: SystemVersionArgs): Promise;\n}\n\ninterface TerminalThreadScope {\n cwd?: never;\n environmentId?: never;\n hostId?: never;\n kind: \"thread\";\n threadId: string;\n}\ninterface TerminalEnvironmentScope {\n environmentId: string;\n cwd?: never;\n hostId?: never;\n kind: \"environment\";\n threadId?: never;\n}\ninterface TerminalHostPathListScope {\n /** Optional exact initial working-directory filter on the selected host. */\n cwd?: string;\n environmentId?: never;\n hostId: string;\n kind: \"host_path\";\n threadId?: never;\n}\ninterface TerminalHostPathCreateScope {\n /** Null starts in the selected host's home directory. */\n cwd: string | null;\n environmentId?: never;\n hostId: string;\n kind: \"host_path\";\n threadId?: never;\n}\ntype TerminalListScope = TerminalThreadScope | TerminalEnvironmentScope | TerminalHostPathListScope;\ntype TerminalCreateScope = TerminalThreadScope | TerminalEnvironmentScope | TerminalHostPathCreateScope;\ninterface TerminalListArgs {\n signal?: AbortSignal;\n scope: TerminalListScope;\n}\ninterface TerminalCreateArgs {\n cols: number;\n rows: number;\n scope: TerminalCreateScope;\n start?: CreateTerminalRequest[\"start\"];\n title?: string;\n}\ninterface TerminalTargetArgs {\n terminalId: string;\n}\ninterface TerminalGetArgs extends TerminalTargetArgs {\n signal?: AbortSignal;\n}\ninterface TerminalRenameArgs extends TerminalTargetArgs {\n title: UpdateTerminalRequest[\"title\"];\n}\ninterface TerminalCloseArgs extends TerminalTargetArgs {\n mode: \"force\" | \"if-clean\";\n}\ninterface TerminalInputArgs extends TerminalTargetArgs {\n dataBase64: TerminalInputRequest[\"dataBase64\"];\n}\ninterface TerminalResizeArgs extends TerminalTargetArgs {\n cols: TerminalResizeRequest[\"cols\"];\n rows: TerminalResizeRequest[\"rows\"];\n}\ninterface TerminalOutputArgs extends TerminalTargetArgs {\n limitChunks?: TerminalOutputQuery[\"limitChunks\"];\n signal?: AbortSignal;\n sinceSeq?: TerminalOutputQuery[\"sinceSeq\"];\n tailBytes?: TerminalOutputQuery[\"tailBytes\"];\n}\ntype TerminalRestartArgs = TerminalTargetArgs;\ntype TerminalListResult = TerminalListResponse;\ntype TerminalCreateResult = TerminalSession;\ntype TerminalGetResult = TerminalSession;\ntype TerminalRenameResult = TerminalSession;\ntype TerminalCloseResult = TerminalSession;\ntype TerminalInputResult = TerminalSession;\ntype TerminalResizeResult = TerminalSession;\ntype TerminalOutputResult = TerminalOutputResponse;\ntype TerminalRestartResult = TerminalSession;\ninterface TerminalsArea {\n close(args: TerminalCloseArgs): Promise;\n create(args: TerminalCreateArgs): Promise;\n get(args: TerminalGetArgs): Promise;\n input(args: TerminalInputArgs): Promise;\n list(args: TerminalListArgs): Promise;\n output(args: TerminalOutputArgs): Promise;\n rename(args: TerminalRenameArgs): Promise;\n /**\n * Replace a terminal with a shell at the same scope, size, and title.\n * The original command is not replayed because terminal sessions do not\n * persist launch commands. The replacement has a new terminal ID.\n */\n restart(args: TerminalRestartArgs): Promise;\n resize(args: TerminalResizeArgs): Promise;\n}\n\ninterface ThreadListArgs {\n archived?: boolean;\n excludeSideChats?: boolean;\n sectionId?: string;\n hasParent?: boolean;\n includeHidden?: boolean;\n limit?: number;\n offset?: number;\n originKind?: ThreadListQuery[\"originKind\"];\n parentThreadId?: string;\n projectId?: string;\n signal?: AbortSignal;\n sourceThreadId?: string;\n unsectioned?: boolean;\n}\ninterface ThreadSearchArgs extends ThreadSearchQuery {\n signal?: AbortSignal;\n}\ninterface ThreadGetArgs {\n include?: ThreadGetQuery[\"include\"];\n signal?: AbortSignal;\n threadId: string;\n}\ntype ThreadGetResult = ThreadResponse | ThreadWithIncludesResponse;\ntype ThreadListResult = ThreadListResponse;\ntype ThreadSearchResult = ThreadSearchResponse;\ninterface ThreadOutputResponse {\n output: string | null;\n}\ntype ThreadMutationResult = ThreadResponse;\ntype ThreadSpawnResult = ThreadResponse;\ntype ThreadForkResult = ThreadResponse;\ntype ThreadInteractionGetResult = PendingInteraction;\ntype ThreadInteractionListResult = ThreadPendingInteractionsResponse;\ntype ThreadInteractionResolveResult = PendingInteraction;\ntype ThreadInteractionRespondResult = PendingInteraction;\ntype ThreadInteractionCancelResult = PendingInteraction;\ntype ThreadEventsListResult = ThreadEventRow[];\ntype ThreadEventWaitResult = ThreadEventRow | null;\ntype ThreadTimelineResult = ThreadTimelineResponse;\ntype ThreadArchiveResult = ThreadArchiveAllResponse;\ntype ThreadOpenResult = ThreadOpenResponse;\ntype ThreadPaneActionResult = ThreadPaneActionResponse;\ntype ThreadDeleteResult = {\n ok: true;\n};\ntype ThreadSendResult = {\n ok: true;\n};\ntype ThreadStopResult = {\n ok: true;\n};\ntype ThreadBannerActionResult = {\n ok: true;\n};\ntype ThreadUnarchiveResult = {\n ok: true;\n};\ntype ThreadArchiveAllResult = ThreadArchiveAllResponse;\ntype ThreadReadStateResult = ThreadResponse;\ntype ThreadPinOrderResult = ThreadListResponse;\ntype ThreadPromptHistoryResult = PromptHistoryResponse;\ntype ThreadQueuedMessagesResult = ThreadQueuedMessageListResponse;\ntype ThreadQueuedMessageCreateResult = ThreadQueuedMessage;\ntype ThreadQueuedMessageUpdateResult = ThreadQueuedMessage;\ntype ThreadQueuedMessageDeleteResult = {\n ok: true;\n};\ntype ThreadQueuedMessageReorderResult = ThreadQueuedMessageListResponse;\ntype ThreadQueuedMessageSendResult = SendQueuedMessageResponse;\ntype ThreadQueuedMessageGroupBoundaryResult = ThreadQueuedMessageListResponse;\ntype ThreadTabsResult = ThreadTabsResponse;\ntype ThreadTabsUpdateResult = ThreadTabsResponse;\ntype ThreadStorageFilesResult = ThreadStorageFileListResponse;\ntype ThreadStoragePathsResult = ThreadStoragePathListResponse;\ntype ThreadChildSummaryResult = ThreadChildSummaryResponse;\ntype ThreadDefaultExecutionOptionsResult = ResolvedThreadExecutionOptions | null;\ntype ThreadConversationOutlineResult = ThreadConversationOutlineResponse;\ntype ThreadTimelineTurnSummaryDetailsResult = TimelineTurnSummaryDetailsResponse;\ninterface ThreadSpawnBaseArgs extends Omit {\n childOrigin?: CreateThreadRequest[\"childOrigin\"];\n origin?: CreateThreadRequest[\"origin\"];\n originKind?: CreateThreadRequest[\"originKind\"];\n startedOnBehalfOf?: CreateThreadRequest[\"startedOnBehalfOf\"];\n}\ntype ThreadSpawnArgs = ThreadSpawnBaseArgs & ({\n input: CreateThreadRequest[\"input\"];\n prompt?: never;\n} | {\n input?: never;\n prompt: string;\n});\ninterface ThreadForkArgs extends Omit {\n origin?: ForkThreadRequest[\"origin\"];\n visibility?: ForkThreadRequest[\"visibility\"];\n workspace?: ForkThreadRequest[\"workspace\"];\n}\ninterface ThreadUpdateArgs extends UpdateThreadRequest {\n threadId: string;\n}\ninterface ThreadDeleteArgs extends DeleteThreadRequest {\n threadId: string;\n}\ninterface ThreadSendArgs extends SendMessageRequest {\n threadId: string;\n}\ninterface ThreadActionArgs {\n threadId: string;\n}\ninterface ThreadStatusArgs extends ThreadActionArgs {\n signal?: AbortSignal;\n}\ninterface ThreadPromptHistoryArgs extends PromptHistoryQuery {\n signal?: AbortSignal;\n threadId: string;\n}\ninterface ThreadPinOrderArgs extends ReorderPinnedThreadRequest {\n threadId: string;\n}\ninterface ThreadQueuedMessageArgs {\n signal?: AbortSignal;\n threadId: string;\n}\ninterface ThreadQueuedMessageCreateArgs extends CreateQueuedMessageRequest {\n threadId: string;\n}\ninterface ThreadQueuedMessageUpdateArgs extends ThreadQueuedMessageTargetArgs, UpdateQueuedMessageRequest {\n}\ninterface ThreadQueuedMessageTargetArgs {\n queuedMessageId: string;\n threadId: string;\n}\ninterface ThreadQueuedMessageSendArgs extends ThreadQueuedMessageTargetArgs, SendQueuedMessageRequest {\n}\ninterface ThreadQueuedMessageReorderArgs extends ThreadQueuedMessageTargetArgs, ReorderQueuedMessageRequest {\n}\ninterface ThreadQueuedMessageGroupBoundaryArgs extends SetQueuedMessageGroupBoundaryRequest {\n threadId: string;\n}\ninterface ThreadStorageFilesArgs extends ThreadStorageFilesQuery {\n signal?: AbortSignal;\n threadId: string;\n}\ninterface ThreadStoragePathsArgs extends ThreadStoragePathsQuery {\n signal?: AbortSignal;\n threadId: string;\n}\ninterface ThreadTimelineTurnSummaryDetailsArgs extends TimelineTurnSummaryDetailsQuery {\n signal?: AbortSignal;\n threadId: string;\n}\ninterface ThreadTabsUpdateArgs extends UpdateThreadTabsRequest {\n threadId: string;\n}\ninterface ThreadOpenArgs {\n threadId: string;\n split?: ThreadOpenSplit;\n file: ThreadOpenFile | null;\n}\ninterface ThreadPaneActionArgs {\n action: ThreadPaneAction;\n threadId: string;\n}\ninterface ThreadEventsListArgs {\n afterSeq?: string;\n limit?: string;\n signal?: AbortSignal;\n threadId: string;\n}\ninterface ThreadEventWaitArgs {\n afterSeq?: string;\n signal?: AbortSignal;\n threadId: string;\n type: string;\n waitMs: string;\n}\ninterface ThreadTimelineArgs extends ThreadTimelineQuery {\n signal?: AbortSignal;\n threadId: string;\n}\ninterface ThreadOutputArgs {\n signal?: AbortSignal;\n threadId: string;\n}\ninterface ThreadInteractionListArgs {\n signal?: AbortSignal;\n threadId: string;\n}\ninterface ThreadInteractionTargetArgs {\n interactionId: string;\n threadId: string;\n}\ninterface ThreadInteractionGetArgs extends ThreadInteractionTargetArgs {\n signal?: AbortSignal;\n}\ninterface ThreadInteractionResolveArgs extends ThreadInteractionTargetArgs {\n resolution: PendingInteractionResolution;\n}\ninterface ThreadInteractionRespondArgs extends ThreadInteractionTargetArgs {\n value: JsonValue;\n}\ntype ThreadWaitTarget = {\n kind: \"status\";\n status: ThreadStatus;\n} | {\n kind: \"event\";\n eventType: string;\n};\ninterface ThreadWaitArgs {\n event?: string;\n pollIntervalMs?: number;\n signal?: AbortSignal;\n status?: ThreadStatus;\n threadId: string;\n timeoutMs?: number;\n}\ntype ThreadWaitResult = {\n event: NonNullable;\n matched: true;\n target: Extract;\n threadId: string;\n} | {\n matched: true;\n target: Extract;\n thread: ThreadGetResult;\n threadId: string;\n};\ninterface ThreadInteractionsArea {\n cancel(args: ThreadInteractionTargetArgs): Promise;\n get(args: ThreadInteractionGetArgs): Promise;\n list(args: ThreadInteractionListArgs): Promise;\n resolve(args: ThreadInteractionResolveArgs): Promise;\n respond(args: ThreadInteractionRespondArgs): Promise;\n}\ninterface ThreadEventsArea {\n list(args: ThreadEventsListArgs): Promise;\n wait(args: ThreadEventWaitArgs): Promise;\n}\ninterface ThreadQueuedMessagesArea {\n create(args: ThreadQueuedMessageCreateArgs): Promise;\n delete(args: ThreadQueuedMessageTargetArgs): Promise;\n list(args: ThreadQueuedMessageArgs): Promise;\n reorder(args: ThreadQueuedMessageReorderArgs): Promise;\n send(args: ThreadQueuedMessageSendArgs): Promise;\n setGroupBoundary(args: ThreadQueuedMessageGroupBoundaryArgs): Promise;\n update(args: ThreadQueuedMessageUpdateArgs): Promise;\n}\ninterface ThreadTabsArea {\n get(args: ThreadStatusArgs): Promise;\n update(args: ThreadTabsUpdateArgs): Promise;\n}\ninterface ThreadsArea {\n archive(args: ThreadActionArgs): Promise;\n archiveAll(args: ThreadActionArgs): Promise;\n childSummary(args: ThreadStatusArgs): Promise;\n cancelPlan(args: ThreadActionArgs): Promise;\n clearGoal(args: ThreadActionArgs): Promise;\n conversationOutline(args: ThreadStatusArgs): Promise;\n defaultExecutionOptions(args: ThreadStatusArgs): Promise;\n delete(args: ThreadDeleteArgs): Promise;\n events: ThreadEventsArea;\n fork(args: ThreadForkArgs): Promise;\n get(args: ThreadGetArgs): Promise;\n interactions: ThreadInteractionsArea;\n list(args?: ThreadListArgs): Promise;\n markRead(args: ThreadActionArgs): Promise;\n markUnread(args: ThreadActionArgs): Promise;\n open(args: ThreadOpenArgs): Promise;\n paneAction(args: ThreadPaneActionArgs): Promise;\n output(args: ThreadOutputArgs): Promise;\n pin(args: ThreadActionArgs): Promise;\n promptHistory(args: ThreadPromptHistoryArgs): Promise;\n queuedMessages: ThreadQueuedMessagesArea;\n reorderPinned(args: ThreadPinOrderArgs): Promise;\n search(args: ThreadSearchArgs): Promise;\n send(args: ThreadSendArgs): Promise;\n spawn(args: ThreadSpawnArgs): Promise;\n stop(args: ThreadActionArgs): Promise;\n tabs: ThreadTabsArea;\n timeline(args: ThreadTimelineArgs): Promise;\n timelineTurnSummaryDetails(args: ThreadTimelineTurnSummaryDetailsArgs): Promise;\n storageFiles(args: ThreadStorageFilesArgs): Promise;\n storagePaths(args: ThreadStoragePathsArgs): Promise;\n unarchive(args: ThreadActionArgs): Promise;\n unpin(args: ThreadActionArgs): Promise;\n update(args: ThreadUpdateArgs): Promise;\n wait(args: ThreadWaitArgs): Promise;\n}\n\ntype ThreadSectionCreateResult = ThreadSectionResponse;\ntype ThreadSectionUpdateResult = ThreadSectionMutationResponse;\ntype ThreadSectionDeleteResult = ThreadSectionMutationResponse;\ntype ThreadSectionListResult = ThreadSectionResponse[];\ninterface ThreadSectionListArgs {\n signal?: AbortSignal;\n}\ninterface ThreadSectionsArea {\n create(args: CreateThreadSectionRequest): Promise;\n delete(args: DeleteThreadSectionRequest): Promise;\n list(args?: ThreadSectionListArgs): Promise;\n update(args: UpdateThreadSectionRequest): Promise;\n}\n\ninterface BbSdk extends BbRealtime {\n environments: EnvironmentsArea;\n files: FilesArea;\n guide: GuideArea;\n hosts: HostsArea;\n projects: ProjectsArea;\n plugins: PluginsArea;\n providers: ProvidersArea;\n skills: SkillsArea;\n status: StatusArea;\n system: SystemArea;\n terminals: TerminalsArea;\n theme: ThemeArea;\n threadSections: ThreadSectionsArea;\n threads: ThreadsArea;\n}\n\n/**\n * The backend plugin API contract โ€” the `bb` object handed to a plugin's\n * `server.ts` factory (`export default function plugin(bb: BbPluginApi)`).\n *\n * Types only: the implementation lives in the BB server\n * (apps/server/src/services/plugins/plugin-api.ts), which imports these\n * shapes so the contract and the implementation cannot drift. Plugin authors\n * import them type-only (`import type { BbPluginApi } from\n * \"@bb/plugin-sdk\"`); the import is erased when BB loads the file.\n *\n * Runtime classes stay host-side. NeedsConfigurationError in particular is\n * matched by NAME, so plugin code needs no runtime import:\n * `throw Object.assign(new Error(msg), { name: \"NeedsConfigurationError\" })`.\n */\ninterface PluginLogger {\n debug(message: string): void;\n info(message: string): void;\n warn(message: string): void;\n error(message: string): void;\n}\n/**\n * Declarative settings descriptors (`bb.settings.define`). Deliberately plain\n * data โ€” not zod โ€” so the host can render settings forms and the CLI can\n * parse values without executing plugin code.\n */\ntype PluginSettingDescriptor = {\n type: \"string\";\n label: string;\n description?: string;\n /** Stored in a 0600 file under /plugins//secrets/, never in the db or sent to the frontend. */\n secret?: true;\n default?: string;\n} | {\n type: \"boolean\";\n label: string;\n description?: string;\n default?: boolean;\n} | {\n type: \"select\";\n label: string;\n description?: string;\n options: string[];\n default?: string;\n} | {\n type: \"project\";\n label: string;\n description?: string;\n default?: string;\n};\ntype PluginSettingDescriptors = Record;\ntype PluginSettingValue = string | boolean;\n/** `default` present โ†’ non-optional value; absent โ†’ `T | undefined`. */\ntype PluginSettingsValues> = {\n [K in keyof Ds]: Ds[K] extends {\n default: string | boolean;\n } ? PluginSettingValueOf : PluginSettingValueOf | undefined;\n};\ntype PluginSettingValueOf = D extends {\n type: \"boolean\";\n} ? boolean : string;\ninterface PluginSettingsHandle> {\n /** Load-safe: callable inside the factory. */\n get(): Promise>;\n /** Fires after values change through the settings route/CLI. */\n onChange(listener: (next: PluginSettingsValues, prev: PluginSettingsValues) => void): void;\n}\ninterface PluginSettings {\n define>(descriptors: Ds): PluginSettingsHandle;\n}\ninterface PluginKvStorage {\n get(key: string): Promise;\n set(key: string, value: unknown): Promise;\n delete(key: string): Promise;\n list(prefix?: string): Promise;\n}\ninterface PluginStorage {\n /** Namespaced JSON key-value rows in bb.db; values โ‰ค256KB each. */\n kv: PluginKvStorage;\n /**\n * Open (or reuse the path of) the plugin's own SQLite database at\n * /plugins//data.db โ€” the server's better-sqlite3, WAL mode,\n * busy_timeout 5000. Handles are host-tracked and closed on\n * dispose/reload; a closed handle throws on use.\n */\n database(): Database.Database;\n /**\n * Ordered-statement migration helper: statement index = migration id in a\n * `_bb_migrations` table; unapplied statements run in one transaction.\n * Append-only โ€” never reorder or edit shipped statements.\n */\n migrate(db: Database.Database, statements: string[]): void;\n}\n/**\n * Thread lifecycle events a plugin can observe (design ยง4.5). Observe-only:\n * handlers run fire-and-forget after the transition is applied and can never\n * block or veto it. `thread` is the same public DTO GET /threads/:id serves.\n */\ninterface PluginThreadEventPayloads {\n /** Fired after a thread row is created. */\n \"thread.created\": {\n thread: ThreadResponse;\n };\n /** Fired when a thread transitions into `active`. */\n \"thread.active\": {\n thread: ThreadResponse;\n };\n /** Fired when a thread transitions into `idle`. `lastAssistantText` is\n * assembled the same way GET /threads/:id/output is. */\n \"thread.idle\": {\n thread: ThreadResponse;\n lastAssistantText: string | null;\n };\n /** Fired when a thread transitions into `error`. `error` is the latest\n * system/error event message, when one exists. */\n \"thread.failed\": {\n thread: ThreadResponse;\n error: string | null;\n };\n /** Fired after a thread is archived (including cascade archives). */\n \"thread.archived\": {\n thread: ThreadResponse;\n };\n /** Fired after a thread is soft-deleted. */\n \"thread.deleted\": {\n thread: ThreadResponse;\n };\n}\ntype PluginThreadEventName = keyof PluginThreadEventPayloads;\ntype PluginThreadEventHandler = (payload: PluginThreadEventPayloads[E]) => void | Promise;\ntype PluginHttpAuthMode = \"local\" | \"token\" | \"none\";\ntype PluginHttpHandler = (context: Context) => Response | Promise;\ninterface PluginHttp {\n /**\n * Register an HTTP route, mounted at\n * `/api/v1/plugins//http/`. Auth modes (default \"local\"):\n * - \"local\": Origin/Host must be a local BB app origin; non-GET requires\n * content-type application/json (forces a CORS preflight).\n * - \"token\": requires the per-plugin token (`bb plugin token `) via\n * the x-bb-plugin-token header or ?token=.\n * - \"none\": no checks โ€” only for signature-verified webhooks.\n */\n route(method: string, path: string, handler: PluginHttpHandler, opts?: {\n auth?: PluginHttpAuthMode;\n }): void;\n}\ninterface PluginRpc {\n /**\n * Register a Standard Schema-driven rpc contract and its inferred handlers,\n * served at POST\n * `/api/v1/plugins//rpc/` with \"local\" auth semantics. The\n * host validates input before invocation and output before strict JSON\n * serialization. The response is `{ ok: true, result }` or\n * `{ ok: false, error: { code, message, issues? } }`.\n */\n register(contract: Contract, handlers: PluginRpcHandlers): void;\n}\ninterface PluginRealtime {\n /**\n * Broadcast an ephemeral `plugin-signal` WS message\n * `{ pluginId, channel, payload }` to every connected client (V1 has no\n * per-channel subscriptions). `payload` must be JSON-serializable;\n * `undefined` is normalized to `null`. Nothing is persisted.\n */\n publish(channel: string, payload: unknown): void;\n}\ninterface PluginBackground {\n /**\n * Register a long-lived background service. `start` runs after the\n * factory completes and should resolve when `signal` aborts\n * (dispose/reload/disable/shutdown). A crash restarts it with capped\n * exponential backoff; throwing NeedsConfigurationError marks the plugin\n * `needs-configuration` and stops restarting until the next load.\n */\n service(name: string, service: {\n start(signal: AbortSignal): void | Promise;\n }): void;\n /**\n * Register a cron schedule (5-field expression, server-local time). The\n * durable row keyed (pluginId, name) is upserted at load; the periodic\n * sweep claims due rows with a CAS on next_run_at, but only while this\n * plugin is loaded. Failures land in last_status/last_error, visible in\n * `bb plugin list`.\n */\n schedule(name: string, cron: string, fn: () => void | Promise): void;\n}\ninterface PluginCliCommandInfo {\n name: string;\n summary: string;\n usage: string;\n}\n/** Context forwarded from the invoking CLI when known; all fields optional. */\ninterface PluginCliContext {\n cwd?: string;\n threadId?: string;\n projectId?: string;\n /** Aborted when the invoking CLI HTTP request disconnects. */\n signal?: AbortSignal;\n}\ntype PluginInteractionCancelReason = \"user\" | \"request-aborted\" | \"thread-stopped\" | \"thread-deleted\" | \"plugin-disposed\" | \"server-restarted\" | \"timeout\";\ntype PluginInteractionResult = {\n outcome: \"submitted\";\n value: JsonValue$1;\n} | {\n outcome: \"cancelled\";\n reason: PluginInteractionCancelReason;\n};\ninterface PluginInteractionRequest {\n threadId: string;\n rendererId: string;\n title: string;\n payload: JsonValue$1;\n /** Defaults to ten minutes; capped at one hour. */\n timeoutMs?: number;\n}\ninterface PluginCliResult {\n exitCode: number;\n stdout?: string;\n stderr?: string;\n}\n/**\n * Maximum combined UTF-8 bytes accepted from plugin CLI stdout and stderr.\n * This is the shared source of truth for production and the testing harness.\n */\ndeclare const PLUGIN_CLI_OUTPUT_MAX_BYTES: number;\ninterface PluginCliOutputLimitError {\n code: \"plugin_cli_output_too_large\";\n message: string;\n maxBytes: number;\n stdoutBytes: number;\n stderrBytes: number;\n totalBytes: number;\n}\n/** Normalized host result returned by the plugin CLI HTTP/testing boundary. */\ninterface PluginCliExecutionResult {\n exitCode: number;\n stdout: string;\n stderr: string;\n error?: PluginCliOutputLimitError;\n}\ninterface PluginCliRegistration {\n /** Top-level command name (`bb โ€ฆ`): lowercase [a-z0-9-]+, and not\n * a core bb command (see RESERVED_BB_CLI_COMMANDS in the server). */\n name: string;\n summary: string;\n /** Subcommand metadata rendered in help and the plugin-commands skill\n * without executing plugin code. Parsing argv is plugin-owned. */\n commands?: PluginCliCommandInfo[];\n run(argv: string[], ctx: PluginCliContext): PluginCliResult | Promise;\n}\ninterface PluginCli {\n /**\n * Register this plugin's `bb` subcommand. One registration per factory\n * execution; a repeated call is rejected. Core bb commands always win\n * name collisions; reserved names are rejected at registration.\n */\n register(registration: PluginCliRegistration): void;\n}\n/** Per-turn context handed to bb.agents context providers (design ยง4.4). */\n/** MCP-style content parts a native tool may return (design ยง4.4). */\ntype PluginAgentToolContentPart = {\n type: \"text\";\n text: string;\n} | {\n type: \"image\";\n data: string;\n mimeType: string;\n};\ntype PluginAgentToolResult = string | {\n content: PluginAgentToolContentPart[];\n isError?: boolean;\n};\n/** Per-call context handed to a native tool's execute (design ยง4.4). */\ninterface PluginAgentToolContext {\n threadId: string;\n projectId: string;\n /** The tool-call request's abort signal (aborts if the daemon round-trip\n * is torn down mid-call). */\n signal: AbortSignal;\n}\ninterface PluginAgentToolRegistrationBase {\n /** Tool name shown to the model: [a-zA-Z0-9_-]+, unique across plugins,\n * and not a built-in dynamic tool (see RESERVED_AGENT_TOOL_NAMES in the\n * server). */\n name: string;\n description: string;\n /**\n * Optional usage snippet appended to the thread instructions whenever\n * this tool is in the session's tool set (mirrors the built-in\n * update_environment_directory guidance). Limited to 4096 characters.\n */\n instructions?: string;\n}\n/** Stable, plain-data context resolved by the server for one agent session. */\ninterface PluginAgentConfigurationContext {\n thread: {\n id: string;\n title: string | null;\n parentThreadId: string | null;\n sourceThreadId: string | null;\n };\n project: {\n id: string;\n kind: \"standard\" | \"personal\";\n name: string;\n gitRemoteUrl: string | null;\n };\n environment: {\n id: string;\n name: string | null;\n path: string | null;\n workspaceProvisionType: \"unmanaged\" | \"managed-worktree\" | \"personal\";\n branchName: string | null;\n };\n host: {\n id: string;\n name: string;\n };\n provider: {\n id: string;\n model: string;\n };\n sideChat: boolean;\n origin: {\n kind: \"fork\" | \"side-chat\" | null;\n pluginId: string | null;\n };\n}\n/** Object form of a {@link PluginAgentConfiguration} tools entry: selects a\n * registered tool and overrides the parameter schema advertised to the\n * provider for this resolution only. */\ninterface PluginAgentToolSelection {\n /** Name of a tool registered by this plugin via `registerTool`. */\n name: string;\n /** JSON-schema object (root `type: \"object\"`, JSON-serializable, at most\n * 128 KiB serialized) sent to the provider in place of the registered\n * parameter schema. Execution-side validation still runs the registered\n * parameters, so the override must only narrow what the registered schema\n * already accepts. */\n parameters: Record;\n}\n/** Per-resolution selection returned by {@link PluginAgents.configure}. */\ninterface PluginAgentConfiguration {\n /** Tool names registered by this plugin, or {@link PluginAgentToolSelection}\n * entries to also override a tool's advertised parameter schema for this\n * resolution. Duplicate or unknown names, or an invalid override, reject\n * this plugin's complete selection for the resolution. */\n tools: Array;\n /** Skill frontmatter names from this plugin's manifest skill roots.\n * Duplicate or unknown names reject this plugin's complete selection. */\n skills: string[];\n /** Optional dynamic instructions. Output is truncated to 4096 characters. */\n instructions?: string;\n}\ninterface PluginAgents {\n /**\n * Select this plugin's statically registered tools and manifest skills for\n * each thread/session resolution, with optional dynamic instructions. The\n * callback is synchronous and runs at `thread.start` / `turn.submit`; it\n * never rebuilds registrations. Exactly one callback may be registered per\n * factory execution. A throw, malformed result, duplicate id, unknown id,\n * or more than 256 tool/skill ids fails closed for this plugin only.\n *\n * Tools take effect when the provider session is next started or resumed;\n * an already-running session is not hot-mutated. Instructions are resolved\n * for the next turn. Skill changes follow BB's environment runtime policy:\n * a busy runtime keeps its current catalog until a safe relaunch. Side-chat\n * threads receive `sideChat: true`, and their returned tool, skill, and\n * dynamic-instruction selections apply at the same boundaries. Independent\n * side-chat safety policy (such as permission escalation) is unchanged.\n */\n configure(provider: (context: PluginAgentConfigurationContext) => PluginAgentConfiguration): void;\n /**\n * Register a native dynamic tool (design ยง4.4). `parameters` is either a\n * zod schema (validated per call; execute receives the parsed value) or a\n * plain JSON-schema object (no validation; execute receives the raw\n * arguments as `unknown`). Tool-set changes apply on the NEXT session\n * start โ€” a tool registered mid-session is not hot-added to running\n * provider sessions. A second registration of the same name within this\n * plugin is rejected; a name already registered by another plugin is\n * rejected and surfaced as this plugin's status detail.\n */\n registerTool(tool: PluginAgentToolRegistrationBase & {\n parameters: Schema;\n execute(params: z.output, ctx: PluginAgentToolContext): PluginAgentToolResult | Promise;\n }): void;\n registerTool(tool: PluginAgentToolRegistrationBase & {\n /** Raw JSON-schema escape hatch; params arrive unvalidated. */\n parameters: Record;\n execute(params: unknown, ctx: PluginAgentToolContext): PluginAgentToolResult | Promise;\n }): void;\n /**\n * Contribute a dynamic section appended to thread instructions. The\n * provider runs when a thread's runtime command config is resolved\n * (thread.start / turn.submit); return null to contribute nothing for\n * that resolution. Must be synchronous and fast โ€” it sits on the\n * thread-start path. Output longer than 4096 characters is truncated; a\n * throwing provider is logged against the plugin and contributes nothing.\n * A repeated registration within one factory execution is rejected.\n * This legacy contribution is not applied to side-chat threads; use\n * configure() when sideChat-aware dynamic instructions are required.\n */\n contributeInstructions(provider: (ctx: {\n threadId: string;\n projectId: string;\n }) => string | null): void;\n}\ninterface PluginThreadActionContext {\n threadId: string;\n projectId: string;\n}\ninterface PluginThreadActionToast {\n kind: \"success\" | \"error\" | \"info\";\n message: string;\n}\ntype PluginThreadActionResult = void | {\n toast?: PluginThreadActionToast;\n};\ninterface PluginThreadActionRegistration {\n /** Unique within this plugin: [a-zA-Z0-9_-]+ (becomes a URL segment). */\n id: string;\n /** Button label rendered in the thread header. */\n title: string;\n /** Optional icon name; the host falls back to a generic icon. */\n icon?: string;\n /** Optional confirmation prompt the host shows before running. */\n confirm?: string;\n /**\n * Runs server-side when the user clicks the action. The host shows a\n * pending state while in flight, the returned toast on completion, and an\n * automatic error toast when this throws.\n */\n run(ctx: PluginThreadActionContext): PluginThreadActionResult | Promise;\n}\ntype PluginMentionTrigger = \"@\" | \"#\" | \"$\" | \"!\" | \"~\";\n/** Search context handed to a mention provider (design ยง4.9). `projectId`/\n * `threadId` are null when the composer has not committed one yet. */\ninterface PluginMentionSearchContext {\n trigger: PluginMentionTrigger;\n query: string;\n projectId: string | null;\n threadId: string | null;\n}\n/** One row a mention provider returns from `search`. `id` is the provider's\n * own item id โ€” the host namespaces it before it reaches the wire. */\ninterface PluginMentionItem {\n id: string;\n title: string;\n subtitle?: string;\n icon?: string;\n}\ninterface PluginMentionProviderRegistration {\n /** Unique within this plugin: [a-zA-Z0-9_-]+ (no \":\" โ€” the host composes\n * wire item ids as \":\"). */\n id: string;\n /** Section label shown above this provider's rows in the mention menu. */\n label: string;\n /**\n * Composer trigger characters this provider should answer. Omit to use the\n * default `@` mention trigger. Valid triggers are `@`, `#`, `$`, `!`, and `~`.\n */\n triggers?: readonly PluginMentionTrigger[];\n /**\n * Runs server-side as the user types after one of this provider's triggers\n * in the composer. Each call is time-boxed (2s) and failure-isolated: a slow\n * or throwing provider contributes an empty list โ€” it can never break the\n * mention menu.\n */\n search(ctx: PluginMentionSearchContext): PluginMentionItem[] | Promise;\n /**\n * Resolves one picked item into agent context, called once per unique\n * item at message send time. The returned `context` is attached to the\n * message as an agent-visible (user-hidden) prompt input. Throwing blocks\n * the send with a visible error.\n */\n resolve(itemId: string): {\n context: string;\n } | Promise<{\n context: string;\n }>;\n}\ninterface PluginUi {\n /** Block until the app submits or cancels a plugin-owned composer form. */\n requestInput(request: PluginInteractionRequest, options?: {\n signal?: AbortSignal;\n }): Promise;\n /**\n * Register a thread action rendered in the shipped app's thread header\n * (design ยง4.9). Multiple actions per plugin; ids must be unique within\n * the plugin. Invoked via POST /plugins/:id/actions/:actionId.\n */\n registerThreadAction(action: PluginThreadActionRegistration): void;\n /**\n * Register a mention provider for the shipped app's composer (design ยง4.9).\n * Providers default to the `@` trigger and may opt into `#`, `$`, `!`, or\n * `~` with `triggers`. Items group under `label` in the mention menu; a\n * picked item becomes a `{ kind: \"plugin\" }` mention resource whose context\n * is resolved once at send time. Multiple providers per plugin; ids must be\n * unique within the plugin.\n */\n registerMentionProvider(provider: PluginMentionProviderRegistration): void;\n}\ninterface PluginEvents {\n /**\n * Add a thread lifecycle listener. Multiple listeners for the same event are\n * additive and run independently in registration order.\n */\n on(event: E, handler: PluginThreadEventHandler): void;\n}\ninterface PluginServerApi {\n /**\n * This BB server's own loopback base URL (e.g. \"http://127.0.0.1:38886\"),\n * which serves the SPA + /api + /ws. For plugins that proxy or relay\n * traffic back to the server itself (e.g. a tunnel). Bind-gated like\n * `bb.sdk`: reading it before the server is listening throws, so prefer\n * reading it from handlers, services, and timers.\n */\n readonly loopbackBaseUrl: string;\n}\ninterface PluginSharedPortTunnelIdentity {\n /** Gate routing label assigned to this machine. */\n label: string;\n /** Gate apex without a scheme, e.g. \"getbb.app\". */\n baseDomain: string;\n}\ninterface PluginHosts {\n /**\n * Ensure this enrolled host has a gate label and return its read-only public\n * identity. The daemon chooses the trusted gate and desired label; plugins\n * cannot influence either credential-bearing destination.\n */\n ensureSharedPortTunnel(hostId: string): Promise;\n /**\n * Replace this plugin's desired shared-loopback ports for one host. The\n * server aggregates declarations, owns generations, and delivers the\n * resulting set to that host's daemon. Tunnel identity is deliberately not\n * accepted here: it is owned by the daemon's trusted enrollment.\n */\n declareSharedPorts(hostId: string, ports: readonly number[]): void;\n}\ninterface PluginStatusApi {\n /**\n * Mark this plugin `needs-configuration` (with a message shown in\n * `bb plugin list` and the UI) instead of failing โ€” e.g. a factory or\n * service that finds no API key configured. Cleared on the next load;\n * saving settings does not auto-reload in V1, so ask the user to\n * `bb plugin reload ` after configuring.\n */\n needsConfiguration(message: string): void;\n}\n/**\n * The API object handed to a plugin's factory (design ยง4). Implemented by\n * the BB server; this contract is what plugin `server.ts` files compile\n * against.\n */\ninterface BbPluginApi {\n /** The plugin's own id (namespaces storage, routes, commands). */\n readonly pluginId: string;\n /** Leveled, plugin-scoped logger. */\n readonly log: PluginLogger;\n /** Declarative settings (design ยง4.2). */\n readonly settings: PluginSettings;\n /** Namespaced KV + per-plugin database (design ยง4.3). */\n readonly storage: PluginStorage;\n /** HTTP routes under /api/v1/plugins//http/* (design ยง4.6). */\n readonly http: PluginHttp;\n /** RPC methods under /api/v1/plugins//rpc/ (design ยง4.6). */\n readonly rpc: PluginRpc;\n /** Ephemeral push to connected frontends (design ยง4.7). */\n readonly realtime: PluginRealtime;\n /** Long-lived services + cron schedules (design ยง4.8). */\n readonly background: PluginBackground;\n /** Agent-facing `bb` CLI subcommand (design ยง4.4). */\n readonly cli: PluginCli;\n /** Per-turn agent context contributions (design ยง4.4). */\n readonly agents: PluginAgents;\n /** Host-rendered UI contributions (design ยง4.9). */\n readonly ui: PluginUi;\n /** Additive plugin lifecycle listeners (design ยง4.5). */\n readonly events: PluginEvents;\n /** Plugin-reported status (needs-configuration). */\n readonly status: PluginStatusApi;\n /** Read-only facts about the running server (loopback base URL). */\n readonly server: PluginServerApi;\n /** Server-to-daemon host control-plane declarations. */\n readonly hosts: PluginHosts;\n /**\n * The full BB SDK, bound to this server over loopback (design ยง4.1).\n * Bind-gated: reading this before the host binds the SDK throws. The real\n * server binds it before loading plugins, so it is available from the\n * moment factories run there โ€” but isolated harnesses may not, so prefer\n * using it from handlers, services, and timers for portability.\n * `threads.spawn` defaults `origin` to \"plugin\" and `originPluginId` to\n * this plugin's id so spawned threads are attributed automatically.\n */\n readonly sdk: BbSdk;\n /**\n * Register cleanup to run on reload/disable/shutdown. Hooks run LIFO.\n * The sanctioned place to clear timers and close connections.\n */\n onDispose(hook: () => void | Promise): void;\n}\n\nexport { PLUGIN_CLI_OUTPUT_MAX_BYTES, defineRpcContract };\nexport type { BbContext, BbNavigate, BbPluginApi, ComposerCustomization, ComposerPlusMenuItem, ComposerRichTextSpec, ComposerStructuredDraft, ComposerView, JsonValue$1 as JsonValue, MarkdownProps, PluginAgentConfiguration, PluginAgentConfigurationContext, PluginAgentToolContentPart, PluginAgentToolContext, PluginAgentToolRegistrationBase, PluginAgentToolResult, PluginAgentToolSelection, PluginAgents, PluginAppBuilder, PluginAppComposer, PluginAppContentScripts, PluginAppDefinition, PluginAppSetup, PluginAppSlots, PluginBackground, PluginCli, PluginCliCommandInfo, PluginCliContext, PluginCliExecutionResult, PluginCliOutputLimitError, PluginCliRegistration, PluginCliResult, PluginComposerApi, PluginComposerMention, PluginComposerScope, PluginComposerTextEffect, PluginComposerThreadRowStatus, PluginContentScriptContext, PluginContentScriptDisposer, PluginContentScriptRegistration, PluginEvents, PluginFileOpenerProps, PluginFileOpenerRegistration, PluginFileOpenerSource, PluginHomepageSectionProps, PluginHomepageSectionRegistration, PluginHosts, PluginHttp, PluginHttpAuthMode, PluginHttpHandler, PluginInteractionCancelReason, PluginInteractionRequest, PluginInteractionResult, PluginKvStorage, PluginLogger, PluginMentionItem, PluginMentionProviderRegistration, PluginMentionSearchContext, PluginMentionTrigger, PluginMessageActionContext, PluginMessageActionRegistration, PluginMessageActionThreadPanelOptions, PluginMessageDirectiveMessage, PluginMessageDirectiveOpenWorkspaceFile, PluginMessageDirectiveProps, PluginMessageDirectiveRegistration, PluginNavPanelProps, PluginNavPanelRegistration, PluginPendingInteractionProps, PluginPendingInteractionRegistration, PluginPendingInteractionView, PluginRealtime, PluginRealtimeConnectionState, PluginRpc, PluginRpcCallArgs, PluginRpcClient, PluginRpcContract, PluginRpcError, PluginRpcErrorCode, PluginRpcHandlers, PluginRpcIssuePathSegment, PluginRpcMethodContract, PluginRpcResult, PluginRpcValidationIssue, PluginSdkApp, PluginServerApi, PluginSettingDescriptor, PluginSettingDescriptors, PluginSettingValue, PluginSettings, PluginSettingsHandle, PluginSettingsSectionProps, PluginSettingsSectionRegistration, PluginSettingsState, PluginSettingsValues, PluginSharedPortTunnelIdentity, PluginSidebarFooterActionContext, PluginSidebarFooterActionProps, PluginSidebarFooterActionRegistration, PluginStatusApi, PluginStorage, PluginThreadActionContext, PluginThreadActionRegistration, PluginThreadActionResult, PluginThreadActionToast, PluginThreadEventHandler, PluginThreadEventName, PluginThreadEventPayloads, PluginThreadPanelActionContext, PluginThreadPanelActionRegistration, PluginThreadPanelProps, PluginUi, StandardSchemaV1, StandardSchemaV1InferInput, StandardSchemaV1InferOutput, StandardSchemaV1Issue, StandardSchemaV1Result, ThreadChatMessageAction, ThreadChatMessageReference, ThreadChatProps };\n"; +export const PLUGIN_SDK_DTS = "// Portable type declarations for `@bb/plugin-sdk`. Unpublished BB\n// workspace contracts are flattened; public subpaths may reuse the\n// package root without requiring any other @bb/* package.\n//\n// Confused by the API, or need a symbol that isn't here? Clone the BB repo\n// and read the real source: https://github.com/ymichael/bb\n\nimport { ComponentType, ReactNode } from 'react';\nimport Database from 'better-sqlite3';\nimport { Context } from 'hono';\nimport * as z from 'zod';\nimport { z as z$1 } from 'zod';\n\n/**\n * A value that survives a JSON round trip without coercion or data loss.\n *\n * Host boundaries still validate values at runtime because TypeScript cannot\n * exclude non-finite numbers and plugin bundles can bypass static types.\n */\ntype JsonValue$1 = string | number | boolean | null | JsonValue$1[] | {\n [key: string]: JsonValue$1;\n};\n\n/** A JSON-safe path segment reported by a Standard Schema validation issue. */\ntype PluginRpcIssuePathSegment = string | number;\n/** Validator-neutral validation detail carried by an RPC error envelope. */\ninterface PluginRpcValidationIssue {\n message: string;\n path?: PluginRpcIssuePathSegment[];\n}\n/** Stable wire error categories for plugin RPC. */\ntype PluginRpcErrorCode = \"invalid_json\" | \"invalid_input\" | \"handler_error\" | \"invalid_output\" | \"non_json_result\" | \"unknown_method\";\n/** Structured RPC failure returned as `{ ok: false, error }`. */\ninterface PluginRpcError {\n code: PluginRpcErrorCode;\n message: string;\n issues?: PluginRpcValidationIssue[];\n}\n/**\n * The validator-neutral subset of Standard Schema v1 used by plugin RPC.\n * Zod 4 schemas implement this interface directly; other validators can do\n * the same without becoming part of BB's public protocol.\n */\ninterface StandardSchemaV1 {\n readonly \"~standard\": {\n readonly version: 1;\n readonly vendor: string;\n readonly validate: (value: unknown) => StandardSchemaV1Result | Promise>;\n readonly types?: {\n readonly input: Input;\n readonly output: Output;\n };\n };\n}\ntype StandardSchemaV1Result = {\n readonly value: Output;\n readonly issues?: undefined;\n} | {\n readonly issues: readonly StandardSchemaV1Issue[];\n};\ninterface StandardSchemaV1Issue {\n readonly message: string;\n readonly path?: PropertyKey | readonly (PropertyKey | {\n readonly key: PropertyKey;\n })[];\n}\ntype StandardSchemaV1InferInput = NonNullable[\"input\"];\ntype StandardSchemaV1InferOutput = NonNullable[\"output\"];\ninterface PluginRpcMethodContract {\n readonly input: InputSchema;\n readonly output: OutputSchema;\n}\ntype PluginRpcContract = Readonly>;\n/** Define a shared RPC contract while preserving exact method/schema types. */\ndeclare function defineRpcContract(contract: Contract): Contract;\ntype PluginRpcHandlers = {\n [Method in keyof Contract]: (input: StandardSchemaV1InferOutput) => StandardSchemaV1InferInput | Promise>;\n};\ntype PluginRpcCallInput = StandardSchemaV1InferInput;\ntype PluginRpcCallArgs = null extends PluginRpcCallInput ? [input?: PluginRpcCallInput] : [input: PluginRpcCallInput];\ntype PluginRpcResult = StandardSchemaV1InferOutput;\n\n/**\n * The `@bb/plugin-sdk/app` contract (plugin design ยง5.2) โ€” pure types with no\n * side effects. The BB app imports these to keep its real implementation in\n * sync (`satisfies PluginSdkApp`). Plugin authors import the same shapes through\n * `@bb/plugin-sdk/app`.\n *\n * Per-slot props are versioned contracts: additive-only within an SDK major.\n */\n/** Props passed to a `homepageSection` component. */\ninterface PluginHomepageSectionProps {\n /** Project in view on the compose surface; null when none is selected. */\n projectId: string | null;\n}\n/**\n * Props passed to a `settingsSection` component.\n *\n * Deliberately empty in V1; versioned additive like the other slot props.\n */\ninterface PluginSettingsSectionProps {\n}\n/** Props passed to a `navPanel` component (it owns its whole route). */\ninterface PluginNavPanelProps {\n /**\n * The route remainder after the panel root, \"\" at the root. The panel's\n * route is `/plugins///*`, so a deep link like\n * `/plugins/notes/notes/work/ideas.md` renders the panel with\n * `subPath: \"work/ideas.md\"`. Navigate within the panel via\n * `useBbNavigate().toPluginPanel(path, { subPath })` โ€” browser\n * back/forward then walks panel-internal history.\n */\n subPath: string;\n}\n/** Props passed to a panel tab opened by a `threadPanelAction`. */\ninterface PluginThreadPanelProps {\n threadId: string;\n /**\n * The JSON value the action's `openPanel` call passed (round-tripped\n * through persistence, so the tab restores across reloads); null when the\n * action opened the panel without params.\n */\n params: JsonValue$1 | null;\n /**\n * Reveal a native user or assistant conversation message in this panel's\n * thread. The host loads older history and expands containing groups as\n * needed, centers the stable row, and resolves only after its canonical\n * prose root mounts. A message from another thread is reported as missing.\n */\n experimental_revealMessage(messageId: string): Promise<\"revealed\" | \"missing\">;\n}\ninterface PluginPendingInteractionView {\n id: string;\n threadId: string;\n title: string;\n payload: JsonValue$1;\n createdAt: number;\n expiresAt: number | null;\n}\ninterface PluginPendingInteractionProps {\n interaction: PluginPendingInteractionView;\n submit(value: JsonValue$1): Promise;\n cancel(): Promise;\n}\n/**\n * Props for a `sidebarFooterAction` โ€” host-rendered (no plugin component).\n * Deliberately empty; the registration's `run` carries the behavior.\n */\ninterface PluginSidebarFooterActionProps {\n}\n/**\n * Where a file being opened by a `fileOpener` lives. `path` semantics follow\n * the source: workspace paths are relative to the environment's worktree,\n * thread-storage paths are relative to the thread's storage root, host paths\n * are absolute on the thread's host.\n */\ninterface PluginFileOpenerSource {\n kind: \"workspace\" | \"host\" | \"thread-storage\";\n threadId: string | null;\n environmentId: string | null;\n projectId: string | null;\n}\n/** Props passed to a `fileOpener` component (rendered as a panel file tab). */\ninterface PluginFileOpenerProps {\n path: string;\n source: PluginFileOpenerSource;\n}\n/**\n * Message context passed to a `messageDirective` component โ€” the assistant\n * (or nested agent) message that contained the directive.\n */\ninterface PluginMessageDirectiveMessage {\n id: string;\n threadId: string;\n turnId: string | null;\n projectId: string | null;\n}\n/**\n * Open a worktree-relative file in the host's workspace file viewer. Returns\n * true when the host accepted the path; false when the path is invalid or the\n * viewer declined it.\n */\ntype PluginMessageDirectiveOpenWorkspaceFile = (path: string) => boolean;\n/**\n * Props passed to a `messageDirective` component. Attributes are untrusted\n * strings parsed from the directive; the plugin validates its own fields.\n */\ninterface PluginMessageDirectiveProps {\n /** Parsed, untrusted directive attributes (e.g. `{ file: \"demo.html\" }`). */\n attributes: Readonly>;\n /** Original directive source text (useful for diagnostics / crash fallback). */\n source: string;\n message: PluginMessageDirectiveMessage;\n /**\n * Opens a worktree-relative file in the host's workspace file viewer. Null\n * when the message surface has no workspace viewer available.\n */\n openWorkspaceFile: PluginMessageDirectiveOpenWorkspaceFile | null;\n}\ninterface PluginHomepageSectionRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n title: string;\n component: ComponentType;\n}\ninterface PluginSettingsSectionRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Optional host-rendered section heading. */\n title?: string;\n /**\n * Optional one-line host-rendered subheading under `title`, in the built-in\n * SettingsSection idiom (ignored when `title` is absent).\n */\n description?: string;\n component: ComponentType;\n}\ninterface PluginNavPanelRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n title: string;\n /** Icon hint (BB icon name); unknown names fall back to a generic icon. */\n icon: string;\n /** URL segment under `/plugins//`; letters, digits, `-`, `_`. */\n path: string;\n component: ComponentType;\n /**\n * Optional component rendered on the right side of the shared title bar\n * (e.g. a sync button or a count). Contained separately from the body: a\n * throwing headerContent is hidden without breaking the title bar.\n */\n headerContent?: ComponentType;\n}\n/** Context handed to a `threadPanelAction`'s `run`. */\ninterface PluginThreadPanelActionContext {\n /** The thread whose panel launcher invoked the action. */\n threadId: string;\n /**\n * Open a tab in the thread's side panel rendering this action's\n * `component`. `title` labels the tab (default: the action's `title`);\n * `params` must be JSON-serializable โ€” it is persisted with the tab and\n * reaches the component as its `params` prop. Opening with params\n * identical to an already-open tab of this action focuses that tab\n * (updating its title) instead of duplicating it. May be called more than\n * once (different params โ‡’ multiple tabs) or not at all.\n */\n openPanel(options?: {\n title?: string;\n params?: JsonValue$1;\n }): void;\n}\ninterface PluginThreadPanelActionRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Label of the action row in the panel's new-tab launcher. */\n title: string;\n /**\n * Icon hint (BB icon name) used when the plugin ships no logo; the\n * launcher row and opened tabs prefer the plugin's logo.\n */\n icon?: string;\n /** Rendered inside every panel tab this action opens. */\n component: ComponentType;\n /**\n * How the host frames the tab content. \"padded\" (default) wraps the\n * component in the panel's scroll container with standard padding โ€”\n * right for document-like content. \"flush\" gives the component the full\n * tab area (no padding, definite height, no host scrolling) โ€” right for\n * app-like content that manages its own layout, such as\n * `experimental_ThreadChat`.\n */\n layout?: \"padded\" | \"flush\";\n /**\n * Runs when the user activates the action: call your RPC methods, show a\n * toast, and/or open panel tabs via `context.openPanel`. Omitted =\n * immediately open a panel tab with defaults. Errors (sync or async) are\n * contained and logged; they never break the launcher.\n */\n run?(context: PluginThreadPanelActionContext): void | Promise;\n}\ninterface PluginPendingInteractionRegistration {\n /** Matches `rendererId` passed to `bb.ui.requestInput`. */\n id: string;\n component: ComponentType;\n}\n/** Context handed to a `sidebarFooterAction`'s `run`. */\ninterface PluginSidebarFooterActionContext {\n /**\n * Navigate to this plugin's detail page in Tools, where declarative settings\n * and `settingsSection` slots render.\n */\n openSettings(): void;\n}\n/**\n * An icon button in the app sidebar footer (next to Settings / bug report).\n * Host-rendered for consistent chrome โ€” plugins supply icon, label, and\n * `run` behavior only.\n */\ninterface PluginSidebarFooterActionRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Tooltip and accessible label for the icon button. */\n title: string;\n /** Icon hint (BB icon name); unknown names fall back to a generic icon. */\n icon: string;\n /**\n * Runs when the user activates the action (e.g. call `openSettings()`,\n * open a panel via other surfaces, toast). Errors (sync or async) are\n * contained and logged; they never break the sidebar.\n */\n run(context: PluginSidebarFooterActionContext): void | Promise;\n}\n/**\n * Register this plugin as a viewer/editor for file extensions. The user\n * picks (and can set as default) an opener per extension via the file tab's\n * \"Open with\" menu; matching files opened in the panel then render\n * `component` in a plugin tab instead of the built-in preview. Applies to\n * working-tree, host, and thread-storage files โ€” never to git-ref snapshots\n * (diff views always use the built-in preview). The built-in preview stays\n * one menu click away, and a missing/disabled opener falls back to it.\n */\ninterface PluginFileOpenerRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Label in the \"Open with\" menu (e.g. \"Notes editor\"). */\n title: string;\n /** Lowercase extensions without the dot (e.g. [\"md\", \"mdx\"]). */\n extensions: readonly string[];\n component: ComponentType;\n}\n/**\n * Register a leaf message directive rendered inside assistant (and nested\n * agent) message Markdown. `id` is the directive name: `inline-vis` matches\n * `::inline-vis{file=\"demo.html\"}`.\n */\ninterface PluginMessageDirectiveRegistration {\n /**\n * The directive name. Lowercase kebab-case beginning with a letter.\n */\n id: string;\n component: ComponentType;\n}\n/**\n * A narrow, stable reference to one rendered chat message โ€” NOT an internal\n * timeline row. `sourceSeqEnd` is the last source event sequence the message\n * covers, the anchor the server accepts for provider-history forks.\n */\ninterface ThreadChatMessageReference {\n id: string;\n threadId: string;\n role: \"user\" | \"assistant\";\n /** Visible text of the message. */\n text: string;\n sourceSeqEnd: number;\n}\ninterface PluginMessageActionThreadPanelOptions {\n /** A `threadPanelAction` id registered by this same plugin. */\n actionId: string;\n title?: string;\n params?: JsonValue$1;\n}\n/** Where a plugin message action is rendered by host chrome. */\ntype experimental_PluginMessageActionPlacement = \"action-bar\" | \"selection-menu\";\n/**\n * A stable rendered-text selector captured inside one canonical message prose\n * root. Offsets index the concatenation of descendant DOM text nodes in DOM\n * order and therefore survive Markdown element boundaries.\n */\ninterface experimental_PluginRenderedTextSelection {\n version: 1;\n coordinateSpace: \"rendered-text-utf16\";\n start: number;\n end: number;\n exact: string;\n /** At most 32 UTF-16 code units, never ending inside a surrogate pair. */\n prefix: string;\n /** At most 32 UTF-16 code units, never starting inside a surrogate pair. */\n suffix: string;\n /** Viewport-relative line-fragment rectangles for the captured range. */\n rects: readonly {\n x: number;\n y: number;\n width: number;\n height: number;\n }[];\n}\n/** Context handed to a `messageAction`'s `run`. */\ninterface PluginMessageActionContext {\n /** The thread whose timeline surfaced the action. */\n threadId: string;\n message: ThreadChatMessageReference;\n /**\n * Present only when the action was invoked from the text-selection menu;\n * the exact text the user highlighted inside `message`.\n */\n selectedText?: string;\n /**\n * Present with `selectedText` for selection-menu invocations. Omitted for\n * action-bar invocations. `experimental_selection.exact` always equals\n * `selectedText`.\n */\n experimental_selection?: experimental_PluginRenderedTextSelection;\n /**\n * Open one of this plugin's `threadPanelAction` components in the current\n * thread's side panel โ€” the registration-callback equivalent of\n * `useBbNavigate().experimental_openThreadPanel`. Returns true when the host\n * accepted (the action id exists and the surface has a panel); false\n * otherwise.\n */\n openPanel(options: PluginMessageActionThreadPanelOptions): boolean;\n}\n/**\n * An action on chat messages: an icon button in the per-message action bar\n * (user and assistant messages) and an entry in the assistant-message\n * text-selection menu. Host-rendered chrome โ€” the plugin supplies title,\n * icon hint, and `run` behavior only.\n */\ninterface PluginMessageActionRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Tooltip / menu label for the action. */\n title: string;\n /** Icon hint (BB icon name); unknown names fall back to a generic icon. */\n icon?: string;\n /**\n * Host placements where the action appears. Omission preserves the legacy\n * behavior of rendering in both the per-message action bar and the floating\n * selection menu.\n */\n experimental_placements?: readonly experimental_PluginMessageActionPlacement[];\n /**\n * Runs when the user activates the action. Errors (sync or async) are\n * contained and logged; they never break the timeline.\n */\n run(context: PluginMessageActionContext): void | Promise;\n}\ninterface PluginAppSlots {\n homepageSection(registration: PluginHomepageSectionRegistration): void;\n settingsSection(registration: PluginSettingsSectionRegistration): void;\n navPanel(registration: PluginNavPanelRegistration): void;\n threadPanelAction(registration: PluginThreadPanelActionRegistration): void;\n pendingInteraction(registration: PluginPendingInteractionRegistration): void;\n sidebarFooterAction(registration: PluginSidebarFooterActionRegistration): void;\n fileOpener(registration: PluginFileOpenerRegistration): void;\n messageDirective(registration: PluginMessageDirectiveRegistration): void;\n experimental_messageAction(registration: PluginMessageActionRegistration): void;\n}\ninterface PluginAppComposer {\n customize(registration: ComposerCustomization): void;\n}\n/** Stable lifecycle values for one content-script instance in one bb client. */\ninterface PluginContentScriptContext {\n /** The id of the plugin that owns this script. */\n readonly pluginId: string;\n /** Monotonic per-client generation, starting at 1. */\n readonly generation: number;\n /** Aborted before cleanup begins on replacement, deactivation, or teardown. */\n readonly signal: AbortSignal;\n /** Plugin-scoped schema-validated RPC transport. */\n readonly experimental_rpc: PluginRpcClient;\n /** Plugin-scoped realtime signals and shared socket lifecycle. */\n readonly experimental_realtime: {\n subscribe(channel: string, handler: (payload: unknown) => void): PluginContentScriptDisposer;\n getConnectionState(): PluginRealtimeConnectionState;\n subscribeConnectionState(handler: (state: PluginRealtimeConnectionState) => void): PluginContentScriptDisposer;\n };\n /** Imperative navigation available outside a React slot. */\n readonly experimental_navigate: Pick;\n}\n/** Cleanup returned by a frontend content script. */\ntype PluginContentScriptDisposer = () => void | Promise;\n/**\n * Trusted same-origin JavaScript/TypeScript mounted once per active frontend\n * generation in each bb app window or browser tab.\n */\ninterface PluginContentScriptRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /**\n * Install behavior into the bb app shell. The host awaits a returned\n * promise, contains failures, and calls the returned disposer exactly once.\n */\n mount(context: PluginContentScriptContext): void | PluginContentScriptDisposer | Promise;\n}\n/** Experimental lifecycle surface for trusted frontend content scripts. */\ninterface PluginAppContentScripts {\n register(registration: PluginContentScriptRegistration): void;\n}\ninterface PluginAppBuilder {\n slots: PluginAppSlots;\n composer: PluginAppComposer;\n experimental_contentScripts: PluginAppContentScripts;\n}\ntype PluginAppSetup = (app: PluginAppBuilder) => void;\n/**\n * The opaque product of `definePluginApp` โ€” a plugin's `app.tsx` default\n * export. The host re-runs `setup` against a fresh collector on every\n * (re)interpretation, replacing that plugin's registrations wholesale.\n */\ninterface PluginAppDefinition {\n /** Brand the host checks before interpreting a bundle's default export. */\n readonly __bbPluginApp: true;\n readonly setup: PluginAppSetup;\n}\ninterface PluginRpcClient {\n /**\n * Invoke one of the plugin's `bb.rpc` methods (POST\n * /api/v1/plugins/<id>/rpc/<method>). Resolves with the method's\n * inferred output; rejects with an `Error` carrying the server's message,\n * stable `code`, and validation `issues` when present.\n */\n call>(method: Method, ...args: PluginRpcCallArgs): Promise>;\n}\ninterface PluginSettingsState {\n /**\n * Effective non-secret setting values (secret settings are excluded โ€”\n * read them server-side). Undefined while loading or unavailable.\n */\n values: Record | undefined;\n isLoading: boolean;\n}\n/** State of the app's shared realtime connection to the bb server. */\ntype PluginRealtimeConnectionState = \"connecting\" | \"connected\" | \"reconnecting\";\n/** Where `useComposer()` writes. */\ntype PluginComposerScope = {\n kind: \"thread\";\n threadId: string;\n} | {\n kind: \"queued-message\";\n threadId: string;\n queuedMessageId: string;\n} | {\n kind: \"side-chat\";\n projectId: string;\n parentThreadId: string;\n tabId: string;\n childThreadId: string | null;\n} | {\n kind: \"new-thread\";\n /** Root compose's effective selected project; null only while unresolved. */\n projectId: string | null;\n};\n/** One plugin-owned composer customization registration. */\ninterface ComposerCustomization {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Composer kinds where this customization is active; omit for all kinds. */\n scopes?: readonly PluginComposerScope[\"kind\"][];\n actions?: readonly {\n id: string;\n component: ComponentType;\n }[];\n banners?: readonly {\n id: string;\n /** Host chrome around the banner. Defaults to `\"card\"`. */\n chrome?: \"card\" | \"bare\";\n component: ComponentType;\n }[];\n plusMenu?: readonly ComposerPlusMenuItem[];\n richText?: ComposerRichTextSpec;\n}\n/** Host-rendered menu row in the composer's `+` menu. */\ninterface ComposerPlusMenuItem {\n id: string;\n label: string;\n /** BB icon name; unknown names fall back to the generic plugin icon. */\n icon?: string;\n /** Accessible description for the host-rendered row. */\n description?: string;\n disabled?: boolean | ((view: ComposerView) => boolean);\n run(context: {\n composer: PluginComposerApi;\n view: ComposerView;\n }): void | Promise;\n}\n/** Reactive read-side of the composer a plugin surface is mounted in. */\ninterface ComposerView {\n scope: PluginComposerScope;\n layout: \"expanded\" | \"compact\" | \"zen\";\n draft: {\n text: string;\n isEmpty: boolean;\n attachmentCount: number;\n };\n run: {\n isRunning: boolean;\n isSubmitting: boolean;\n };\n}\ninterface ComposerRichTextSpec {\n /** Content-derived paint: match ranges receive `className`; text is never mutated. */\n effects?: readonly {\n id: string;\n /** Plain-text offsets into the current structured draft. */\n match(text: string): readonly {\n from: number;\n to: number;\n }[];\n className: string;\n }[];\n /** Debounced, read-only observation of the structured draft. */\n onDraftChange?(draft: ComposerStructuredDraft, view: ComposerView): void;\n}\ninterface ComposerStructuredDraft {\n text: string;\n mentions: readonly {\n from: number;\n to: number;\n provider: string;\n id: string;\n label: string;\n }[];\n}\n/** Host-rendered paint applied to the editable composer text. */\ninterface PluginComposerTextEffect {\n className: string;\n}\n/** Host-rendered status that temporarily replaces a thread's draft glyph. */\ninterface PluginComposerThreadRowStatus {\n /** BB icon-name hint; unknown names fall back to the generic plugin icon. */\n icon: string;\n /** Accessible label for the status glyph. */\n label: string;\n /**\n * Semantic host treatment for the status glyph. `running` automatically\n * shimmers; terminal `success` and `error` tones are static. Defaults to the\n * neutral tone.\n */\n tone?: \"default\" | \"running\" | \"success\" | \"error\";\n}\n/** An @-mention pill bound to one of the calling plugin's mention providers. */\ninterface PluginComposerMention {\n /** Mention provider id registered by THIS plugin via `bb.ui.registerMentionProvider`. */\n provider: string;\n /** Item id your provider's `resolve` will receive at send time. */\n id: string;\n /** Pill text shown in the composer. */\n label: string;\n}\n/**\n * Programmatic access to the chat composer draft โ€” the same shared draft the\n * built-in \"Add to chat\" affordances (file preview, diff, terminal selections)\n * write to. While a queued message is being edited, writes land in that\n * message's inline editor. In a side chat, writes land in the visible side-chat\n * draft. Otherwise, inside a thread context writes land in that thread's draft;\n * anywhere else (nav panel, homepage section) they seed the new-thread composer\n * draft, which persists until the user sends or clears it.\n */\ninterface PluginComposerApi {\n scope: PluginComposerScope;\n /** Current plain text for this composer scope. */\n readonly text: string;\n /**\n * Replace the draft's plain text. Attachments are preserved. Inline mentions\n * outside the changed range are preserved and rebased; mentions overlapped\n * by the replacement are removed because their text representation changed.\n */\n setText(next: string): void;\n /**\n * Replace the draft's plain text from the latest committed value. Uses the\n * same structured-state reconciliation as `setText`.\n */\n updateText(updater: (current: string) => string): void;\n /** Clear plain text without clearing independently attached files. */\n clear(): void;\n /**\n * Apply a host-rendered effect to this composer's editable text, or clear it.\n * Effects are scoped to the calling plugin and automatically clear when the\n * slot unmounts or its composer scope changes.\n */\n setTextEffect(effect: PluginComposerTextEffect | null): void;\n /**\n * Lock or unlock editing for this composer. Locks are scoped to the calling\n * plugin and automatically release when the slot unmounts or its composer\n * scope changes.\n */\n setInputLock(locked: boolean): void;\n /**\n * Replace this composer's thread-row draft glyph with a host-rendered status,\n * or clear it. New-thread composers have no row, so calls are a no-op.\n * Side-chat and queued side-chat scopes decorate the visible parent-thread\n * row. Status is scoped to the calling plugin and automatically clears when\n * the slot unmounts or its composer scope changes.\n */\n setThreadRowStatus(status: PluginComposerThreadRowStatus | null): void;\n /**\n * Append text to the draft as a `> ` blockquote block and focus the\n * composer. Blank text is a no-op. This is the \"reference this selection\n * in chat\" primitive.\n */\n addQuote(text: string): void;\n /**\n * Insert an @-mention pill that resolves through this plugin's mention\n * provider at send time โ€” the durable way to reference an entity whose\n * content should be fetched fresh when the message is sent.\n */\n insertMention(mention: PluginComposerMention): void;\n /** Focus the composer caret at the end of the draft. */\n focus(): void;\n}\n/**\n * A consumer-supplied action on the messages of one `ThreadChat` instance,\n * rendered in the embedded timeline's per-message action bar alongside the\n * native and slot-registered actions. Unlike the `messageAction` slot this is\n * scoped to the rendering component, not registered globally.\n */\ninterface ThreadChatMessageAction {\n /** Unique within this ThreadChat instance; letters, digits, `-`, `_`. */\n id: string;\n /** Tooltip / menu label for the action. */\n title: string;\n /** Icon hint (BB icon name); unknown names fall back to a generic icon. */\n icon?: string;\n /**\n * Message roles the action applies to. Omitted = both user and assistant\n * messages.\n */\n roles?: readonly (\"user\" | \"assistant\")[];\n /**\n * Runs when the user activates the action. Errors (sync or async) are\n * contained and logged; they never break the timeline.\n */\n run(message: ThreadChatMessageReference): void | Promise;\n}\n/**\n * Props of the host-owned `ThreadChat` component โ€” one thread's chat\n * (timeline, and for the composer variants the full send/queue/draft\n * engine), rendered by the BB app inside a plugin slot. This is the\n * deliberate exception to the no-host-components rule (ยง5.5): a stable\n * product capability, not a UI kit. Versioned additive like slot props;\n * internal timeline rows, query hooks, and prompt-box configuration are\n * deliberately not exposed.\n */\ninterface ThreadChatProps {\n threadId: string;\n /**\n * \"full\" (default) is the page presentation (centered reading width);\n * \"compact\" is the side-panel presentation; \"timeline\" renders the\n * transcript without a composer.\n */\n variant?: \"full\" | \"compact\" | \"timeline\";\n /**\n * \"contained\" (default) fills and scrolls inside a bounded parent;\n * \"document\" grows with its content and defers scrolling to the page.\n */\n layout?: \"contained\" | \"document\";\n /** Bump to focus the composer (ignored by `variant: \"timeline\"`). */\n focusRequest?: number;\n className?: string;\n /** Rendered above the conversation, scrolling with it. */\n leadingContent?: ReactNode;\n /**\n * Actions rendered in this instance's per-message action bar (see\n * {@link ThreadChatMessageAction}).\n */\n messageActions?: readonly ThreadChatMessageAction[];\n}\n/**\n * Props of the host-owned `Markdown` component โ€” bb's chat message renderer\n * (the same typography, spacing, and code styling as timeline messages).\n * Use it wherever plugin UI quotes or previews message content so it reads\n * like the rest of the chat. Like `ThreadChat`, this is a stable product\n * capability, not a UI kit; renderer internals stay private.\n */\ninterface MarkdownProps {\n /** Markdown source, rendered exactly like a chat message body. */\n content: string;\n className?: string;\n}\n/** Current app selection, derived from the route. */\ninterface BbContext {\n projectId: string | null;\n threadId: string | null;\n}\ninterface BbNavigate {\n toThread(threadId: string): void;\n toProject(projectId: string): void;\n /**\n * Navigate to one of this plugin's own nav panels by its `path`.\n * `subPath` targets a location inside the panel (the component's\n * `subPath` prop); `replace` swaps the current history entry instead of\n * pushing โ€” use it for redirects so back does not bounce.\n */\n toPluginPanel(path: string, options?: {\n subPath?: string;\n replace?: boolean;\n }): void;\n /**\n * Navigate to the root compose surface (the new-thread screen). Pass\n * `initialPrompt` to seed the composer draft and `focusPrompt` to focus the\n * composer on arrival โ€” the pairing behind \"Create via chat\" style entry\n * points that drop the user into chat with a prefilled prompt.\n */\n toCompose(options?: {\n initialPrompt?: string;\n focusPrompt?: boolean;\n }): void;\n /**\n * Open one of this plugin's registered thread-panel actions in the current\n * thread surface. Returns false when the surface has no thread side panel or\n * the action is unavailable.\n */\n experimental_openThreadPanel(options: {\n actionId: string;\n title?: string;\n params?: JsonValue$1;\n }): boolean;\n}\n/**\n * Everything `@bb/plugin-sdk/app` resolves to at runtime. The BB app builds\n * the real implementation and `satisfies` this interface; `bb plugin build`\n * shims the specifier to that object on `globalThis.__bbPluginRuntime`.\n */\ninterface PluginSdkApp {\n definePluginApp(setup: PluginAppSetup): PluginAppDefinition;\n useRpc(): PluginRpcClient;\n useRealtime(channel: string, handler: (payload: unknown) => void): void;\n /**\n * Observe the same shared connection that delivers `useRealtime` signals.\n * Use a subsequent transition to `connected` to reconcile server state that\n * may have changed while ephemeral signals could not be delivered. The first\n * connection can transition from `connecting` and is not a reconnection.\n */\n useRealtimeConnectionState(): PluginRealtimeConnectionState;\n useSettings(): PluginSettingsState;\n useBbContext(): BbContext;\n useBbNavigate(): BbNavigate;\n useComposer(): PluginComposerApi;\n /**\n * The host-owned chat component (see {@link ThreadChatProps}). Together\n * with `Markdown`, the only components the SDK ships โ€” everything else\n * stays vendored per ยง5.5.\n */\n experimental_ThreadChat: ComponentType;\n /**\n * The host-owned chat-message markdown renderer (see\n * {@link MarkdownProps}).\n */\n experimental_Markdown: ComponentType;\n useComposerView(): ComposerView;\n}\n\n/**\n * App-wide server-backed preferences.\n * Client-local settings stay in the frontend localStorage helpers instead.\n */\ndeclare const appSettingsSchema: z$1.ZodObject<{\n caffeinate: z$1.ZodBoolean;\n showKeyboardHints: z$1.ZodBoolean;\n showUnhandledProviderEvents: z$1.ZodBoolean;\n codexMemoryEnabled: z$1.ZodBoolean;\n claudeCodeMemoryEnabled: z$1.ZodBoolean;\n codexSubagentsDisabled: z$1.ZodBoolean;\n claudeCodeSubagentsDisabled: z$1.ZodBoolean;\n claudeCodeWorkflowsDisabled: z$1.ZodBoolean;\n}, z$1.core.$strict>;\ntype AppSettings = z$1.infer;\n\ndeclare const appKeybindingOverridesSchema: z$1.ZodArray;\n shortcut: z$1.ZodNullable>;\n}, z$1.core.$strict>>;\ntype AppKeybindingOverrides = z$1.infer;\n\ndeclare const appThemeSchema: z$1.ZodObject<{\n themeId: z$1.ZodString;\n customCss: z$1.ZodNullable;\n faviconColor: z$1.ZodEnum<{\n default: \"default\";\n red: \"red\";\n orange: \"orange\";\n yellow: \"yellow\";\n green: \"green\";\n teal: \"teal\";\n blue: \"blue\";\n purple: \"purple\";\n pink: \"pink\";\n }>;\n}, z$1.core.$strip>;\ntype AppTheme = z$1.infer;\n/**\n * The complete appearance selection a client sends when changing the palette\n * and/or favicon tint. The server validates `themeId` (built-in id or an\n * existing custom theme) and resolves the CSS from disk for custom themes.\n * Callers changing only one facet must carry the other facet forward explicitly.\n */\ndeclare const appThemeSelectionSchema: z$1.ZodObject<{\n themeId: z$1.ZodString;\n faviconColor: z$1.ZodEnum<{\n default: \"default\";\n red: \"red\";\n orange: \"orange\";\n yellow: \"yellow\";\n green: \"green\";\n teal: \"teal\";\n blue: \"blue\";\n purple: \"purple\";\n pink: \"pink\";\n }>;\n}, z$1.core.$strip>;\ntype AppThemeSelection = z$1.infer;\n\ndeclare const changedMessageSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"changed\">;\n entity: z$1.ZodLiteral<\"thread\">;\n id: z$1.ZodOptional;\n metadata: z$1.ZodOptional;\n eventTypes: z$1.ZodOptional>>>>;\n hasPendingInteraction: z$1.ZodOptional;\n projectId: z$1.ZodOptional;\n }, z$1.core.$strict>>;\n changes: z$1.ZodReadonly>>;\n}, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"changed\">;\n entity: z$1.ZodLiteral<\"project\">;\n id: z$1.ZodOptional;\n changes: z$1.ZodReadonly>>;\n}, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"changed\">;\n entity: z$1.ZodLiteral<\"environment\">;\n id: z$1.ZodOptional;\n changes: z$1.ZodReadonly>>;\n}, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"changed\">;\n entity: z$1.ZodLiteral<\"host\">;\n id: z$1.ZodOptional;\n changes: z$1.ZodReadonly>>;\n}, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"changed\">;\n entity: z$1.ZodLiteral<\"system\">;\n changes: z$1.ZodReadonly>>;\n}, z$1.core.$strict>], \"entity\">;\ntype ChangedMessage = z$1.infer;\n\ndeclare const environmentSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n name: z$1.ZodNullable;\n projectId: z$1.ZodString;\n hostId: z$1.ZodString;\n path: z$1.ZodNullable;\n managed: z$1.ZodBoolean;\n isGitRepo: z$1.ZodBoolean;\n isWorktree: z$1.ZodBoolean;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n branchName: z$1.ZodNullable;\n baseBranch: z$1.ZodNullable;\n defaultBranch: z$1.ZodNullable;\n mergeBaseBranch: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n error: \"error\";\n provisioning: \"provisioning\";\n ready: \"ready\";\n retiring: \"retiring\";\n destroying: \"destroying\";\n destroyed: \"destroyed\";\n }>;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype Environment = z$1.infer;\n\n/**\n * User-opt-in experiments (the Settings โ†’ Experiments toggles). Distinct from\n * `FeatureFlags`: flags are operator-set via env at server start, experiments\n * are user-toggled at runtime and persisted server-side so server-owned\n * policy (e.g. skill injection) can honor them.\n *\n * Every experiment defaults to off โ€” opting in is the point.\n */\ndeclare const experimentsSchema: z$1.ZodObject<{\n claudeCodeMockCliTraffic: z$1.ZodBoolean;\n plugins: z$1.ZodBoolean;\n toolsHub: z$1.ZodBoolean;\n sideChatPlugin: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype Experiments = z$1.infer;\n\ndeclare const hostSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n name: z$1.ZodString;\n type: z$1.ZodEnum<{\n persistent: \"persistent\";\n }>;\n status: z$1.ZodEnum<{\n connected: \"connected\";\n disconnected: \"disconnected\";\n }>;\n lastSeenAt: z$1.ZodNullable;\n lastRejectedProtocolVersion: z$1.ZodNullable;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype Host = z$1.infer;\n\ninterface JsonObject {\n [key: string]: JsonValue;\n}\ntype JsonValue = string | number | boolean | null | JsonValue[] | JsonObject;\n\ndeclare const pendingInteractionResolutionSchema: z$1.ZodUnion;\n grantedPermissions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"allow_for_session\">;\n grantedPermissions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"deny\">;\n}, z$1.core.$strip>], \"decision\">, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"user_answer\">;\n answers: z$1.ZodRecord;\n freeText: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin_submitted\">;\n}, z$1.core.$strip>]>;\ntype PendingInteractionResolution = z$1.infer;\ndeclare const providerPendingInteractionSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n resolving: \"resolving\";\n resolved: \"resolved\";\n interrupted: \"interrupted\";\n }>;\n statusReason: z$1.ZodNullable;\n createdAt: z$1.ZodNumber;\n expiresAt: z$1.ZodOptional>;\n resolvedAt: z$1.ZodNullable;\n turnId: z$1.ZodString;\n providerId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n providerRequestId: z$1.ZodString;\n origin: z$1.ZodOptional;\n providerId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n providerRequestId: z$1.ZodString;\n }, z$1.core.$strip>>;\n payload: z$1.ZodUnion;\n subject: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n itemId: z$1.ZodString;\n command: z$1.ZodString;\n cwd: z$1.ZodNullable;\n actions: z$1.ZodArray;\n command: z$1.ZodString;\n name: z$1.ZodString;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"listFiles\">;\n command: z$1.ZodString;\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"search\">;\n command: z$1.ZodString;\n query: z$1.ZodNullable;\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"unknown\">;\n command: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">>;\n sessionGrant: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"file_change\">;\n itemId: z$1.ZodString;\n writeScope: z$1.ZodNullable;\n sessionGrant: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"permission_grant\">;\n itemId: z$1.ZodString;\n toolName: z$1.ZodNullable;\n permissions: z$1.ZodObject<{\n network: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>;\n }, z$1.core.$strip>], \"kind\">;\n reason: z$1.ZodNullable;\n availableDecisions: z$1.ZodArray>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"user_question\">;\n questions: z$1.ZodArray;\n multiSelect: z$1.ZodBoolean;\n options: z$1.ZodOptional;\n }, z$1.core.$strip>>>;\n allowFreeText: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>]>;\n resolution: z$1.ZodNullable;\n grantedPermissions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"allow_for_session\">;\n grantedPermissions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"deny\">;\n }, z$1.core.$strip>], \"decision\">, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"user_answer\">;\n answers: z$1.ZodRecord;\n freeText: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>]>>;\n}, z$1.core.$strip>;\ntype ProviderPendingInteraction = z$1.infer;\ndeclare const pluginPendingInteractionSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n resolving: \"resolving\";\n resolved: \"resolved\";\n interrupted: \"interrupted\";\n }>;\n statusReason: z$1.ZodNullable;\n createdAt: z$1.ZodNumber;\n expiresAt: z$1.ZodOptional>;\n resolvedAt: z$1.ZodNullable;\n turnId: z$1.ZodNullable;\n origin: z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n rendererId: z$1.ZodString;\n }, z$1.core.$strip>;\n payload: z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n title: z$1.ZodString;\n data: z$1.ZodType>;\n }, z$1.core.$strip>;\n resolution: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype PluginPendingInteraction = z$1.infer;\ntype PendingInteraction = ProviderPendingInteraction | PluginPendingInteraction;\n\ndeclare const projectSourceSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n projectId: z$1.ZodString;\n isDefault: z$1.ZodBoolean;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n type: z$1.ZodLiteral<\"local_path\">;\n hostId: z$1.ZodString;\n path: z$1.ZodString;\n}, z$1.core.$strip>;\ntype ProjectSource = z$1.infer;\n\ndeclare const resolvedThreadExecutionOptionsSchema: z$1.ZodObject<{\n seq: z$1.ZodOptional;\n model: z$1.ZodString;\n serviceTier: z$1.ZodEnum<{\n default: \"default\";\n fast: \"fast\";\n }>;\n reasoningLevel: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n permissionMode: z$1.ZodEnum<{\n full: \"full\";\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n }>;\n source: z$1.ZodEnum<{\n \"client/thread/start\": \"client/thread/start\";\n \"client/turn/requested\": \"client/turn/requested\";\n \"client/turn/start\": \"client/turn/start\";\n }>;\n}, z$1.core.$strip>;\ntype ResolvedThreadExecutionOptions = z$1.infer;\ndeclare const projectExecutionDefaultsSchema: z$1.ZodObject<{\n providerId: z$1.ZodString;\n model: z$1.ZodString;\n serviceTier: z$1.ZodEnum<{\n default: \"default\";\n fast: \"fast\";\n }>;\n reasoningLevel: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n permissionMode: z$1.ZodEnum<{\n full: \"full\";\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n }>;\n}, z$1.core.$strip>;\ntype ProjectExecutionDefaults = z$1.infer;\n\n/** All thread events โ€” provider-originated or system-originated. */\ndeclare const threadEventSchema: z$1.ZodPipe;\n threadId: z$1.ZodString;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"thread/identity\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"turn/started\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"turn/completed\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n }>;\n error: z$1.ZodOptional>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"turn/input/accepted\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n clientRequestId: z$1.ZodString;\n scope: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"turn\">;\n turnId: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">;\n}, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"thread/name/updated\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n threadName: z$1.ZodString;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"thread/compacted\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"thread/goal/updated\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n objective: z$1.ZodString;\n status: z$1.ZodEnum<{\n paused: \"paused\";\n active: \"active\";\n budgetLimited: \"budgetLimited\";\n complete: \"complete\";\n }>;\n tokenBudget: z$1.ZodNullable;\n tokensUsed: z$1.ZodNumber;\n timeUsedSeconds: z$1.ZodNumber;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"thread/goal/cleared\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/started\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n item: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"userMessage\">;\n id: z$1.ZodString;\n content: z$1.ZodArray;\n text: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">>;\n clientRequestId: z$1.ZodOptional;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"agentMessage\">;\n id: z$1.ZodString;\n text: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"commandExecution\">;\n id: z$1.ZodString;\n command: z$1.ZodString;\n cwd: z$1.ZodString;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n }>;\n approvalStatus: z$1.ZodNullable>;\n aggregatedOutput: z$1.ZodOptional;\n exitCode: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n truncation: z$1.ZodOptional>;\n result: z$1.ZodOptional>;\n resultText: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"fileChange\">;\n id: z$1.ZodString;\n changes: z$1.ZodArray;\n movePath: z$1.ZodOptional;\n diff: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n }>;\n approvalStatus: z$1.ZodNullable>;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"webSearch\">;\n id: z$1.ZodString;\n queries: z$1.ZodArray;\n resultText: z$1.ZodNullable;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"webFetch\">;\n id: z$1.ZodString;\n url: z$1.ZodString;\n prompt: z$1.ZodNullable;\n pattern: z$1.ZodNullable;\n resultText: z$1.ZodNullable;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"imageView\">;\n id: z$1.ZodString;\n path: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"toolCall\">;\n id: z$1.ZodString;\n server: z$1.ZodOptional;\n tool: z$1.ZodString;\n arguments: z$1.ZodOptional>;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n }>;\n result: z$1.ZodOptional;\n error: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n truncation: z$1.ZodOptional>;\n result: z$1.ZodOptional>;\n resultText: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"reasoning\">;\n id: z$1.ZodString;\n summary: z$1.ZodArray;\n content: z$1.ZodArray;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"plan\">;\n id: z$1.ZodString;\n text: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"contextCompaction\">;\n id: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"backgroundTask\">;\n id: z$1.ZodString;\n taskType: z$1.ZodString;\n description: z$1.ZodString;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n }>;\n taskStatus: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n running: \"running\";\n paused: \"paused\";\n failed: \"failed\";\n killed: \"killed\";\n stopped: \"stopped\";\n }>;\n skipTranscript: z$1.ZodBoolean;\n workflowName: z$1.ZodOptional;\n workflow: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n agents: z$1.ZodArray;\n model: z$1.ZodString;\n attempt: z$1.ZodNumber;\n cached: z$1.ZodBoolean;\n lastProgressAt: z$1.ZodNumber;\n phaseIndex: z$1.ZodOptional;\n phaseTitle: z$1.ZodOptional;\n agentType: z$1.ZodOptional;\n isolation: z$1.ZodOptional;\n queuedAt: z$1.ZodOptional;\n startedAt: z$1.ZodOptional;\n lastToolName: z$1.ZodOptional;\n lastToolSummary: z$1.ZodOptional;\n promptPreview: z$1.ZodOptional;\n resultPreview: z$1.ZodOptional;\n error: z$1.ZodOptional;\n tokens: z$1.ZodOptional;\n toolCalls: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n usage: z$1.ZodOptional>;\n summary: z$1.ZodOptional;\n error: z$1.ZodOptional;\n outputFile: z$1.ZodOptional;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/completed\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n item: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"userMessage\">;\n id: z$1.ZodString;\n content: z$1.ZodArray;\n text: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">>;\n clientRequestId: z$1.ZodOptional;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"agentMessage\">;\n id: z$1.ZodString;\n text: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"commandExecution\">;\n id: z$1.ZodString;\n command: z$1.ZodString;\n cwd: z$1.ZodString;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n }>;\n approvalStatus: z$1.ZodNullable>;\n aggregatedOutput: z$1.ZodOptional;\n exitCode: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n truncation: z$1.ZodOptional>;\n result: z$1.ZodOptional>;\n resultText: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"fileChange\">;\n id: z$1.ZodString;\n changes: z$1.ZodArray;\n movePath: z$1.ZodOptional;\n diff: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n }>;\n approvalStatus: z$1.ZodNullable>;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"webSearch\">;\n id: z$1.ZodString;\n queries: z$1.ZodArray;\n resultText: z$1.ZodNullable;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"webFetch\">;\n id: z$1.ZodString;\n url: z$1.ZodString;\n prompt: z$1.ZodNullable;\n pattern: z$1.ZodNullable;\n resultText: z$1.ZodNullable;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"imageView\">;\n id: z$1.ZodString;\n path: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"toolCall\">;\n id: z$1.ZodString;\n server: z$1.ZodOptional;\n tool: z$1.ZodString;\n arguments: z$1.ZodOptional>;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n }>;\n result: z$1.ZodOptional;\n error: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n truncation: z$1.ZodOptional>;\n result: z$1.ZodOptional>;\n resultText: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"reasoning\">;\n id: z$1.ZodString;\n summary: z$1.ZodArray;\n content: z$1.ZodArray;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"plan\">;\n id: z$1.ZodString;\n text: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"contextCompaction\">;\n id: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"backgroundTask\">;\n id: z$1.ZodString;\n taskType: z$1.ZodString;\n description: z$1.ZodString;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n }>;\n taskStatus: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n running: \"running\";\n paused: \"paused\";\n failed: \"failed\";\n killed: \"killed\";\n stopped: \"stopped\";\n }>;\n skipTranscript: z$1.ZodBoolean;\n workflowName: z$1.ZodOptional;\n workflow: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n agents: z$1.ZodArray;\n model: z$1.ZodString;\n attempt: z$1.ZodNumber;\n cached: z$1.ZodBoolean;\n lastProgressAt: z$1.ZodNumber;\n phaseIndex: z$1.ZodOptional;\n phaseTitle: z$1.ZodOptional;\n agentType: z$1.ZodOptional;\n isolation: z$1.ZodOptional;\n queuedAt: z$1.ZodOptional;\n startedAt: z$1.ZodOptional;\n lastToolName: z$1.ZodOptional;\n lastToolSummary: z$1.ZodOptional;\n promptPreview: z$1.ZodOptional;\n resultPreview: z$1.ZodOptional;\n error: z$1.ZodOptional;\n tokens: z$1.ZodOptional;\n toolCalls: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n usage: z$1.ZodOptional>;\n summary: z$1.ZodOptional;\n error: z$1.ZodOptional;\n outputFile: z$1.ZodOptional;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/agentMessage/delta\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n itemId: z$1.ZodString;\n delta: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/commandExecution/outputDelta\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n itemId: z$1.ZodString;\n delta: z$1.ZodString;\n reset: z$1.ZodOptional;\n parentToolCallId: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/fileChange/outputDelta\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n itemId: z$1.ZodString;\n delta: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/reasoning/summaryTextDelta\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n itemId: z$1.ZodString;\n delta: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/reasoning/textDelta\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n itemId: z$1.ZodString;\n delta: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/plan/delta\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n itemId: z$1.ZodString;\n delta: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/mcpToolCall/progress\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n itemId: z$1.ZodString;\n message: z$1.ZodOptional;\n parentToolCallId: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/toolCall/progress\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n itemId: z$1.ZodString;\n message: z$1.ZodOptional;\n parentToolCallId: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/backgroundTask/progress\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n item: z$1.ZodObject<{\n type: z$1.ZodLiteral<\"backgroundTask\">;\n id: z$1.ZodString;\n taskType: z$1.ZodString;\n description: z$1.ZodString;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n }>;\n taskStatus: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n running: \"running\";\n paused: \"paused\";\n failed: \"failed\";\n killed: \"killed\";\n stopped: \"stopped\";\n }>;\n skipTranscript: z$1.ZodBoolean;\n workflowName: z$1.ZodOptional;\n workflow: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n agents: z$1.ZodArray;\n model: z$1.ZodString;\n attempt: z$1.ZodNumber;\n cached: z$1.ZodBoolean;\n lastProgressAt: z$1.ZodNumber;\n phaseIndex: z$1.ZodOptional;\n phaseTitle: z$1.ZodOptional;\n agentType: z$1.ZodOptional;\n isolation: z$1.ZodOptional;\n queuedAt: z$1.ZodOptional;\n startedAt: z$1.ZodOptional;\n lastToolName: z$1.ZodOptional;\n lastToolSummary: z$1.ZodOptional;\n promptPreview: z$1.ZodOptional;\n resultPreview: z$1.ZodOptional;\n error: z$1.ZodOptional;\n tokens: z$1.ZodOptional;\n toolCalls: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n usage: z$1.ZodOptional>;\n summary: z$1.ZodOptional;\n error: z$1.ZodOptional;\n outputFile: z$1.ZodOptional;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"item/backgroundTask/completed\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n item: z$1.ZodObject<{\n type: z$1.ZodLiteral<\"backgroundTask\">;\n id: z$1.ZodString;\n taskType: z$1.ZodString;\n description: z$1.ZodString;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n }>;\n taskStatus: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n running: \"running\";\n paused: \"paused\";\n failed: \"failed\";\n killed: \"killed\";\n stopped: \"stopped\";\n }>;\n skipTranscript: z$1.ZodBoolean;\n workflowName: z$1.ZodOptional;\n workflow: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n agents: z$1.ZodArray;\n model: z$1.ZodString;\n attempt: z$1.ZodNumber;\n cached: z$1.ZodBoolean;\n lastProgressAt: z$1.ZodNumber;\n phaseIndex: z$1.ZodOptional;\n phaseTitle: z$1.ZodOptional;\n agentType: z$1.ZodOptional;\n isolation: z$1.ZodOptional;\n queuedAt: z$1.ZodOptional;\n startedAt: z$1.ZodOptional;\n lastToolName: z$1.ZodOptional;\n lastToolSummary: z$1.ZodOptional;\n promptPreview: z$1.ZodOptional;\n resultPreview: z$1.ZodOptional;\n error: z$1.ZodOptional;\n tokens: z$1.ZodOptional;\n toolCalls: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n usage: z$1.ZodOptional>;\n summary: z$1.ZodOptional;\n error: z$1.ZodOptional;\n outputFile: z$1.ZodOptional;\n parentToolCallId: z$1.ZodOptional;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"thread/tokenUsage/updated\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n tokenUsage: z$1.ZodObject<{\n total: z$1.ZodObject<{\n totalTokens: z$1.ZodNumber;\n inputTokens: z$1.ZodNumber;\n cachedInputTokens: z$1.ZodNumber;\n outputTokens: z$1.ZodNumber;\n reasoningOutputTokens: z$1.ZodNumber;\n }, z$1.core.$strip>;\n last: z$1.ZodObject<{\n totalTokens: z$1.ZodNumber;\n inputTokens: z$1.ZodNumber;\n cachedInputTokens: z$1.ZodNumber;\n outputTokens: z$1.ZodNumber;\n reasoningOutputTokens: z$1.ZodNumber;\n }, z$1.core.$strip>;\n modelContextWindow: z$1.ZodNullable;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"thread/contextWindowUsage/updated\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n contextWindowUsage: z$1.ZodObject<{\n usedTokens: z$1.ZodNullable;\n modelContextWindow: z$1.ZodNullable;\n estimated: z$1.ZodBoolean;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"turn/plan/updated\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n plan: z$1.ZodArray>;\n }, z$1.core.$strip>>;\n explanation: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"turn/diff/updated\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n diff: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"provider/error\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n message: z$1.ZodString;\n detail: z$1.ZodOptional;\n willRetry: z$1.ZodOptional;\n errorInfo: z$1.ZodOptional;\n providerCode: z$1.ZodNullable;\n httpStatusCode: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"provider/warning\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n category: z$1.ZodEnum<{\n deprecation: \"deprecation\";\n config: \"config\";\n general: \"general\";\n }>;\n summary: z$1.ZodOptional;\n details: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"provider/modelFallback\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n originalModel: z$1.ZodString;\n fallbackModel: z$1.ZodString;\n reason: z$1.ZodEnum<{\n provider: \"provider\";\n refusal: \"refusal\";\n }>;\n message: z$1.ZodString;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"provider/unhandled\">;\n threadId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n providerId: z$1.ZodString;\n rawType: z$1.ZodString;\n rawEvent: z$1.ZodObject<{\n jsonrpc: z$1.ZodLiteral<\"2.0\">;\n id: z$1.ZodOptional>;\n method: z$1.ZodString;\n params: z$1.ZodOptional>>;\n }, z$1.core.$strip>;\n parentToolCallId: z$1.ZodOptional;\n}, z$1.core.$strip>], \"type\">, z$1.ZodObject<{\n scope: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"turn\">;\n turnId: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">;\n}, z$1.core.$strip>>, z$1.ZodIntersection;\n threadId: z$1.ZodString;\n direction: z$1.ZodLiteral<\"outbound\">;\n source: z$1.ZodEnum<{\n spawn: \"spawn\";\n tell: \"tell\";\n }>;\n initiator: z$1.ZodEnum<{\n user: \"user\";\n agent: \"agent\";\n system: \"system\";\n }>;\n request: z$1.ZodObject<{\n method: z$1.ZodEnum<{\n \"thread/start\": \"thread/start\";\n \"turn/start\": \"turn/start\";\n }>;\n params: z$1.ZodRecord;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"client/turn/requested\">;\n threadId: z$1.ZodString;\n direction: z$1.ZodLiteral<\"outbound\">;\n requestId: z$1.ZodString;\n source: z$1.ZodEnum<{\n spawn: \"spawn\";\n tell: \"tell\";\n }>;\n initiator: z$1.ZodEnum<{\n user: \"user\";\n agent: \"agent\";\n system: \"system\";\n }>;\n senderThreadId: z$1.ZodNullable;\n systemMessageKind: z$1.ZodOptional>;\n systemMessageSubject: z$1.ZodOptional;\n threadId: z$1.ZodString;\n threadName: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread-batch\">;\n count: z$1.ZodNumber;\n }, z$1.core.$strip>], \"kind\">>>;\n input: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n project: \"project\";\n builtin: \"builtin\";\n user: \"user\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n inputGroups: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n project: \"project\";\n builtin: \"builtin\";\n user: \"user\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>>>;\n target: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread-start\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"new-turn\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"auto\">;\n expectedTurnId: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"steer\">;\n expectedTurnId: z$1.ZodNullable;\n }, z$1.core.$strip>], \"kind\">;\n request: z$1.ZodObject<{\n method: z$1.ZodEnum<{\n \"thread/start\": \"thread/start\";\n \"turn/start\": \"turn/start\";\n }>;\n params: z$1.ZodRecord;\n }, z$1.core.$strip>;\n execution: z$1.ZodObject<{\n seq: z$1.ZodOptional;\n model: z$1.ZodString;\n serviceTier: z$1.ZodEnum<{\n default: \"default\";\n fast: \"fast\";\n }>;\n reasoningLevel: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n source: z$1.ZodEnum<{\n \"client/thread/start\": \"client/thread/start\";\n \"client/turn/requested\": \"client/turn/requested\";\n \"client/turn/start\": \"client/turn/start\";\n }>;\n permissionMode: z$1.ZodEnum<{\n readonly: \"readonly\";\n full: \"full\";\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n \"workspace-write\": \"workspace-write\";\n }>;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"client/turn/start\">;\n threadId: z$1.ZodString;\n direction: z$1.ZodLiteral<\"outbound\">;\n source: z$1.ZodEnum<{\n spawn: \"spawn\";\n tell: \"tell\";\n }>;\n initiator: z$1.ZodEnum<{\n user: \"user\";\n agent: \"agent\";\n system: \"system\";\n }>;\n request: z$1.ZodObject<{\n method: z$1.ZodEnum<{\n \"thread/start\": \"thread/start\";\n \"turn/start\": \"turn/start\";\n }>;\n params: z$1.ZodRecord;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"system/error\">;\n threadId: z$1.ZodString;\n code: z$1.ZodOptional;\n message: z$1.ZodString;\n detail: z$1.ZodOptional;\n reconnectAttempt: z$1.ZodOptional;\n reconnectTotal: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"system/manager/user_message\">;\n threadId: z$1.ZodString;\n text: z$1.ZodString;\n toolCallId: z$1.ZodOptional;\n turnId: z$1.ZodOptional;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"system/thread/interrupted\">;\n threadId: z$1.ZodString;\n reason: z$1.ZodEnum<{\n \"manual-stop\": \"manual-stop\";\n \"host-daemon-restarted\": \"host-daemon-restarted\";\n \"provider-turn-idle\": \"provider-turn-idle\";\n }>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"system/operation\">;\n threadId: z$1.ZodString;\n operation: z$1.ZodString;\n status: z$1.ZodString;\n message: z$1.ZodString;\n operationId: z$1.ZodString;\n metadata: z$1.ZodOptional>>>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"system/permissionGrant/lifecycle\">;\n threadId: z$1.ZodString;\n interactionId: z$1.ZodString;\n providerId: z$1.ZodString;\n providerRequestId: z$1.ZodString;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n resolving: \"resolving\";\n resolved: \"resolved\";\n interrupted: \"interrupted\";\n }>;\n resolution: z$1.ZodDefault;\n grantedPermissions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"allow_for_session\">;\n grantedPermissions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"deny\">;\n }, z$1.core.$strip>], \"decision\">>>;\n statusReason: z$1.ZodDefault>;\n subject: z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"permission_grant\">;\n itemId: z$1.ZodString;\n toolName: z$1.ZodNullable;\n permissions: z$1.ZodObject<{\n network: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"system/userQuestion/lifecycle\">;\n threadId: z$1.ZodString;\n interactionId: z$1.ZodString;\n providerId: z$1.ZodString;\n providerRequestId: z$1.ZodString;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n resolving: \"resolving\";\n resolved: \"resolved\";\n interrupted: \"interrupted\";\n }>;\n resolution: z$1.ZodDefault;\n answers: z$1.ZodRecord;\n freeText: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>>;\n statusReason: z$1.ZodDefault>;\n payload: z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"user_question\">;\n questions: z$1.ZodArray;\n multiSelect: z$1.ZodBoolean;\n options: z$1.ZodOptional;\n }, z$1.core.$strip>>>;\n allowFreeText: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"system/thread-provisioning\">;\n threadId: z$1.ZodString;\n provisioningId: z$1.ZodString;\n status: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n active: \"active\";\n cancelled: \"cancelled\";\n }>;\n environmentId: z$1.ZodString;\n entries: z$1.ZodArray;\n key: z$1.ZodString;\n text: z$1.ZodString;\n startedAt: z$1.ZodOptional;\n status: z$1.ZodOptional>;\n metadata: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"system/provider-turn-watchdog\">;\n threadId: z$1.ZodString;\n reason: z$1.ZodLiteral<\"provider-turn-idle\">;\n thresholdMs: z$1.ZodNumber;\n elapsedMs: z$1.ZodNumber;\n activeTurnId: z$1.ZodString;\n activeTurnStartedAt: z$1.ZodNumber;\n lastActivityEventSequence: z$1.ZodNumber;\n lastActivityEventType: z$1.ZodString;\n lastActivityEventAt: z$1.ZodNumber;\n providerId: z$1.ZodString;\n providerThreadId: z$1.ZodNullable;\n firedAt: z$1.ZodNumber;\n}, z$1.core.$strip>]>, z$1.ZodObject<{\n scope: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"turn\">;\n turnId: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">;\n}, z$1.core.$strip>>]>>;\ntype ThreadEvent = z$1.infer;\ntype ThreadEventType = ThreadEvent[\"type\"];\n\ndeclare const providerInfoSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n displayName: z$1.ZodString;\n logoUrl: z$1.ZodNullable;\n capabilities: z$1.ZodObject<{\n supportsArchive: z$1.ZodBoolean;\n supportsRename: z$1.ZodBoolean;\n supportsServiceTier: z$1.ZodBoolean;\n supportsUserQuestion: z$1.ZodBoolean;\n supportsFork: z$1.ZodBoolean;\n supportedPermissionModes: z$1.ZodArray>;\n }, z$1.core.$strip>;\n composerActions: z$1.ZodArray;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plan\">;\n command: z$1.ZodObject<{\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n trailingText: z$1.ZodString;\n }, z$1.core.$strip>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"goal\">;\n command: z$1.ZodObject<{\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n trailingText: z$1.ZodString;\n }, z$1.core.$strip>;\n }, z$1.core.$strip>], \"kind\">>;\n available: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype ProviderInfo = z$1.infer;\n\ndeclare const threadEventScopeSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n}, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"turn\">;\n turnId: z$1.ZodString;\n}, z$1.core.$strip>], \"kind\">;\ntype ThreadEventScope = z$1.infer;\n\ntype ThreadEventByType = {\n [TType in ThreadEventType]: Extract;\n};\ntype ThreadEventForType = ThreadEventByType[TType];\ntype StoredThreadEventDataFromEvent = Omit;\ninterface ThreadEventRowBase {\n id: string;\n scope: ThreadEventScope;\n threadId: string;\n seq: number;\n createdAt: number;\n}\ntype ThreadEventRowFromEvent = ThreadEventRowBase & {\n type: TEvent[\"type\"];\n data: StoredThreadEventDataFromEvent;\n};\ntype ThreadEventRowOfType = ThreadEventRowFromEvent>;\ntype ThreadEventRow = {\n [TType in ThreadEventType]: ThreadEventRowOfType;\n}[ThreadEventType];\n\ndeclare const threadStatusSchema: z$1.ZodEnum<{\n error: \"error\";\n active: \"active\";\n starting: \"starting\";\n idle: \"idle\";\n stopping: \"stopping\";\n}>;\ntype ThreadStatus = z$1.infer;\n\ndeclare const threadTimelinePendingTodosSchema: z$1.ZodObject<{\n sourceSeq: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n items: z$1.ZodArray;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype ThreadTimelinePendingTodos = z$1.infer;\n\ndeclare const threadQueuedMessageSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n content: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n project: \"project\";\n builtin: \"builtin\";\n user: \"user\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n model: z$1.ZodString;\n reasoningLevel: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n permissionMode: z$1.ZodEnum<{\n full: \"full\";\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n }>;\n serviceTier: z$1.ZodEnum<{\n default: \"default\";\n fast: \"fast\";\n }>;\n groupWithNext: z$1.ZodBoolean;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype ThreadQueuedMessage = z$1.infer;\n\ndeclare const workspaceFileListResponseSchema: z$1.ZodObject<{\n files: z$1.ZodArray>;\n truncated: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype WorkspaceFileListResponse = z$1.infer;\ndeclare const workspacePathListResponseSchema: z$1.ZodObject<{\n paths: z$1.ZodArray;\n path: z$1.ZodString;\n name: z$1.ZodString;\n score: z$1.ZodNumber;\n positions: z$1.ZodArray;\n }, z$1.core.$strip>>;\n truncated: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype WorkspacePathListResponse = z$1.infer;\n\ndeclare const createProjectSourceRequestSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n hostId: z$1.ZodString;\n type: z$1.ZodLiteral<\"local_path\">;\n path: z$1.ZodPipe>;\n}, z$1.core.$strict>, z$1.ZodObject<{\n hostId: z$1.ZodString;\n type: z$1.ZodLiteral<\"clone\">;\n targetPath: z$1.ZodOptional>>;\n remoteUrl: z$1.ZodOptional;\n}, z$1.core.$strict>], \"type\">;\ntype CreateProjectSourceRequest = z$1.infer;\ndeclare const createProjectRequestSchema: z$1.ZodObject<{\n name: z$1.ZodString;\n source: z$1.ZodObject<{\n hostId: z$1.ZodString;\n type: z$1.ZodLiteral<\"local_path\">;\n path: z$1.ZodPipe>;\n }, z$1.core.$strict>;\n}, z$1.core.$strip>;\ntype CreateProjectRequest = z$1.infer;\ndeclare const threadSectionSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n name: z$1.ZodString;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n}, z$1.core.$strict>;\ntype ThreadSectionResponse = z$1.infer;\ndeclare const createThreadSectionRequestSchema: z$1.ZodObject<{\n name: z$1.ZodString;\n}, z$1.core.$strict>;\ntype CreateThreadSectionRequest = z$1.infer;\ndeclare const updateThreadSectionRequestSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n name: z$1.ZodString;\n}, z$1.core.$strict>;\ntype UpdateThreadSectionRequest = z$1.infer;\ndeclare const deleteThreadSectionRequestSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n}, z$1.core.$strict>;\ntype DeleteThreadSectionRequest = z$1.infer;\ndeclare const threadSectionMutationResponseSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n name: z$1.ZodString;\n updatedThreadCount: z$1.ZodNumber;\n}, z$1.core.$strict>;\ntype ThreadSectionMutationResponse = z$1.infer;\ndeclare const reorderProjectRequestSchema: z$1.ZodObject<{\n previousProjectId: z$1.ZodNullable;\n nextProjectId: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype ReorderProjectRequest = z$1.infer;\ndeclare const projectListQuerySchema: z$1.ZodObject<{\n include: z$1.ZodOptional;\n includePersonal: z$1.ZodOptional>;\n}, z$1.core.$strip>;\ntype ProjectListQuery = z$1.infer;\ndeclare const projectFilesQuerySchema: z$1.ZodObject<{\n query: z$1.ZodOptional>;\n limit: z$1.ZodOptional>;\n hostId: z$1.ZodOptional;\n environmentId: z$1.ZodOptional, z$1.ZodOptional>>;\n}, z$1.core.$strip>;\ntype ProjectFilesQuery = z$1.infer;\ndeclare const projectPathsQuerySchema: z$1.ZodObject<{\n query: z$1.ZodOptional>;\n limit: z$1.ZodOptional>;\n includeFiles: z$1.ZodEnum<{\n true: \"true\";\n false: \"false\";\n }>;\n includeDirectories: z$1.ZodEnum<{\n true: \"true\";\n false: \"false\";\n }>;\n hostId: z$1.ZodOptional;\n environmentId: z$1.ZodOptional, z$1.ZodOptional>>;\n}, z$1.core.$strip>;\ntype ProjectPathsQuery = z$1.infer;\ndeclare const projectFileContentQuerySchema: z$1.ZodObject<{\n path: z$1.ZodString;\n hostId: z$1.ZodOptional;\n environmentId: z$1.ZodOptional, z$1.ZodOptional>>;\n}, z$1.core.$strip>;\ntype ProjectFileContentQuery = z$1.infer;\ndeclare const projectBranchesQuerySchema: z$1.ZodObject<{\n query: z$1.ZodOptional;\n limit: z$1.ZodOptional;\n hostId: z$1.ZodString;\n selectedBranch: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype ProjectBranchesQuery = z$1.infer;\ndeclare const projectBranchesResponseSchema: z$1.ZodObject<{\n branches: z$1.ZodArray;\n branchesTruncated: z$1.ZodBoolean;\n checkout: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"branch\">;\n branchName: z$1.ZodString;\n headSha: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"detached\">;\n headSha: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unborn\">;\n branchName: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unknown\">;\n reason: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">;\n defaultBranch: z$1.ZodNullable;\n defaultBranchRelation: z$1.ZodNullable>;\n hasUncommittedChanges: z$1.ZodBoolean;\n operation: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"none\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"merge\">;\n hasConflicts: z$1.ZodBoolean;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"rebase\">;\n hasConflicts: z$1.ZodBoolean;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"cherry-pick\">;\n hasConflicts: z$1.ZodBoolean;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"revert\">;\n hasConflicts: z$1.ZodBoolean;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unknown\">;\n reason: z$1.ZodString;\n hasConflicts: z$1.ZodBoolean;\n }, z$1.core.$strip>], \"kind\">;\n originDefaultBranch: z$1.ZodNullable;\n remoteBranches: z$1.ZodArray;\n remoteBranchesTruncated: z$1.ZodBoolean;\n selectedBranch: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n defaultWorktreeBaseBranch: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype ProjectBranchesResponse = z$1.infer;\ndeclare const promptHistoryQuerySchema: z$1.ZodObject<{\n limit: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype PromptHistoryQuery = z$1.infer;\ndeclare const promptHistoryResponseSchema: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n}, z$1.core.$strip>>;\ntype PromptHistoryResponse = z$1.infer;\ndeclare const updateProjectRequestSchema: z$1.ZodObject<{\n name: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype UpdateProjectRequest = z$1.infer;\ndeclare const updateProjectSourceRequestSchema: z$1.ZodObject<{\n type: z$1.ZodLiteral<\"local_path\">;\n path: z$1.ZodOptional>>;\n isDefault: z$1.ZodOptional>;\n}, z$1.core.$strict>;\ntype UpdateProjectSourceRequest = z$1.infer;\ndeclare const commandListResponseSchema: z$1.ZodObject<{\n commands: z$1.ZodArray;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n description: z$1.ZodNullable;\n argumentHint: z$1.ZodNullable;\n pluginId: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype CommandListResponse = z$1.infer;\n/** Query for the complete command catalog available to a project and provider. */\ndeclare const projectCommandsQuerySchema: z$1.ZodObject<{\n provider: z$1.ZodString;\n hostId: z$1.ZodOptional;\n environmentId: z$1.ZodOptional, z$1.ZodOptional>>;\n}, z$1.core.$strict>;\ntype ProjectCommandsQuery = z$1.infer;\ndeclare const skillListResponseSchema: z$1.ZodObject<{\n skills: z$1.ZodArray;\n provider: z$1.ZodNullable>;\n scope: z$1.ZodEnum<{\n plugin: \"plugin\";\n \"bb-builtin\": \"bb-builtin\";\n \"bb-user\": \"bb-user\";\n \"bb-project\": \"bb-project\";\n \"claude-user\": \"claude-user\";\n \"claude-project\": \"claude-project\";\n \"codex-user\": \"codex-user\";\n \"codex-project\": \"codex-project\";\n }>;\n pluginId: z$1.ZodNullable;\n filePath: z$1.ZodString;\n manageable: z$1.ZodBoolean;\n registrySkillId: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype SkillListResponse = z$1.infer;\ndeclare const skillContentResponseSchema: z$1.ZodObject<{\n content: z$1.ZodString;\n revision: z$1.ZodString;\n}, z$1.core.$strip>;\ntype SkillContentResponse = z$1.infer;\ndeclare const skillFilesResponseSchema: z$1.ZodObject<{\n files: z$1.ZodArray;\n truncated: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype SkillFilesResponse = z$1.infer;\ndeclare const projectResponseSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodEnum<{\n personal: \"personal\";\n standard: \"standard\";\n }>;\n name: z$1.ZodString;\n gitRemoteUrl: z$1.ZodNullable;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n sources: z$1.ZodArray;\n hostId: z$1.ZodString;\n path: z$1.ZodString;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype ProjectResponse = z$1.infer;\ndeclare const projectWithThreadsResponseSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodEnum<{\n personal: \"personal\";\n standard: \"standard\";\n }>;\n name: z$1.ZodString;\n gitRemoteUrl: z$1.ZodNullable;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n sources: z$1.ZodArray;\n hostId: z$1.ZodString;\n path: z$1.ZodString;\n }, z$1.core.$strip>>;\n threads: z$1.ZodArray;\n providerId: z$1.ZodString;\n title: z$1.ZodNullable;\n titleFallback: z$1.ZodNullable;\n sectionId: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n error: \"error\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n }>;\n parentThreadId: z$1.ZodNullable;\n sourceThreadId: z$1.ZodNullable;\n originKind: z$1.ZodNullable>;\n childOrigin: z$1.ZodNullable>;\n originPluginId: z$1.ZodNullable;\n visibility: z$1.ZodEnum<{\n visible: \"visible\";\n hidden: \"hidden\";\n }>;\n archivedAt: z$1.ZodNullable;\n pinnedAt: z$1.ZodNullable;\n deletedAt: z$1.ZodNullable;\n lastReadAt: z$1.ZodNullable;\n latestAttentionAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n runtime: z$1.ZodObject<{\n displayStatus: z$1.ZodEnum<{\n error: \"error\";\n provisioning: \"provisioning\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n \"host-reconnecting\": \"host-reconnecting\";\n \"waiting-for-host\": \"waiting-for-host\";\n }>;\n hostReconnectGraceExpiresAt: z$1.ZodNullable;\n }, z$1.core.$strip>;\n activity: z$1.ZodObject<{\n activeWorkflowCount: z$1.ZodNumber;\n activeBackgroundAgentCount: z$1.ZodNumber;\n activeBackgroundCommandCount: z$1.ZodNumber;\n activePlanModeCount: z$1.ZodNumber;\n activeGoalCount: z$1.ZodNumber;\n }, z$1.core.$strip>;\n pinSortKey: z$1.ZodNullable;\n hasPendingInteraction: z$1.ZodBoolean;\n environmentHostId: z$1.ZodNullable;\n environmentName: z$1.ZodNullable;\n environmentBranchName: z$1.ZodNullable;\n environmentWorkspaceDisplayKind: z$1.ZodEnum<{\n \"managed-worktree\": \"managed-worktree\";\n \"unmanaged-worktree\": \"unmanaged-worktree\";\n other: \"other\";\n }>;\n }, z$1.core.$strip>>;\n defaultExecutionOptions: z$1.ZodNullable;\n reasoningLevel: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n permissionMode: z$1.ZodEnum<{\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n full: \"full\";\n }>;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype ProjectWithThreadsResponse = z$1.infer;\ndeclare const uploadedPromptAttachmentSchema: z$1.ZodObject<{\n type: z$1.ZodEnum<{\n localImage: \"localImage\";\n localFile: \"localFile\";\n }>;\n path: z$1.ZodString;\n name: z$1.ZodString;\n mimeType: z$1.ZodOptional;\n sizeBytes: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype UploadedPromptAttachment = z$1.infer;\ndeclare const copyProjectAttachmentsRequestSchema: z$1.ZodObject<{\n sourceProjectId: z$1.ZodString;\n paths: z$1.ZodArray;\n}, z$1.core.$strict>;\ntype CopyProjectAttachmentsRequest = z$1.infer;\n\ndeclare const registrySkillSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n source: z$1.ZodString;\n skillId: z$1.ZodString;\n name: z$1.ZodString;\n installs: z$1.ZodNumber;\n stars: z$1.ZodNullable;\n installUrl: z$1.ZodNullable;\n url: z$1.ZodString;\n topic: z$1.ZodNullable;\n summary: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype RegistrySkill = z$1.infer;\ndeclare const registrySkillsPageSchema: z$1.ZodObject<{\n skills: z$1.ZodArray;\n installUrl: z$1.ZodNullable;\n url: z$1.ZodString;\n topic: z$1.ZodNullable;\n summary: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n pagination: z$1.ZodObject<{\n page: z$1.ZodNumber;\n perPage: z$1.ZodNumber;\n total: z$1.ZodNumber;\n hasMore: z$1.ZodBoolean;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>;\ntype RegistrySkillsPage = z$1.infer;\ndeclare const registrySkillDetailSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n source: z$1.ZodString;\n skillId: z$1.ZodString;\n hash: z$1.ZodNullable;\n files: z$1.ZodNullable>>;\n}, z$1.core.$strip>;\ntype RegistrySkillDetail = z$1.infer;\ndeclare const registrySkillInstallResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n filePath: z$1.ZodString;\n}, z$1.core.$strip>;\ntype RegistrySkillInstallResponse = z$1.infer;\n\ndeclare const updateEnvironmentRequestSchema: z$1.ZodObject<{\n mergeBaseBranch: z$1.ZodOptional>;\n name: z$1.ZodOptional>;\n}, z$1.core.$strip>;\ntype UpdateEnvironmentRequest = z$1.infer;\n/**\n * Query for searching paths in an environment's workspace. Unlike the\n * project-scoped variant this needs no `environmentId` โ€” the environment is\n * the route param โ€” and is project-agnostic, so it works for projectless\n * (personal) environments too.\n */\ndeclare const environmentPathsQuerySchema: z$1.ZodObject<{\n query: z$1.ZodOptional;\n limit: z$1.ZodOptional;\n includeFiles: z$1.ZodEnum<{\n true: \"true\";\n false: \"false\";\n }>;\n includeDirectories: z$1.ZodEnum<{\n true: \"true\";\n false: \"false\";\n }>;\n}, z$1.core.$strip>;\ntype EnvironmentPathsQuery = z$1.infer;\ndeclare const environmentDiffBranchesQuerySchema: z$1.ZodObject<{\n query: z$1.ZodOptional;\n limit: z$1.ZodOptional;\n selectedBranch: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype EnvironmentDiffBranchesQuery = z$1.infer;\ndeclare const environmentDiffBranchesResponseSchema: z$1.ZodObject<{\n branches: z$1.ZodArray;\n branchesTruncated: z$1.ZodBoolean;\n remoteBranches: z$1.ZodArray;\n remoteBranchesTruncated: z$1.ZodBoolean;\n selectedBranch: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype EnvironmentDiffBranchesResponse = z$1.infer;\ndeclare const environmentStatusQuerySchema: z$1.ZodObject<{\n mergeBaseBranch: z$1.ZodOptional>;\n}, z$1.core.$strip>;\ntype EnvironmentStatusQuery = z$1.infer;\ndeclare const environmentDiffQuerySchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n target: z$1.ZodLiteral<\"uncommitted\">;\n}, z$1.core.$strip>, z$1.ZodObject<{\n target: z$1.ZodLiteral<\"branch_committed\">;\n mergeBaseBranch: z$1.ZodPipe;\n}, z$1.core.$strip>, z$1.ZodObject<{\n target: z$1.ZodLiteral<\"all\">;\n mergeBaseBranch: z$1.ZodPipe;\n}, z$1.core.$strip>, z$1.ZodObject<{\n target: z$1.ZodLiteral<\"commit\">;\n sha: z$1.ZodString;\n}, z$1.core.$strip>], \"target\">;\ntype EnvironmentDiffQuery = z$1.infer;\n/**\n * Query for fetching a single file's contents at one side of a diff target.\n * Used by the diff card to reparse the card's patch with full old/new contents\n * so `@pierre/diffs` can render expand-context buttons between hunks.\n *\n * For `branch_committed` / `all`, callers pass the resolved merge-base SHA\n * (`mergeBaseRef`, surfaced by `workspace.diff`) rather than the branch name\n * โ€” the diff itself was computed against that SHA, so reading the old side\n * from the same SHA keeps the file content aligned with the hunk line\n * numbers. Reading from the branch tip is wrong whenever the branch has\n * moved past the merge-base since the file existed there.\n */\ndeclare const environmentDiffFileQuerySchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n target: z$1.ZodLiteral<\"uncommitted\">;\n path: z$1.ZodString;\n side: z$1.ZodEnum<{\n new: \"new\";\n old: \"old\";\n }>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n target: z$1.ZodLiteral<\"branch_committed\">;\n mergeBaseRef: z$1.ZodString;\n path: z$1.ZodString;\n side: z$1.ZodEnum<{\n new: \"new\";\n old: \"old\";\n }>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n target: z$1.ZodLiteral<\"all\">;\n mergeBaseRef: z$1.ZodString;\n path: z$1.ZodString;\n side: z$1.ZodEnum<{\n new: \"new\";\n old: \"old\";\n }>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n target: z$1.ZodLiteral<\"commit\">;\n sha: z$1.ZodString;\n path: z$1.ZodString;\n side: z$1.ZodEnum<{\n new: \"new\";\n old: \"old\";\n }>;\n}, z$1.core.$strip>], \"target\">;\ntype EnvironmentDiffFileQuery = z$1.infer;\ndeclare const environmentDiffFileResponseSchema: z$1.ZodObject<{\n path: z$1.ZodString;\n content: z$1.ZodString;\n contentEncoding: z$1.ZodEnum<{\n base64: \"base64\";\n utf8: \"utf8\";\n }>;\n mimeType: z$1.ZodOptional;\n sizeBytes: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype EnvironmentDiffFileResponse = z$1.infer;\ndeclare const environmentArchiveThreadsResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n archivedThreadIds: z$1.ZodArray;\n}, z$1.core.$strip>;\ntype EnvironmentArchiveThreadsResponse = z$1.infer;\ndeclare const pullRequestMergeMethodSchema: z$1.ZodEnum<{\n merge: \"merge\";\n rebase: \"rebase\";\n squash: \"squash\";\n}>;\ntype PullRequestMergeMethod = z$1.infer;\ndeclare const commitActionResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n action: z$1.ZodLiteral<\"commit\">;\n message: z$1.ZodString;\n commitSha: z$1.ZodString;\n commitSubject: z$1.ZodString;\n}, z$1.core.$strip>;\ntype CommitActionResponse = z$1.infer;\ndeclare const squashMergeActionResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n action: z$1.ZodLiteral<\"squash_merge\">;\n merged: z$1.ZodBoolean;\n message: z$1.ZodString;\n commitSha: z$1.ZodString;\n commitSubject: z$1.ZodString;\n}, z$1.core.$strip>;\ntype SquashMergeActionResponse = z$1.infer;\ndeclare const pullRequestReadyActionResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n action: z$1.ZodLiteral<\"pull_request_ready\">;\n message: z$1.ZodString;\n}, z$1.core.$strip>;\ntype PullRequestReadyActionResponse = z$1.infer;\ndeclare const pullRequestMergeActionResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n action: z$1.ZodLiteral<\"pull_request_merge\">;\n method: z$1.ZodEnum<{\n merge: \"merge\";\n rebase: \"rebase\";\n squash: \"squash\";\n }>;\n message: z$1.ZodString;\n}, z$1.core.$strip>;\ntype PullRequestMergeActionResponse = z$1.infer;\ndeclare const pullRequestDraftActionResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n action: z$1.ZodLiteral<\"pull_request_draft\">;\n message: z$1.ZodString;\n}, z$1.core.$strip>;\ntype PullRequestDraftActionResponse = z$1.infer;\ndeclare const environmentStatusResponseSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n workspace: z$1.ZodObject<{\n workingTree: z$1.ZodObject<{\n insertions: z$1.ZodNumber;\n deletions: z$1.ZodNumber;\n files: z$1.ZodArray;\n insertions: z$1.ZodNullable;\n deletions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n hasUncommittedChanges: z$1.ZodBoolean;\n state: z$1.ZodEnum<{\n clean: \"clean\";\n untracked: \"untracked\";\n dirty_uncommitted: \"dirty_uncommitted\";\n committed_unmerged: \"committed_unmerged\";\n dirty_and_committed_unmerged: \"dirty_and_committed_unmerged\";\n }>;\n }, z$1.core.$strip>;\n checkout: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"branch\">;\n branchName: z$1.ZodString;\n headSha: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"detached\">;\n headSha: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unborn\">;\n branchName: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unknown\">;\n reason: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">;\n branch: z$1.ZodObject<{\n currentBranch: z$1.ZodNullable;\n defaultBranch: z$1.ZodString;\n }, z$1.core.$strip>;\n mergeBase: z$1.ZodNullable;\n insertions: z$1.ZodNullable;\n deletions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n mergeBaseBranch: z$1.ZodString;\n baseRef: z$1.ZodNullable;\n aheadCount: z$1.ZodNumber;\n behindCount: z$1.ZodNumber;\n hasCommittedUnmergedChanges: z$1.ZodBoolean;\n commits: z$1.ZodArray>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>;\n}, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"not_applicable\">;\n reason: z$1.ZodEnum<{\n non_git_environment: \"non_git_environment\";\n }>;\n message: z$1.ZodString;\n}, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"unavailable\">;\n failure: z$1.ZodObject<{\n code: z$1.ZodEnum<{\n unknown: \"unknown\";\n path_not_found: \"path_not_found\";\n not_git_repo: \"not_git_repo\";\n not_worktree: \"not_worktree\";\n workspace_type_mismatch: \"workspace_type_mismatch\";\n permission_denied: \"permission_denied\";\n unknown_environment: \"unknown_environment\";\n }>;\n workspacePath: z$1.ZodString;\n message: z$1.ZodString;\n }, z$1.core.$strict>;\n}, z$1.core.$strict>], \"outcome\">;\n/**\n * Structured pull-request lookup outcome. \"absent\" is a real answer โ€” the\n * host checked and the branch has no PR (non-git environments resolve to\n * \"absent\" without a daemon call). \"unavailable\" means the lookup itself\n * failed (gh missing, not authenticated, timeout, unreachable workspace), so\n * callers must not render it as \"no PR exists\".\n */\ndeclare const environmentPullRequestResponseSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n pullRequest: z$1.ZodObject<{\n number: z$1.ZodNumber;\n title: z$1.ZodString;\n state: z$1.ZodEnum<{\n merged: \"merged\";\n draft: \"draft\";\n open: \"open\";\n closed: \"closed\";\n }>;\n url: z$1.ZodString;\n baseRefName: z$1.ZodString;\n headRefName: z$1.ZodString;\n updatedAt: z$1.ZodString;\n checks: z$1.ZodObject<{\n state: z$1.ZodEnum<{\n unknown: \"unknown\";\n pending: \"pending\";\n passing: \"passing\";\n failing: \"failing\";\n no_checks: \"no_checks\";\n }>;\n totalCount: z$1.ZodNumber;\n passedCount: z$1.ZodNumber;\n failedCount: z$1.ZodNumber;\n pendingCount: z$1.ZodNumber;\n }, z$1.core.$strict>;\n review: z$1.ZodObject<{\n state: z$1.ZodEnum<{\n none: \"none\";\n approved: \"approved\";\n changes_requested: \"changes_requested\";\n review_required: \"review_required\";\n review_requested: \"review_requested\";\n }>;\n reviewRequestCount: z$1.ZodNumber;\n }, z$1.core.$strict>;\n mergeability: z$1.ZodObject<{\n state: z$1.ZodEnum<{\n unknown: \"unknown\";\n draft: \"draft\";\n mergeable: \"mergeable\";\n conflicts: \"conflicts\";\n blocked: \"blocked\";\n }>;\n mergeStateStatus: z$1.ZodNullable>;\n mergeable: z$1.ZodNullable>;\n }, z$1.core.$strict>;\n attention: z$1.ZodEnum<{\n none: \"none\";\n merged: \"merged\";\n draft: \"draft\";\n closed: \"closed\";\n changes_requested: \"changes_requested\";\n review_requested: \"review_requested\";\n conflicts: \"conflicts\";\n blocked: \"blocked\";\n checks_failed: \"checks_failed\";\n checks_pending: \"checks_pending\";\n ready_to_merge: \"ready_to_merge\";\n }>;\n }, z$1.core.$strict>;\n}, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"absent\">;\n}, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"unavailable\">;\n message: z$1.ZodString;\n}, z$1.core.$strict>], \"outcome\">;\ntype EnvironmentPullRequestResponse = z$1.infer;\ndeclare const environmentDiffResponseSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n diff: z$1.ZodObject<{\n diff: z$1.ZodString;\n truncated: z$1.ZodBoolean;\n shortstat: z$1.ZodString;\n files: z$1.ZodString;\n mergeBaseRef: z$1.ZodNullable;\n }, z$1.core.$strip>;\n}, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"not_applicable\">;\n reason: z$1.ZodEnum<{\n non_git_environment: \"non_git_environment\";\n }>;\n message: z$1.ZodString;\n}, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"unavailable\">;\n failure: z$1.ZodObject<{\n code: z$1.ZodEnum<{\n unknown: \"unknown\";\n path_not_found: \"path_not_found\";\n not_git_repo: \"not_git_repo\";\n not_worktree: \"not_worktree\";\n workspace_type_mismatch: \"workspace_type_mismatch\";\n permission_denied: \"permission_denied\";\n unknown_environment: \"unknown_environment\";\n }>;\n workspacePath: z$1.ZodString;\n message: z$1.ZodString;\n }, z$1.core.$strict>;\n}, z$1.core.$strict>], \"outcome\">;\ntype EnvironmentDiffResponse = z$1.infer;\ndeclare const environmentDiffFilesResponseSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n files: z$1.ZodArray;\n changeKind: z$1.ZodEnum<{\n deleted: \"deleted\";\n added: \"added\";\n modified: \"modified\";\n renamed: \"renamed\";\n copied: \"copied\";\n type_changed: \"type_changed\";\n }>;\n additions: z$1.ZodNumber;\n deletions: z$1.ZodNumber;\n binary: z$1.ZodBoolean;\n origin: z$1.ZodEnum<{\n untracked: \"untracked\";\n tracked: \"tracked\";\n }>;\n loadMode: z$1.ZodEnum<{\n auto: \"auto\";\n on_demand: \"on_demand\";\n too_large: \"too_large\";\n }>;\n }, z$1.core.$strip>>;\n shortstat: z$1.ZodString;\n mergeBaseRef: z$1.ZodNullable;\n initialPatches: z$1.ZodArray>;\n}, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"not_applicable\">;\n reason: z$1.ZodEnum<{\n non_git_environment: \"non_git_environment\";\n too_many_files: \"too_many_files\";\n }>;\n message: z$1.ZodString;\n}, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"unavailable\">;\n failure: z$1.ZodObject<{\n code: z$1.ZodEnum<{\n unknown: \"unknown\";\n path_not_found: \"path_not_found\";\n not_git_repo: \"not_git_repo\";\n not_worktree: \"not_worktree\";\n workspace_type_mismatch: \"workspace_type_mismatch\";\n permission_denied: \"permission_denied\";\n unknown_environment: \"unknown_environment\";\n }>;\n workspacePath: z$1.ZodString;\n message: z$1.ZodString;\n }, z$1.core.$strict>;\n}, z$1.core.$strict>], \"outcome\">;\ntype EnvironmentDiffFilesResponse = z$1.infer;\ndeclare const environmentDiffPatchResponseSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n patches: z$1.ZodArray>;\n}, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"not_applicable\">;\n reason: z$1.ZodEnum<{\n non_git_environment: \"non_git_environment\";\n }>;\n message: z$1.ZodString;\n}, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"unavailable\">;\n failure: z$1.ZodObject<{\n code: z$1.ZodEnum<{\n unknown: \"unknown\";\n path_not_found: \"path_not_found\";\n not_git_repo: \"not_git_repo\";\n not_worktree: \"not_worktree\";\n workspace_type_mismatch: \"workspace_type_mismatch\";\n permission_denied: \"permission_denied\";\n unknown_environment: \"unknown_environment\";\n }>;\n workspacePath: z$1.ZodString;\n message: z$1.ZodString;\n }, z$1.core.$strict>;\n}, z$1.core.$strict>], \"outcome\">;\ntype EnvironmentDiffPatchResponse = z$1.infer;\n/**\n * Body for `POST /diff/patch`: the diff target plus the list of new paths whose\n * patches the client wants. A POST (not GET) because the repeated `paths` array\n * cannot survive flat query parsing. The client supplies only new paths; the\n * server re-derives each file's rename/copy pairing (`previousPath`) from its\n * own TOC.\n */\ndeclare const environmentDiffPatchRequestSchema: z$1.ZodObject<{\n target: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"uncommitted\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"branch_committed\">;\n mergeBaseBranch: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"all\">;\n mergeBaseBranch: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"commit\">;\n sha: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">;\n paths: z$1.ZodArray;\n}, z$1.core.$strict>;\ntype EnvironmentDiffPatchRequest = z$1.infer;\ntype EnvironmentStatusResponse = z$1.infer;\n\ndeclare const providerUsageResponseSchema: z$1.ZodObject<{\n codex: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n status: z$1.ZodLiteral<\"ok\">;\n accountEmail: z$1.ZodNullable;\n planLabel: z$1.ZodNullable;\n windows: z$1.ZodArray;\n cost: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"not_installed\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"unauthenticated\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"expired\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"error\">;\n message: z$1.ZodString;\n }, z$1.core.$strip>], \"status\">;\n claudeCode: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n status: z$1.ZodLiteral<\"ok\">;\n accountEmail: z$1.ZodNullable;\n planLabel: z$1.ZodNullable;\n windows: z$1.ZodArray;\n cost: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"not_installed\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"unauthenticated\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"expired\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"error\">;\n message: z$1.ZodString;\n }, z$1.core.$strip>], \"status\">;\n cursor: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n status: z$1.ZodLiteral<\"ok\">;\n accountEmail: z$1.ZodNullable;\n planLabel: z$1.ZodNullable;\n windows: z$1.ZodArray;\n cost: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"not_installed\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"unauthenticated\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"expired\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"error\">;\n message: z$1.ZodString;\n }, z$1.core.$strip>], \"status\">;\n}, z$1.core.$strip>;\ntype ProviderUsageResponse = z$1.infer;\ntype HostDaemonCommandTransport = \"settled\" | \"onlineRpc\";\ntype HostDaemonCommandEnvironmentLane = \"read\" | \"write\";\ntype HostDaemonFlushEventsBeforeResult = boolean | \"when-initiated\";\ninterface HostDaemonCommandDescriptor {\n type: Type;\n schema: Schema;\n resultSchema: ResultSchema;\n transport: Transport;\n retryable: Retryable;\n flushEventsBeforeResult: HostDaemonFlushEventsBeforeResult;\n envLane: HostDaemonCommandEnvironmentLane | null;\n}\ndeclare const hostDaemonCommandRegistry: {\n \"thread.start\": HostDaemonCommandDescriptor<\"thread.start\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n threadId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n projectId: z$1.ZodString;\n providerId: z$1.ZodString;\n acpLaunchSpec: z$1.ZodOptional;\n env: z$1.ZodRecord;\n cwd: z$1.ZodOptional;\n modelCli: z$1.ZodOptional;\n selectFlag: z$1.ZodOptional;\n primaryModels: z$1.ZodArray;\n }, z$1.core.$strict>, z$1.ZodTransform<{\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n } | undefined, {\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n }>>>;\n reasoningCli: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n nativeReasoning: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n permissionCli: z$1.ZodOptional>;\n workspaceWrite: z$1.ZodOptional>;\n readonly: z$1.ZodOptional>;\n insertAfterArgs: z$1.ZodOptional;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>>;\n options: z$1.ZodIntersection;\n reasoningLevel: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n claudeCodePermissionMode: z$1.ZodOptional>;\n claudeCodeMockCliTraffic: z$1.ZodOptional>;\n workflowsEnabled: z$1.ZodBoolean;\n memoryEnabled: z$1.ZodOptional;\n providerSubagentsEnabled: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n permissionMode: z$1.ZodLiteral<\"accept-edits\">;\n permissionScope: z$1.ZodLiteral<\"workspace\">;\n approvalReviewer: z$1.ZodLiteral<\"user\">;\n permissionEscalation: z$1.ZodEnum<{\n ask: \"ask\";\n deny: \"deny\";\n }>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n permissionMode: z$1.ZodLiteral<\"auto\">;\n permissionScope: z$1.ZodLiteral<\"workspace\">;\n approvalReviewer: z$1.ZodLiteral<\"automatic\">;\n permissionEscalation: z$1.ZodEnum<{\n ask: \"ask\";\n deny: \"deny\";\n }>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n permissionMode: z$1.ZodLiteral<\"full\">;\n permissionScope: z$1.ZodLiteral<\"full\">;\n approvalReviewer: z$1.ZodNull;\n permissionEscalation: z$1.ZodNull;\n }, z$1.core.$strip>], \"permissionMode\">>;\n instructions: z$1.ZodString;\n dynamicTools: z$1.ZodArray>;\n injectedSkillSources: z$1.ZodArray;\n treeHash: z$1.ZodString;\n entryPath: z$1.ZodString;\n sourceType: z$1.ZodEnum<{\n builtin: \"builtin\";\n \"data-dir\": \"data-dir\";\n }>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n name: z$1.ZodString;\n description: z$1.ZodString;\n kind: z$1.ZodLiteral<\"workspace-path\">;\n sourceType: z$1.ZodLiteral<\"project\">;\n sourceRootPath: z$1.ZodString;\n skillFilePath: z$1.ZodString;\n }, z$1.core.$strict>], \"kind\">>;\n disallowedTools: z$1.ZodOptional>;\n instructionMode: z$1.ZodEnum<{\n replace: \"replace\";\n append: \"append\";\n }>;\n type: z$1.ZodLiteral<\"thread.start\">;\n requestId: z$1.ZodString;\n input: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n builtin: \"builtin\";\n project: \"project\";\n user: \"user\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n inputGroups: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n builtin: \"builtin\";\n project: \"project\";\n user: \"user\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>>>;\n threadStoragePath: z$1.ZodOptional;\n fork: z$1.ZodOptional>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n providerThreadId: z$1.ZodString;\n }, z$1.core.$strip>, \"settled\", false>;\n \"turn.submit\": HostDaemonCommandDescriptor<\"turn.submit\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n threadId: z$1.ZodString;\n type: z$1.ZodLiteral<\"turn.submit\">;\n requestId: z$1.ZodString;\n input: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n builtin: \"builtin\";\n project: \"project\";\n user: \"user\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n inputGroups: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n builtin: \"builtin\";\n project: \"project\";\n user: \"user\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>>>;\n options: z$1.ZodIntersection;\n reasoningLevel: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n claudeCodePermissionMode: z$1.ZodOptional>;\n claudeCodeMockCliTraffic: z$1.ZodOptional>;\n workflowsEnabled: z$1.ZodBoolean;\n memoryEnabled: z$1.ZodOptional;\n providerSubagentsEnabled: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n permissionMode: z$1.ZodLiteral<\"accept-edits\">;\n permissionScope: z$1.ZodLiteral<\"workspace\">;\n approvalReviewer: z$1.ZodLiteral<\"user\">;\n permissionEscalation: z$1.ZodEnum<{\n ask: \"ask\";\n deny: \"deny\";\n }>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n permissionMode: z$1.ZodLiteral<\"auto\">;\n permissionScope: z$1.ZodLiteral<\"workspace\">;\n approvalReviewer: z$1.ZodLiteral<\"automatic\">;\n permissionEscalation: z$1.ZodEnum<{\n ask: \"ask\";\n deny: \"deny\";\n }>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n permissionMode: z$1.ZodLiteral<\"full\">;\n permissionScope: z$1.ZodLiteral<\"full\">;\n approvalReviewer: z$1.ZodNull;\n permissionEscalation: z$1.ZodNull;\n }, z$1.core.$strip>], \"permissionMode\">>;\n acpLaunchSpec: z$1.ZodOptional;\n env: z$1.ZodRecord;\n cwd: z$1.ZodOptional;\n modelCli: z$1.ZodOptional;\n selectFlag: z$1.ZodOptional;\n primaryModels: z$1.ZodArray;\n }, z$1.core.$strict>, z$1.ZodTransform<{\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n } | undefined, {\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n }>>>;\n reasoningCli: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n nativeReasoning: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n permissionCli: z$1.ZodOptional>;\n workspaceWrite: z$1.ZodOptional>;\n readonly: z$1.ZodOptional>;\n insertAfterArgs: z$1.ZodOptional;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>>;\n resumeContext: z$1.ZodObject<{\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n instructionMode: z$1.ZodEnum<{\n replace: \"replace\";\n append: \"append\";\n }>;\n projectId: z$1.ZodString;\n providerId: z$1.ZodString;\n acpLaunchSpec: z$1.ZodOptional;\n env: z$1.ZodRecord;\n cwd: z$1.ZodOptional;\n modelCli: z$1.ZodOptional;\n selectFlag: z$1.ZodOptional;\n primaryModels: z$1.ZodArray;\n }, z$1.core.$strict>, z$1.ZodTransform<{\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n } | undefined, {\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n }>>>;\n reasoningCli: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n nativeReasoning: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n permissionCli: z$1.ZodOptional>;\n workspaceWrite: z$1.ZodOptional>;\n readonly: z$1.ZodOptional>;\n insertAfterArgs: z$1.ZodOptional;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>>;\n instructions: z$1.ZodString;\n dynamicTools: z$1.ZodArray>;\n injectedSkillSources: z$1.ZodArray;\n treeHash: z$1.ZodString;\n entryPath: z$1.ZodString;\n sourceType: z$1.ZodEnum<{\n builtin: \"builtin\";\n \"data-dir\": \"data-dir\";\n }>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n name: z$1.ZodString;\n description: z$1.ZodString;\n kind: z$1.ZodLiteral<\"workspace-path\">;\n sourceType: z$1.ZodLiteral<\"project\">;\n sourceRootPath: z$1.ZodString;\n skillFilePath: z$1.ZodString;\n }, z$1.core.$strict>], \"kind\">>;\n disallowedTools: z$1.ZodOptional>;\n providerThreadId: z$1.ZodString;\n }, z$1.core.$strict>;\n target: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n mode: z$1.ZodLiteral<\"start\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n mode: z$1.ZodLiteral<\"auto\">;\n expectedTurnId: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n mode: z$1.ZodLiteral<\"steer\">;\n expectedTurnId: z$1.ZodNullable;\n }, z$1.core.$strip>], \"mode\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n appliedAs: z$1.ZodEnum<{\n steer: \"steer\";\n \"new-turn\": \"new-turn\";\n }>;\n }, z$1.core.$strip>, \"settled\", false>;\n \"thread.stop\": HostDaemonCommandDescriptor<\"thread.stop\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n threadId: z$1.ZodString;\n type: z$1.ZodLiteral<\"thread.stop\">;\n }, z$1.core.$strict>, z$1.ZodObject<{}, z$1.core.$strip>, \"settled\", false>;\n \"thread.goal.clear\": HostDaemonCommandDescriptor<\"thread.goal.clear\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n threadId: z$1.ZodString;\n type: z$1.ZodLiteral<\"thread.goal.clear\">;\n options: z$1.ZodIntersection;\n reasoningLevel: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n claudeCodePermissionMode: z$1.ZodOptional>;\n claudeCodeMockCliTraffic: z$1.ZodOptional>;\n workflowsEnabled: z$1.ZodBoolean;\n memoryEnabled: z$1.ZodOptional;\n providerSubagentsEnabled: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n permissionMode: z$1.ZodLiteral<\"accept-edits\">;\n permissionScope: z$1.ZodLiteral<\"workspace\">;\n approvalReviewer: z$1.ZodLiteral<\"user\">;\n permissionEscalation: z$1.ZodEnum<{\n ask: \"ask\";\n deny: \"deny\";\n }>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n permissionMode: z$1.ZodLiteral<\"auto\">;\n permissionScope: z$1.ZodLiteral<\"workspace\">;\n approvalReviewer: z$1.ZodLiteral<\"automatic\">;\n permissionEscalation: z$1.ZodEnum<{\n ask: \"ask\";\n deny: \"deny\";\n }>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n permissionMode: z$1.ZodLiteral<\"full\">;\n permissionScope: z$1.ZodLiteral<\"full\">;\n approvalReviewer: z$1.ZodNull;\n permissionEscalation: z$1.ZodNull;\n }, z$1.core.$strip>], \"permissionMode\">>;\n acpLaunchSpec: z$1.ZodOptional;\n env: z$1.ZodRecord;\n cwd: z$1.ZodOptional;\n modelCli: z$1.ZodOptional;\n selectFlag: z$1.ZodOptional;\n primaryModels: z$1.ZodArray;\n }, z$1.core.$strict>, z$1.ZodTransform<{\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n } | undefined, {\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n }>>>;\n reasoningCli: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n nativeReasoning: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n permissionCli: z$1.ZodOptional>;\n workspaceWrite: z$1.ZodOptional>;\n readonly: z$1.ZodOptional>;\n insertAfterArgs: z$1.ZodOptional;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>>;\n resumeContext: z$1.ZodObject<{\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n instructionMode: z$1.ZodEnum<{\n replace: \"replace\";\n append: \"append\";\n }>;\n projectId: z$1.ZodString;\n providerId: z$1.ZodString;\n acpLaunchSpec: z$1.ZodOptional;\n env: z$1.ZodRecord;\n cwd: z$1.ZodOptional;\n modelCli: z$1.ZodOptional;\n selectFlag: z$1.ZodOptional;\n primaryModels: z$1.ZodArray;\n }, z$1.core.$strict>, z$1.ZodTransform<{\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n } | undefined, {\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n }>>>;\n reasoningCli: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n nativeReasoning: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n permissionCli: z$1.ZodOptional>;\n workspaceWrite: z$1.ZodOptional>;\n readonly: z$1.ZodOptional>;\n insertAfterArgs: z$1.ZodOptional;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>>;\n instructions: z$1.ZodString;\n dynamicTools: z$1.ZodArray>;\n injectedSkillSources: z$1.ZodArray;\n treeHash: z$1.ZodString;\n entryPath: z$1.ZodString;\n sourceType: z$1.ZodEnum<{\n builtin: \"builtin\";\n \"data-dir\": \"data-dir\";\n }>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n name: z$1.ZodString;\n description: z$1.ZodString;\n kind: z$1.ZodLiteral<\"workspace-path\">;\n sourceType: z$1.ZodLiteral<\"project\">;\n sourceRootPath: z$1.ZodString;\n skillFilePath: z$1.ZodString;\n }, z$1.core.$strict>], \"kind\">>;\n disallowedTools: z$1.ZodOptional>;\n providerThreadId: z$1.ZodString;\n }, z$1.core.$strict>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n cleared: z$1.ZodBoolean;\n }, z$1.core.$strict>, \"settled\", false>;\n \"thread.plan.cancel\": HostDaemonCommandDescriptor<\"thread.plan.cancel\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n threadId: z$1.ZodString;\n type: z$1.ZodLiteral<\"thread.plan.cancel\">;\n expectedTurnId: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n cancelled: z$1.ZodBoolean;\n }, z$1.core.$strict>, \"settled\", false>;\n \"thread.rename\": HostDaemonCommandDescriptor<\"thread.rename\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n threadId: z$1.ZodString;\n type: z$1.ZodLiteral<\"thread.rename\">;\n title: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{}, z$1.core.$strip>, \"settled\", false>;\n \"thread.archive\": HostDaemonCommandDescriptor<\"thread.archive\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n threadId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"thread.archive\">;\n providerId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{}, z$1.core.$strip>, \"settled\", false>;\n \"thread.unarchive\": HostDaemonCommandDescriptor<\"thread.unarchive\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n threadId: z$1.ZodString;\n type: z$1.ZodLiteral<\"thread.unarchive\">;\n providerId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{}, z$1.core.$strip>, \"settled\", false>;\n \"interactive.resolve\": HostDaemonCommandDescriptor<\"interactive.resolve\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n threadId: z$1.ZodString;\n type: z$1.ZodLiteral<\"interactive.resolve\">;\n interactionId: z$1.ZodString;\n providerId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n providerRequestId: z$1.ZodString;\n resolution: z$1.ZodUnion;\n grantedPermissions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"allow_for_session\">;\n grantedPermissions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"deny\">;\n }, z$1.core.$strip>], \"decision\">, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"user_answer\">;\n answers: z$1.ZodRecord;\n freeText: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin_submitted\">;\n }, z$1.core.$strip>]>;\n }, z$1.core.$strict>, z$1.ZodObject<{}, z$1.core.$strip>, \"settled\", false>;\n \"codex.inference.complete\": HostDaemonCommandDescriptor<\"codex.inference.complete\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"codex.inference.complete\">;\n model: z$1.ZodString;\n prompt: z$1.ZodString;\n outputSchema: z$1.ZodType>;\n timeoutMs: z$1.ZodNumber;\n }, z$1.core.$strict>, z$1.ZodObject<{\n model: z$1.ZodString;\n value: z$1.ZodType>;\n }, z$1.core.$strip>, \"settled\", false>;\n \"codex.voice.transcribe\": HostDaemonCommandDescriptor<\"codex.voice.transcribe\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"codex.voice.transcribe\">;\n model: z$1.ZodString;\n audioBase64: z$1.ZodString;\n mimeType: z$1.ZodString;\n filename: z$1.ZodString;\n prompt: z$1.ZodNullable;\n timeoutMs: z$1.ZodNumber;\n }, z$1.core.$strict>, z$1.ZodObject<{\n model: z$1.ZodString;\n text: z$1.ZodString;\n }, z$1.core.$strip>, \"settled\", false>;\n \"environment.provision\": HostDaemonCommandDescriptor<\"environment.provision\", z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n environmentId: z$1.ZodString;\n type: z$1.ZodLiteral<\"environment.provision\">;\n initiator: z$1.ZodNullable>;\n workspaceProvisionType: z$1.ZodLiteral<\"unmanaged\">;\n path: z$1.ZodString;\n checkout: z$1.ZodOptional;\n name: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"new\">;\n name: z$1.ZodString;\n baseBranch: z$1.ZodString;\n }, z$1.core.$strict>], \"kind\">>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodString;\n type: z$1.ZodLiteral<\"environment.provision\">;\n initiator: z$1.ZodNullable>;\n sourcePath: z$1.ZodString;\n targetPath: z$1.ZodString;\n branchName: z$1.ZodString;\n baseBranch: z$1.ZodNullable;\n setupTimeoutMs: z$1.ZodNumber;\n workspaceProvisionType: z$1.ZodLiteral<\"managed-worktree\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodString;\n type: z$1.ZodLiteral<\"environment.provision\">;\n initiator: z$1.ZodNullable>;\n workspaceProvisionType: z$1.ZodLiteral<\"personal\">;\n targetPath: z$1.ZodString;\n }, z$1.core.$strict>], \"workspaceProvisionType\">, z$1.ZodObject<{\n path: z$1.ZodString;\n isGitRepo: z$1.ZodBoolean;\n isWorktree: z$1.ZodBoolean;\n branchName: z$1.ZodNullable;\n defaultBranch: z$1.ZodNullable;\n transcript: z$1.ZodArray;\n key: z$1.ZodString;\n text: z$1.ZodString;\n startedAt: z$1.ZodOptional;\n status: z$1.ZodOptional>;\n metadata: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, \"settled\", false>;\n \"project.clone\": HostDaemonCommandDescriptor<\"project.clone\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"project.clone\">;\n remoteUrl: z$1.ZodString;\n projectSlug: z$1.ZodString;\n targetPath: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodObject<{\n path: z$1.ZodString;\n gitRemoteUrl: z$1.ZodNullable;\n }, z$1.core.$strict>, \"settled\", false>;\n \"environment.provision.cancel\": HostDaemonCommandDescriptor<\"environment.provision.cancel\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n type: z$1.ZodLiteral<\"environment.provision.cancel\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n aborted: z$1.ZodBoolean;\n }, z$1.core.$strip>, \"settled\", false>;\n \"environment.destroy\": HostDaemonCommandDescriptor<\"environment.destroy\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"environment.destroy\">;\n }, z$1.core.$strict>, z$1.ZodObject<{}, z$1.core.$strip>, \"settled\", false>;\n \"workspace.commit\": HostDaemonCommandDescriptor<\"workspace.commit\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.commit\">;\n message: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n commitSha: z$1.ZodString;\n commitSubject: z$1.ZodString;\n }, z$1.core.$strip>, \"settled\", false>;\n \"workspace.squash_merge\": HostDaemonCommandDescriptor<\"workspace.squash_merge\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.squash_merge\">;\n targetBranch: z$1.ZodString;\n commitMessage: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n commitSha: z$1.ZodString;\n commitSubject: z$1.ZodString;\n merged: z$1.ZodBoolean;\n }, z$1.core.$strip>, \"settled\", false>;\n \"workspace.pull_request_action\": HostDaemonCommandDescriptor<\"workspace.pull_request_action\", z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.pull_request_action\">;\n operation: z$1.ZodLiteral<\"ready\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.pull_request_action\">;\n operation: z$1.ZodLiteral<\"draft\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.pull_request_action\">;\n operation: z$1.ZodLiteral<\"merge\">;\n method: z$1.ZodEnum<{\n merge: \"merge\";\n squash: \"squash\";\n rebase: \"rebase\";\n }>;\n }, z$1.core.$strict>], \"operation\">, z$1.ZodObject<{}, z$1.core.$strict>, \"settled\", false>;\n \"host.list_files\": HostDaemonCommandDescriptor<\"host.list_files\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.list_files\">;\n path: z$1.ZodString;\n query: z$1.ZodOptional;\n limit: z$1.ZodNumber;\n }, z$1.core.$strip>, z$1.ZodObject<{\n files: z$1.ZodArray>;\n truncated: z$1.ZodBoolean;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"host.list_paths\": HostDaemonCommandDescriptor<\"host.list_paths\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.list_paths\">;\n path: z$1.ZodString;\n query: z$1.ZodOptional;\n limit: z$1.ZodNumber;\n includeFiles: z$1.ZodBoolean;\n includeDirectories: z$1.ZodBoolean;\n }, z$1.core.$strip>, z$1.ZodObject<{\n paths: z$1.ZodArray;\n path: z$1.ZodString;\n name: z$1.ZodString;\n score: z$1.ZodNumber;\n positions: z$1.ZodArray;\n }, z$1.core.$strip>>;\n truncated: z$1.ZodBoolean;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"host.mkdir\": HostDaemonCommandDescriptor<\"host.mkdir\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.mkdir\">;\n path: z$1.ZodString;\n rootPath: z$1.ZodOptional;\n recursive: z$1.ZodBoolean;\n }, z$1.core.$strict>, z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n }, z$1.core.$strict>, \"onlineRpc\", false>;\n \"host.move_path\": HostDaemonCommandDescriptor<\"host.move_path\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.move_path\">;\n sourcePath: z$1.ZodString;\n destinationPath: z$1.ZodString;\n rootPath: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n }, z$1.core.$strict>, \"onlineRpc\", false>;\n \"host.remove_path\": HostDaemonCommandDescriptor<\"host.remove_path\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.remove_path\">;\n path: z$1.ZodString;\n rootPath: z$1.ZodOptional;\n recursive: z$1.ZodBoolean;\n }, z$1.core.$strict>, z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n }, z$1.core.$strict>, \"onlineRpc\", false>;\n \"host.browse_directory\": HostDaemonCommandDescriptor<\"host.browse_directory\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.browse_directory\">;\n path: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n directory: z$1.ZodString;\n parent: z$1.ZodNullable;\n entries: z$1.ZodArray;\n name: z$1.ZodString;\n path: z$1.ZodString;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"host.paths_exist\": HostDaemonCommandDescriptor<\"host.paths_exist\", z$1.ZodObject<{\n paths: z$1.ZodPipe, z$1.ZodTransform>;\n type: z$1.ZodLiteral<\"host.paths_exist\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n existence: z$1.ZodRecord;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"project.inspect\": HostDaemonCommandDescriptor<\"project.inspect\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"project.inspect\">;\n path: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n path: z$1.ZodString;\n gitRemoteUrl: z$1.ZodNullable;\n }, z$1.core.$strict>, \"onlineRpc\", true>;\n \"project.clone_default_path\": HostDaemonCommandDescriptor<\"project.clone_default_path\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"project.clone_default_path\">;\n projectSlug: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n path: z$1.ZodString;\n }, z$1.core.$strict>, \"onlineRpc\", true>;\n \"host.pick_folder\": HostDaemonCommandDescriptor<\"host.pick_folder\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.pick_folder\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, \"onlineRpc\", false>;\n \"host.caffeinate\": HostDaemonCommandDescriptor<\"host.caffeinate\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.caffeinate\">;\n enabled: z$1.ZodBoolean;\n }, z$1.core.$strict>, z$1.ZodObject<{\n enabled: z$1.ZodBoolean;\n supported: z$1.ZodBoolean;\n }, z$1.core.$strict>, \"onlineRpc\", false>;\n \"connect-tunnel.ensure-identity\": HostDaemonCommandDescriptor<\"connect-tunnel.ensure-identity\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"connect-tunnel.ensure-identity\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n label: z$1.ZodString;\n baseDomain: z$1.ZodString;\n }, z$1.core.$strict>, \"onlineRpc\", true>;\n \"host.list_commands\": HostDaemonCommandDescriptor<\"host.list_commands\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.list_commands\">;\n providerId: z$1.ZodString;\n cwd: z$1.ZodNullable;\n }, z$1.core.$strict>, z$1.ZodObject<{\n commands: z$1.ZodArray;\n origin: z$1.ZodEnum<{\n project: \"project\";\n user: \"user\";\n }>;\n description: z$1.ZodNullable;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"host.list_skills\": HostDaemonCommandDescriptor<\"host.list_skills\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.list_skills\">;\n providerId: z$1.ZodString;\n cwd: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n skills: z$1.ZodArray;\n filePath: z$1.ZodString;\n rootKind: z$1.ZodEnum<{\n plugin: \"plugin\";\n \"bb-project\": \"bb-project\";\n \"bb-data-dir\": \"bb-data-dir\";\n \"bb-builtin\": \"bb-builtin\";\n \"provider-project\": \"provider-project\";\n \"provider-user\": \"provider-user\";\n }>;\n linked: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"host.delete_skill\": HostDaemonCommandDescriptor<\"host.delete_skill\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.delete_skill\">;\n scope: z$1.ZodEnum<{\n \"bb-project\": \"bb-project\";\n \"bb-user\": \"bb-user\";\n \"claude-user\": \"claude-user\";\n \"claude-project\": \"claude-project\";\n \"codex-user\": \"codex-user\";\n \"codex-project\": \"codex-project\";\n }>;\n name: z$1.ZodString;\n cwd: z$1.ZodNullable;\n rootPath: z$1.ZodNullable;\n }, z$1.core.$strict>, z$1.ZodObject<{\n deletedPath: z$1.ZodString;\n }, z$1.core.$strip>, \"onlineRpc\", false>;\n \"host.write_skill\": HostDaemonCommandDescriptor<\"host.write_skill\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.write_skill\">;\n scope: z$1.ZodEnum<{\n \"bb-project\": \"bb-project\";\n \"bb-user\": \"bb-user\";\n }>;\n name: z$1.ZodString;\n cwd: z$1.ZodNullable;\n content: z$1.ZodString;\n expectedSha256: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"written\">;\n filePath: z$1.ZodString;\n sha256: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"conflict\">;\n currentSha256: z$1.ZodNullable;\n }, z$1.core.$strip>], \"outcome\">, \"onlineRpc\", false>;\n \"host.list_branches\": HostDaemonCommandDescriptor<\"host.list_branches\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.list_branches\">;\n path: z$1.ZodString;\n query: z$1.ZodOptional;\n selectedBranch: z$1.ZodOptional;\n limit: z$1.ZodNumber;\n }, z$1.core.$strip>, z$1.ZodObject<{\n branches: z$1.ZodArray;\n branchesTruncated: z$1.ZodBoolean;\n checkout: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"branch\">;\n branchName: z$1.ZodString;\n headSha: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"detached\">;\n headSha: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unborn\">;\n branchName: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unknown\">;\n reason: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">;\n defaultBranch: z$1.ZodNullable;\n defaultBranchRelation: z$1.ZodNullable>;\n hasUncommittedChanges: z$1.ZodBoolean;\n operation: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"none\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"merge\">;\n hasConflicts: z$1.ZodBoolean;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"rebase\">;\n hasConflicts: z$1.ZodBoolean;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"cherry-pick\">;\n hasConflicts: z$1.ZodBoolean;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"revert\">;\n hasConflicts: z$1.ZodBoolean;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unknown\">;\n reason: z$1.ZodString;\n hasConflicts: z$1.ZodBoolean;\n }, z$1.core.$strip>], \"kind\">;\n originDefaultBranch: z$1.ZodNullable;\n remoteBranches: z$1.ZodArray;\n remoteBranchesTruncated: z$1.ZodBoolean;\n selectedBranch: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"host.file_metadata\": HostDaemonCommandDescriptor<\"host.file_metadata\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.file_metadata\">;\n path: z$1.ZodString;\n rootPath: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodObject<{\n path: z$1.ZodString;\n modifiedAtMs: z$1.ZodNumber;\n sizeBytes: z$1.ZodNumber;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"host.read_file\": HostDaemonCommandDescriptor<\"host.read_file\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.read_file\">;\n path: z$1.ZodString;\n rootPath: z$1.ZodOptional;\n ref: z$1.ZodOptional;\n }, z$1.core.$strip>, z$1.ZodObject<{\n path: z$1.ZodString;\n content: z$1.ZodString;\n contentEncoding: z$1.ZodEnum<{\n base64: \"base64\";\n utf8: \"utf8\";\n }>;\n mimeType: z$1.ZodOptional;\n sizeBytes: z$1.ZodNumber;\n modifiedAtMs: z$1.ZodOptional;\n sha256: z$1.ZodString;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"host.read_file_relative\": HostDaemonCommandDescriptor<\"host.read_file_relative\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.read_file_relative\">;\n rootPath: z$1.ZodString;\n path: z$1.ZodString;\n dotfiles: z$1.ZodEnum<{\n deny: \"deny\";\n allow: \"allow\";\n }>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n path: z$1.ZodString;\n content: z$1.ZodString;\n contentEncoding: z$1.ZodEnum<{\n base64: \"base64\";\n utf8: \"utf8\";\n }>;\n mimeType: z$1.ZodOptional;\n sizeBytes: z$1.ZodNumber;\n modifiedAtMs: z$1.ZodOptional;\n sha256: z$1.ZodString;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"host.write_file\": HostDaemonCommandDescriptor<\"host.write_file\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.write_file\">;\n path: z$1.ZodString;\n rootPath: z$1.ZodOptional;\n content: z$1.ZodString;\n contentEncoding: z$1.ZodEnum<{\n base64: \"base64\";\n utf8: \"utf8\";\n }>;\n createParents: z$1.ZodBoolean;\n expectedSha256: z$1.ZodOptional>;\n mode: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"written\">;\n sha256: z$1.ZodString;\n sizeBytes: z$1.ZodNumber;\n }, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"conflict\">;\n currentSha256: z$1.ZodNullable;\n }, z$1.core.$strict>], \"outcome\">, \"onlineRpc\", false>;\n \"provider.list_models\": HostDaemonCommandDescriptor<\"provider.list_models\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"provider.list_models\">;\n providerId: z$1.ZodString;\n acpLaunchSpec: z$1.ZodOptional;\n env: z$1.ZodRecord;\n cwd: z$1.ZodOptional;\n modelCli: z$1.ZodOptional;\n selectFlag: z$1.ZodOptional;\n primaryModels: z$1.ZodArray;\n }, z$1.core.$strict>, z$1.ZodTransform<{\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n } | undefined, {\n listArgs: string[];\n primaryModels: string[];\n selectFlag?: string | undefined;\n }>>>;\n reasoningCli: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n nativeReasoning: z$1.ZodOptional>;\n levelValues: z$1.ZodOptional & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n permissionCli: z$1.ZodOptional>;\n workspaceWrite: z$1.ZodOptional>;\n readonly: z$1.ZodOptional>;\n insertAfterArgs: z$1.ZodOptional;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n models: z$1.ZodArray;\n description: z$1.ZodString;\n }, z$1.core.$strip>>;\n defaultReasoningEffort: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n isDefault: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n selectedOnlyModels: z$1.ZodArray;\n description: z$1.ZodString;\n }, z$1.core.$strip>>;\n defaultReasoningEffort: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n isDefault: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"known_acp_agents.status\": HostDaemonCommandDescriptor<\"known_acp_agents.status\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"known_acp_agents.status\">;\n agents: z$1.ZodArray>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n agents: z$1.ZodArray;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>, \"onlineRpc\", true>;\n \"provider.usage\": HostDaemonCommandDescriptor<\"provider.usage\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"provider.usage\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n codex: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n status: z$1.ZodLiteral<\"ok\">;\n accountEmail: z$1.ZodNullable;\n planLabel: z$1.ZodNullable;\n windows: z$1.ZodArray;\n cost: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"not_installed\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"unauthenticated\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"expired\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"error\">;\n message: z$1.ZodString;\n }, z$1.core.$strip>], \"status\">;\n claudeCode: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n status: z$1.ZodLiteral<\"ok\">;\n accountEmail: z$1.ZodNullable;\n planLabel: z$1.ZodNullable;\n windows: z$1.ZodArray;\n cost: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"not_installed\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"unauthenticated\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"expired\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"error\">;\n message: z$1.ZodString;\n }, z$1.core.$strip>], \"status\">;\n cursor: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n status: z$1.ZodLiteral<\"ok\">;\n accountEmail: z$1.ZodNullable;\n planLabel: z$1.ZodNullable;\n windows: z$1.ZodArray;\n cost: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"not_installed\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"unauthenticated\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"expired\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n status: z$1.ZodLiteral<\"error\">;\n message: z$1.ZodString;\n }, z$1.core.$strip>], \"status\">;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"provider_cli.status\": HostDaemonCommandDescriptor<\"provider_cli.status\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"provider_cli.status\">;\n }, z$1.core.$strict>, z$1.ZodRecord, z$1.ZodObject<{\n displayName: z$1.ZodString;\n executableName: z$1.ZodString;\n executablePath: z$1.ZodNullable;\n installed: z$1.ZodBoolean;\n installSource: z$1.ZodEnum<{\n notInstalled: \"notInstalled\";\n npmGlobal: \"npmGlobal\";\n external: \"external\";\n }>;\n currentVersion: z$1.ZodNullable;\n latestVersion: z$1.ZodNullable;\n minimumSupportedVersion: z$1.ZodNullable;\n npmPackageName: z$1.ZodNullable;\n npmGlobalPackageVersion: z$1.ZodNullable;\n installAction: z$1.ZodNullable;\n label: z$1.ZodEnum<{\n Install: \"Install\";\n Update: \"Update\";\n }>;\n commandKind: z$1.ZodEnum<{\n exec: \"exec\";\n shell: \"shell\";\n }>;\n command: z$1.ZodString;\n }, z$1.core.$strip>>;\n needsUpdate: z$1.ZodBoolean;\n versionUnsupported: z$1.ZodBoolean;\n }, z$1.core.$strip>>, \"onlineRpc\", true>;\n \"provider_cli.install\": HostDaemonCommandDescriptor<\"provider_cli.install\", z$1.ZodObject<{\n provider: z$1.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n }>;\n actionKind: z$1.ZodEnum<{\n install: \"install\";\n update: \"update\";\n }>;\n type: z$1.ZodLiteral<\"provider_cli.install\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n events: z$1.ZodArray;\n provider: z$1.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n }>;\n command: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"output\">;\n provider: z$1.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n }>;\n stream: z$1.ZodEnum<{\n stdout: \"stdout\";\n stderr: \"stderr\";\n }>;\n text: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"completed\">;\n provider: z$1.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n }>;\n exitCode: z$1.ZodNullable;\n signal: z$1.ZodNullable;\n success: z$1.ZodBoolean;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"error\">;\n provider: z$1.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n }>;\n message: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">>;\n }, z$1.core.$strict>, \"onlineRpc\", false>;\n \"workspace.status\": HostDaemonCommandDescriptor<\"workspace.status\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.status\">;\n mergeBaseBranch: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n workspaceStatus: z$1.ZodObject<{\n workingTree: z$1.ZodObject<{\n insertions: z$1.ZodNumber;\n deletions: z$1.ZodNumber;\n files: z$1.ZodArray;\n insertions: z$1.ZodNullable;\n deletions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n hasUncommittedChanges: z$1.ZodBoolean;\n state: z$1.ZodEnum<{\n clean: \"clean\";\n untracked: \"untracked\";\n dirty_uncommitted: \"dirty_uncommitted\";\n committed_unmerged: \"committed_unmerged\";\n dirty_and_committed_unmerged: \"dirty_and_committed_unmerged\";\n }>;\n }, z$1.core.$strip>;\n checkout: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"branch\">;\n branchName: z$1.ZodString;\n headSha: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"detached\">;\n headSha: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unborn\">;\n branchName: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unknown\">;\n reason: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">;\n branch: z$1.ZodObject<{\n currentBranch: z$1.ZodNullable;\n defaultBranch: z$1.ZodString;\n }, z$1.core.$strip>;\n mergeBase: z$1.ZodNullable;\n insertions: z$1.ZodNullable;\n deletions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n mergeBaseBranch: z$1.ZodString;\n baseRef: z$1.ZodNullable;\n aheadCount: z$1.ZodNumber;\n behindCount: z$1.ZodNumber;\n hasCommittedUnmergedChanges: z$1.ZodBoolean;\n commits: z$1.ZodArray>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"unavailable\">;\n failure: z$1.ZodObject<{\n code: z$1.ZodEnum<{\n unknown: \"unknown\";\n path_not_found: \"path_not_found\";\n not_git_repo: \"not_git_repo\";\n not_worktree: \"not_worktree\";\n workspace_type_mismatch: \"workspace_type_mismatch\";\n permission_denied: \"permission_denied\";\n unknown_environment: \"unknown_environment\";\n }>;\n workspacePath: z$1.ZodString;\n message: z$1.ZodString;\n }, z$1.core.$strict>;\n }, z$1.core.$strict>], \"outcome\">, \"onlineRpc\", true>;\n \"workspace.diff\": HostDaemonCommandDescriptor<\"workspace.diff\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.diff\">;\n target: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"uncommitted\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"branch_committed\">;\n mergeBaseBranch: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"all\">;\n mergeBaseBranch: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"commit\">;\n sha: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">;\n maxDiffBytes: z$1.ZodNumber;\n maxFileListBytes: z$1.ZodNumber;\n }, z$1.core.$strict>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n diff: z$1.ZodObject<{\n diff: z$1.ZodString;\n truncated: z$1.ZodBoolean;\n shortstat: z$1.ZodString;\n files: z$1.ZodString;\n mergeBaseRef: z$1.ZodNullable;\n }, z$1.core.$strip>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"unavailable\">;\n failure: z$1.ZodObject<{\n code: z$1.ZodEnum<{\n unknown: \"unknown\";\n path_not_found: \"path_not_found\";\n not_git_repo: \"not_git_repo\";\n not_worktree: \"not_worktree\";\n workspace_type_mismatch: \"workspace_type_mismatch\";\n permission_denied: \"permission_denied\";\n unknown_environment: \"unknown_environment\";\n }>;\n workspacePath: z$1.ZodString;\n message: z$1.ZodString;\n }, z$1.core.$strict>;\n }, z$1.core.$strict>], \"outcome\">, \"onlineRpc\", true>;\n \"workspace.diffFiles\": HostDaemonCommandDescriptor<\"workspace.diffFiles\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.diffFiles\">;\n target: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"uncommitted\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"branch_committed\">;\n mergeBaseBranch: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"all\">;\n mergeBaseBranch: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"commit\">;\n sha: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">;\n }, z$1.core.$strict>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n files: z$1.ZodArray;\n statusLetter: z$1.ZodEnum<{\n M: \"M\";\n A: \"A\";\n D: \"D\";\n R: \"R\";\n C: \"C\";\n T: \"T\";\n }>;\n additions: z$1.ZodNumber;\n deletions: z$1.ZodNumber;\n binary: z$1.ZodBoolean;\n origin: z$1.ZodEnum<{\n untracked: \"untracked\";\n tracked: \"tracked\";\n }>;\n }, z$1.core.$strip>>;\n shortstat: z$1.ZodString;\n mergeBaseRef: z$1.ZodNullable;\n }, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"unavailable\">;\n failure: z$1.ZodObject<{\n code: z$1.ZodEnum<{\n unknown: \"unknown\";\n path_not_found: \"path_not_found\";\n not_git_repo: \"not_git_repo\";\n not_worktree: \"not_worktree\";\n workspace_type_mismatch: \"workspace_type_mismatch\";\n permission_denied: \"permission_denied\";\n unknown_environment: \"unknown_environment\";\n }>;\n workspacePath: z$1.ZodString;\n message: z$1.ZodString;\n }, z$1.core.$strict>;\n }, z$1.core.$strict>], \"outcome\">, \"onlineRpc\", true>;\n \"workspace.diffPatch\": HostDaemonCommandDescriptor<\"workspace.diffPatch\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.diffPatch\">;\n target: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"uncommitted\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"branch_committed\">;\n mergeBaseBranch: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"all\">;\n mergeBaseBranch: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"commit\">;\n sha: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">;\n paths: z$1.ZodArray;\n maxBytesPerFile: z$1.ZodNumber;\n }, z$1.core.$strict>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n patches: z$1.ZodArray>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"unavailable\">;\n failure: z$1.ZodObject<{\n code: z$1.ZodEnum<{\n unknown: \"unknown\";\n path_not_found: \"path_not_found\";\n not_git_repo: \"not_git_repo\";\n not_worktree: \"not_worktree\";\n workspace_type_mismatch: \"workspace_type_mismatch\";\n permission_denied: \"permission_denied\";\n unknown_environment: \"unknown_environment\";\n }>;\n workspacePath: z$1.ZodString;\n message: z$1.ZodString;\n }, z$1.core.$strict>;\n }, z$1.core.$strict>], \"outcome\">, \"onlineRpc\", true>;\n \"workspace.pull_request\": HostDaemonCommandDescriptor<\"workspace.pull_request\", z$1.ZodObject<{\n environmentId: z$1.ZodString;\n workspaceContext: z$1.ZodObject<{\n workspacePath: z$1.ZodString;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n }, z$1.core.$strip>;\n type: z$1.ZodLiteral<\"workspace.pull_request\">;\n }, z$1.core.$strict>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n pullRequest: z$1.ZodObject<{\n number: z$1.ZodNumber;\n title: z$1.ZodString;\n state: z$1.ZodEnum<{\n OPEN: \"OPEN\";\n CLOSED: \"CLOSED\";\n MERGED: \"MERGED\";\n }>;\n url: z$1.ZodString;\n isDraft: z$1.ZodBoolean;\n baseRefName: z$1.ZodString;\n headRefName: z$1.ZodString;\n updatedAt: z$1.ZodString;\n checks: z$1.ZodArray;\n conclusion: z$1.ZodNullable>;\n url: z$1.ZodNullable;\n }, z$1.core.$strict>>;\n reviewDecision: z$1.ZodNullable>;\n reviewRequestCount: z$1.ZodNumber;\n mergeStateStatus: z$1.ZodNullable>;\n mergeable: z$1.ZodNullable>;\n }, z$1.core.$strict>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"absent\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"unavailable\">;\n message: z$1.ZodString;\n }, z$1.core.$strict>], \"outcome\">, \"onlineRpc\", true>;\n};\ntype HostDaemonCommandRegistry = typeof hostDaemonCommandRegistry;\ntype AnyHostDaemonCommandDescriptor = HostDaemonCommandRegistry[keyof HostDaemonCommandRegistry];\ntype HostDaemonCommandDescriptorForTransport = Extract;\ntype HostDaemonResultSchemaMapForTransport = {\n [Descriptor in HostDaemonCommandDescriptorForTransport as Descriptor[\"type\"]]: Descriptor[\"resultSchema\"];\n};\ntype HostDaemonOnlineRpcResultSchemaMap = HostDaemonResultSchemaMapForTransport<\"onlineRpc\">;\ntype HostDaemonOnlineRpcResultByType = {\n [K in keyof HostDaemonOnlineRpcResultSchemaMap]: z$1.infer;\n};\n\ndeclare const pickFolderResponseSchema: z$1.ZodObject<{\n path: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype PickFolderResponse = z$1.infer;\ndeclare const pathsExistRequestSchema: z$1.ZodObject<{\n paths: z$1.ZodPipe, z$1.ZodTransform>;\n}, z$1.core.$strip>;\ntype PathsExistRequest = z$1.infer;\ndeclare const pathsExistResponseSchema: z$1.ZodObject<{\n existence: z$1.ZodRecord;\n}, z$1.core.$strip>;\ntype PathsExistResponse = z$1.infer;\ndeclare const providerCliStatusResponseSchema: z$1.ZodRecord, z$1.ZodObject<{\n displayName: z$1.ZodString;\n executableName: z$1.ZodString;\n executablePath: z$1.ZodNullable;\n installed: z$1.ZodBoolean;\n installSource: z$1.ZodEnum<{\n notInstalled: \"notInstalled\";\n npmGlobal: \"npmGlobal\";\n external: \"external\";\n }>;\n currentVersion: z$1.ZodNullable;\n latestVersion: z$1.ZodNullable;\n minimumSupportedVersion: z$1.ZodNullable;\n npmPackageName: z$1.ZodNullable;\n npmGlobalPackageVersion: z$1.ZodNullable;\n installAction: z$1.ZodNullable;\n label: z$1.ZodEnum<{\n Install: \"Install\";\n Update: \"Update\";\n }>;\n commandKind: z$1.ZodEnum<{\n exec: \"exec\";\n shell: \"shell\";\n }>;\n command: z$1.ZodString;\n }, z$1.core.$strip>>;\n needsUpdate: z$1.ZodBoolean;\n versionUnsupported: z$1.ZodBoolean;\n}, z$1.core.$strip>>;\ntype ProviderCliStatusResponse = z$1.infer;\ndeclare const providerCliInstallRequestSchema: z$1.ZodObject<{\n provider: z$1.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n }>;\n actionKind: z$1.ZodEnum<{\n install: \"install\";\n update: \"update\";\n }>;\n}, z$1.core.$strip>;\ntype ProviderCliInstallRequest = z$1.infer;\ndeclare const providerCliInstallEventSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"started\">;\n provider: z$1.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n }>;\n command: z$1.ZodString;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"output\">;\n provider: z$1.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n }>;\n stream: z$1.ZodEnum<{\n stdout: \"stdout\";\n stderr: \"stderr\";\n }>;\n text: z$1.ZodString;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"completed\">;\n provider: z$1.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n }>;\n exitCode: z$1.ZodNullable;\n signal: z$1.ZodNullable;\n success: z$1.ZodBoolean;\n}, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"error\">;\n provider: z$1.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n }>;\n message: z$1.ZodString;\n}, z$1.core.$strip>], \"type\">;\ntype ProviderCliInstallEvent = z$1.infer;\n\ninterface CreateFilePreviewResponse {\n baseUrl: string;\n expiresAtMs: number;\n}\ntype HostFileReadResponse = HostDaemonOnlineRpcResultByType[\"host.read_file\"];\ntype HostFileWriteResponse = HostDaemonOnlineRpcResultByType[\"host.write_file\"];\ntype HostFileListResponse = HostDaemonOnlineRpcResultByType[\"host.list_files\"];\ntype HostPathListResponse = HostDaemonOnlineRpcResultByType[\"host.list_paths\"];\ntype HostMkdirResponse = HostDaemonOnlineRpcResultByType[\"host.mkdir\"];\ntype HostMovePathResponse = HostDaemonOnlineRpcResultByType[\"host.move_path\"];\ntype HostRemovePathResponse = HostDaemonOnlineRpcResultByType[\"host.remove_path\"];\n\n/**\n * Query for `GET /hosts/:id/directory`, the interactive path browser's\n * single-level directory read. `path` is an absolute directory on the host;\n * omitting it lists the host's home directory (the daemon resolves it, since a\n * remote caller cannot know the host's home).\n */\ndeclare const hostDirectoryQuerySchema: z$1.ZodObject<{\n path: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype HostDirectoryQuery = z$1.infer;\ndeclare const hostDirectoryListingSchema: z$1.ZodObject<{\n directory: z$1.ZodString;\n parent: z$1.ZodNullable;\n entries: z$1.ZodArray;\n name: z$1.ZodString;\n path: z$1.ZodString;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype HostDirectoryListing = z$1.infer;\n/** Project name is sent so the daemon can derive its host-local checkout path. */\ndeclare const hostCloneDefaultPathQuerySchema: z$1.ZodObject<{\n projectId: z$1.ZodString;\n}, z$1.core.$strip>;\ntype HostCloneDefaultPathQuery = z$1.infer;\ndeclare const hostCloneDefaultPathResponseSchema: z$1.ZodObject<{\n path: z$1.ZodString;\n}, z$1.core.$strict>;\ntype HostCloneDefaultPathResponse = z$1.infer;\ndeclare const createHostJoinCodeResponseSchema: z$1.ZodObject<{\n joinCode: z$1.ZodString;\n hostId: z$1.ZodString;\n expiresAt: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype CreateHostJoinCodeResponse = z$1.infer;\ndeclare const updateHostRequestSchema: z$1.ZodObject<{\n name: z$1.ZodString;\n}, z$1.core.$strict>;\ntype UpdateHostRequest = z$1.infer;\ndeclare const hostRetryUpdateResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n}, z$1.core.$strict>;\ntype HostRetryUpdateResponse = z$1.infer;\ntype HostPathsExistRequest = PathsExistRequest;\ntype HostPathsExistResponse = PathsExistResponse;\ndeclare const hostPickFolderRequestSchema: z$1.ZodObject<{\n clientHostId: z$1.ZodString;\n}, z$1.core.$strict>;\ntype HostPickFolderRequest = z$1.infer;\ntype HostPickFolderResponse = PickFolderResponse;\ntype HostProviderCliStatusResponse = ProviderCliStatusResponse;\ntype HostProviderCliInstallRequest = ProviderCliInstallRequest;\ntype HostProviderCliInstallEvent = ProviderCliInstallEvent;\n\ndeclare const pluginUpdateCheckEntrySchema: z$1.ZodObject<{\n id: z$1.ZodString;\n outcome: z$1.ZodEnum<{\n unavailable: \"unavailable\";\n incompatible: \"incompatible\";\n current: \"current\";\n \"update-available\": \"update-available\";\n pinned: \"pinned\";\n }>;\n devMode: z$1.ZodOptional>;\n installed: z$1.ZodObject<{\n version: z$1.ZodString;\n display: z$1.ZodString;\n }, z$1.core.$strip>;\n candidate: z$1.ZodOptional>;\n blocked: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n detail: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype PluginUpdateCheckEntry = z$1.infer;\ndeclare const pluginApplyUpdateResultSchema: z$1.ZodObject<{\n applied: z$1.ZodBoolean;\n from: z$1.ZodObject<{\n version: z$1.ZodString;\n display: z$1.ZodString;\n }, z$1.core.$strip>;\n to: z$1.ZodOptional>;\n outcome: z$1.ZodEnum<{\n current: \"current\";\n updated: \"updated\";\n \"rolled-back\": \"rolled-back\";\n }>;\n detail: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype PluginApplyUpdateResult$1 = z$1.infer;\ndeclare const pluginSourceDetailSchema: z$1.ZodObject<{\n requested: z$1.ZodString;\n resolved: z$1.ZodString;\n integrity: z$1.ZodOptional;\n registry: z$1.ZodOptional;\n engines: z$1.ZodObject<{\n bb: z$1.ZodOptional;\n bbPluginSdk: z$1.ZodOptional;\n }, z$1.core.$strip>;\n installedAt: z$1.ZodOptional;\n history: z$1.ZodArray>;\n}, z$1.core.$strip>;\ntype PluginSourceDetail = z$1.infer;\ndeclare const installedPluginSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n source: z$1.ZodString;\n rootDir: z$1.ZodString;\n version: z$1.ZodString;\n provenance: z$1.ZodEnum<{\n builtin: \"builtin\";\n direct: \"direct\";\n catalog: \"catalog\";\n }>;\n isOrphanedBuiltin: z$1.ZodBoolean;\n catalogEntryId: z$1.ZodOptional;\n sourceDisplay: z$1.ZodString;\n updateState: z$1.ZodObject<{\n outcome: z$1.ZodOptional>;\n availableVersion: z$1.ZodOptional;\n blockedVersion: z$1.ZodOptional;\n blockedReasons: z$1.ZodOptional>;\n lastCheckAt: z$1.ZodOptional;\n lastFailure: z$1.ZodOptional>;\n }, z$1.core.$strip>;\n enabled: z$1.ZodBoolean;\n description: z$1.ZodNullable;\n name: z$1.ZodNullable;\n icon: z$1.ZodNullable;\n experimental_iconUrl: z$1.ZodDefault>;\n status: z$1.ZodEnum<{\n error: \"error\";\n running: \"running\";\n missing: \"missing\";\n incompatible: \"incompatible\";\n disabled: \"disabled\";\n degraded: \"degraded\";\n \"needs-configuration\": \"needs-configuration\";\n }>;\n statusDetail: z$1.ZodNullable;\n handlerStats: z$1.ZodObject<{\n count: z$1.ZodNumber;\n totalMs: z$1.ZodNumber;\n maxMs: z$1.ZodNumber;\n errorCount: z$1.ZodNumber;\n }, z$1.core.$strip>;\n services: z$1.ZodArray;\n }, z$1.core.$strip>>;\n schedules: z$1.ZodArray;\n lastStatus: z$1.ZodNullable>;\n lastError: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n cliCommand: z$1.ZodNullable>;\n hasSettings: z$1.ZodBoolean;\n app: z$1.ZodObject<{\n hasApp: z$1.ZodBoolean;\n bundle: z$1.ZodNullable;\n hash: z$1.ZodString;\n sdkMajor: z$1.ZodNumber;\n sdkVersion: z$1.ZodString;\n compatible: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>;\n logoUrl: z$1.ZodNullable;\n logoDarkUrl: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype InstalledPlugin = z$1.infer;\ndeclare const pluginListResponseSchema: z$1.ZodObject<{\n enabled: z$1.ZodBoolean;\n plugins: z$1.ZodArray;\n isOrphanedBuiltin: z$1.ZodBoolean;\n catalogEntryId: z$1.ZodOptional;\n sourceDisplay: z$1.ZodString;\n updateState: z$1.ZodObject<{\n outcome: z$1.ZodOptional>;\n availableVersion: z$1.ZodOptional;\n blockedVersion: z$1.ZodOptional;\n blockedReasons: z$1.ZodOptional>;\n lastCheckAt: z$1.ZodOptional;\n lastFailure: z$1.ZodOptional>;\n }, z$1.core.$strip>;\n enabled: z$1.ZodBoolean;\n description: z$1.ZodNullable;\n name: z$1.ZodNullable;\n icon: z$1.ZodNullable;\n experimental_iconUrl: z$1.ZodDefault>;\n status: z$1.ZodEnum<{\n error: \"error\";\n running: \"running\";\n missing: \"missing\";\n incompatible: \"incompatible\";\n disabled: \"disabled\";\n degraded: \"degraded\";\n \"needs-configuration\": \"needs-configuration\";\n }>;\n statusDetail: z$1.ZodNullable;\n handlerStats: z$1.ZodObject<{\n count: z$1.ZodNumber;\n totalMs: z$1.ZodNumber;\n maxMs: z$1.ZodNumber;\n errorCount: z$1.ZodNumber;\n }, z$1.core.$strip>;\n services: z$1.ZodArray;\n }, z$1.core.$strip>>;\n schedules: z$1.ZodArray;\n lastStatus: z$1.ZodNullable>;\n lastError: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n cliCommand: z$1.ZodNullable>;\n hasSettings: z$1.ZodBoolean;\n app: z$1.ZodObject<{\n hasApp: z$1.ZodBoolean;\n bundle: z$1.ZodNullable;\n hash: z$1.ZodString;\n sdkMajor: z$1.ZodNumber;\n sdkVersion: z$1.ZodString;\n compatible: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>;\n logoUrl: z$1.ZodNullable;\n logoDarkUrl: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype PluginListResponse = z$1.infer;\ndeclare const pluginReloadResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n plugins: z$1.ZodArray;\n isOrphanedBuiltin: z$1.ZodBoolean;\n catalogEntryId: z$1.ZodOptional;\n sourceDisplay: z$1.ZodString;\n updateState: z$1.ZodObject<{\n outcome: z$1.ZodOptional>;\n availableVersion: z$1.ZodOptional;\n blockedVersion: z$1.ZodOptional;\n blockedReasons: z$1.ZodOptional>;\n lastCheckAt: z$1.ZodOptional;\n lastFailure: z$1.ZodOptional>;\n }, z$1.core.$strip>;\n enabled: z$1.ZodBoolean;\n description: z$1.ZodNullable;\n name: z$1.ZodNullable;\n icon: z$1.ZodNullable;\n experimental_iconUrl: z$1.ZodDefault>;\n status: z$1.ZodEnum<{\n error: \"error\";\n running: \"running\";\n missing: \"missing\";\n incompatible: \"incompatible\";\n disabled: \"disabled\";\n degraded: \"degraded\";\n \"needs-configuration\": \"needs-configuration\";\n }>;\n statusDetail: z$1.ZodNullable;\n handlerStats: z$1.ZodObject<{\n count: z$1.ZodNumber;\n totalMs: z$1.ZodNumber;\n maxMs: z$1.ZodNumber;\n errorCount: z$1.ZodNumber;\n }, z$1.core.$strip>;\n services: z$1.ZodArray;\n }, z$1.core.$strip>>;\n schedules: z$1.ZodArray;\n lastStatus: z$1.ZodNullable>;\n lastError: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n cliCommand: z$1.ZodNullable>;\n hasSettings: z$1.ZodBoolean;\n app: z$1.ZodObject<{\n hasApp: z$1.ZodBoolean;\n bundle: z$1.ZodNullable;\n hash: z$1.ZodString;\n sdkMajor: z$1.ZodNumber;\n sdkVersion: z$1.ZodString;\n compatible: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>;\n logoUrl: z$1.ZodNullable;\n logoDarkUrl: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype PluginReloadResponse = z$1.infer;\ndeclare const pluginRemoveResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n}, z$1.core.$strip>;\ntype PluginRemoveResponse = z$1.infer;\ndeclare const pluginSettingsResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n schema: z$1.ZodRecord;\n secret: z$1.ZodOptional>;\n default: z$1.ZodOptional;\n label: z$1.ZodString;\n description: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"boolean\">;\n default: z$1.ZodOptional;\n label: z$1.ZodString;\n description: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"select\">;\n options: z$1.ZodArray;\n default: z$1.ZodOptional;\n label: z$1.ZodString;\n description: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"project\">;\n default: z$1.ZodOptional;\n label: z$1.ZodString;\n description: z$1.ZodOptional;\n }, z$1.core.$strict>], \"type\">>;\n values: z$1.ZodRecord>>;\n}, z$1.core.$strip>;\ntype PluginSettingsResponse = z$1.infer;\ndeclare const pluginTokenResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n token: z$1.ZodString;\n}, z$1.core.$strip>;\ntype PluginTokenResponse = z$1.infer;\ndeclare const pluginCatalogStatusSchema: z$1.ZodObject<{\n pluginCount: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype PluginCatalogStatus = z$1.infer;\ndeclare const pluginCatalogSearchResultSchema: z$1.ZodObject<{\n entryId: z$1.ZodString;\n pluginId: z$1.ZodString;\n displayName: z$1.ZodString;\n description: z$1.ZodString;\n icon: z$1.ZodNullable;\n category: z$1.ZodString;\n source: z$1.ZodString;\n installed: z$1.ZodBoolean;\n compatible: z$1.ZodBoolean;\n incompatibleReason: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype PluginCatalogSearchResult$1 = z$1.infer;\n\ndeclare const systemExecutionOptionsResponseSchema: z$1.ZodObject<{\n providers: z$1.ZodArray;\n capabilities: z$1.ZodObject<{\n supportsArchive: z$1.ZodBoolean;\n supportsRename: z$1.ZodBoolean;\n supportsServiceTier: z$1.ZodBoolean;\n supportsUserQuestion: z$1.ZodBoolean;\n supportsFork: z$1.ZodBoolean;\n supportedPermissionModes: z$1.ZodArray>;\n }, z$1.core.$strip>;\n composerActions: z$1.ZodArray;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plan\">;\n command: z$1.ZodObject<{\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n trailingText: z$1.ZodString;\n }, z$1.core.$strip>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"goal\">;\n command: z$1.ZodObject<{\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n trailingText: z$1.ZodString;\n }, z$1.core.$strip>;\n }, z$1.core.$strip>], \"kind\">>;\n available: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n models: z$1.ZodArray;\n description: z$1.ZodString;\n }, z$1.core.$strip>>;\n defaultReasoningEffort: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n isDefault: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n selectedOnlyModels: z$1.ZodArray;\n description: z$1.ZodString;\n }, z$1.core.$strip>>;\n defaultReasoningEffort: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n isDefault: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n modelLoadError: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype SystemExecutionOptionsResponse = z$1.infer;\ndeclare const systemExecutionOptionsQuerySchema: z$1.ZodObject<{\n providerId: z$1.ZodOptional;\n hostId: z$1.ZodOptional;\n environmentId: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype SystemExecutionOptionsQuery = z$1.infer;\n/** Omission preserves the existing behavior of reading the primary machine. */\ndeclare const systemUsageLimitsQuerySchema: z$1.ZodObject<{\n hostId: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype SystemUsageLimitsQuery = z$1.infer;\ndeclare const systemVoiceTranscriptionResponseSchema: z$1.ZodObject<{\n text: z$1.ZodString;\n}, z$1.core.$strip>;\ntype SystemVoiceTranscriptionResponse = z$1.infer;\ndeclare const systemConfigResponseSchema: z$1.ZodObject<{\n generalSettings: z$1.ZodObject<{\n caffeinate: z$1.ZodBoolean;\n showKeyboardHints: z$1.ZodBoolean;\n showUnhandledProviderEvents: z$1.ZodBoolean;\n codexMemoryEnabled: z$1.ZodBoolean;\n claudeCodeMemoryEnabled: z$1.ZodBoolean;\n codexSubagentsDisabled: z$1.ZodBoolean;\n claudeCodeSubagentsDisabled: z$1.ZodBoolean;\n claudeCodeWorkflowsDisabled: z$1.ZodBoolean;\n }, z$1.core.$strict>;\n keybindings: z$1.ZodArray;\n desktopOnly: z$1.ZodBoolean;\n shortcut: z$1.ZodObject<{\n key: z$1.ZodString;\n mod: z$1.ZodBoolean;\n meta: z$1.ZodBoolean;\n control: z$1.ZodBoolean;\n alt: z$1.ZodBoolean;\n shift: z$1.ZodBoolean;\n }, z$1.core.$strict>;\n when: z$1.ZodObject<{\n all: z$1.ZodArray>;\n none: z$1.ZodArray>;\n }, z$1.core.$strict>;\n }, z$1.core.$strict>>;\n defaultKeybindings: z$1.ZodArray;\n desktopOnly: z$1.ZodBoolean;\n shortcut: z$1.ZodObject<{\n key: z$1.ZodString;\n mod: z$1.ZodBoolean;\n meta: z$1.ZodBoolean;\n control: z$1.ZodBoolean;\n alt: z$1.ZodBoolean;\n shift: z$1.ZodBoolean;\n }, z$1.core.$strict>;\n when: z$1.ZodObject<{\n all: z$1.ZodArray>;\n none: z$1.ZodArray>;\n }, z$1.core.$strict>;\n }, z$1.core.$strict>>;\n keybindingOverrides: z$1.ZodArray;\n shortcut: z$1.ZodNullable>;\n }, z$1.core.$strict>>;\n experiments: z$1.ZodObject<{\n claudeCodeMockCliTraffic: z$1.ZodBoolean;\n plugins: z$1.ZodBoolean;\n toolsHub: z$1.ZodBoolean;\n sideChatPlugin: z$1.ZodBoolean;\n }, z$1.core.$strip>;\n appearance: z$1.ZodObject<{\n themeId: z$1.ZodString;\n customCss: z$1.ZodNullable;\n faviconColor: z$1.ZodEnum<{\n default: \"default\";\n red: \"red\";\n orange: \"orange\";\n yellow: \"yellow\";\n green: \"green\";\n teal: \"teal\";\n blue: \"blue\";\n purple: \"purple\";\n pink: \"pink\";\n }>;\n }, z$1.core.$strip>;\n customThemes: z$1.ZodArray;\n pluginThemes: z$1.ZodArray;\n }, z$1.core.$strip>>;\n featureFlags: z$1.ZodObject<{\n placeholder: z$1.ZodBoolean;\n }, z$1.core.$strip>;\n hostDaemonPort: z$1.ZodNullable;\n primaryHostId: z$1.ZodNullable;\n primaryHostPlatform: z$1.ZodNullable>;\n voiceTranscriptionEnabled: z$1.ZodBoolean;\n dataDir: z$1.ZodString;\n}, z$1.core.$strip>;\ntype SystemConfigResponse = z$1.infer;\ndeclare const systemAttentionResponseSchema: z$1.ZodObject<{\n hasAttention: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype SystemAttentionResponse = z$1.infer;\n/**\n * Theme catalog: the on-disk custom-theme directory plus the discovered custom\n * themes and the active palette. Drives `bb theme list` / `bb theme dir`.\n */\ndeclare const themeCatalogResponseSchema: z$1.ZodObject<{\n dir: z$1.ZodString;\n custom: z$1.ZodArray;\n plugins: z$1.ZodArray;\n }, z$1.core.$strip>>;\n active: z$1.ZodObject<{\n themeId: z$1.ZodString;\n customCss: z$1.ZodNullable;\n faviconColor: z$1.ZodEnum<{\n default: \"default\";\n red: \"red\";\n orange: \"orange\";\n yellow: \"yellow\";\n green: \"green\";\n teal: \"teal\";\n blue: \"blue\";\n purple: \"purple\";\n pink: \"pink\";\n }>;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>;\ntype ThemeCatalogResponse = z$1.infer;\ndeclare const systemVersionResponseSchema: z$1.ZodObject<{\n currentVersion: z$1.ZodString;\n latestVersion: z$1.ZodNullable;\n source: z$1.ZodLiteral<\"npm\">;\n updateAvailable: z$1.ZodBoolean;\n isDevelopment: z$1.ZodBoolean;\n upgradeCommand: z$1.ZodString;\n}, z$1.core.$strip>;\ntype SystemVersionResponse = z$1.infer;\ndeclare const systemConfigReloadResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n}, z$1.core.$strip>;\ntype SystemConfigReloadResponse = z$1.infer;\n\ndeclare const terminalSessionSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodNullable;\n environmentId: z$1.ZodNullable;\n hostId: z$1.ZodString;\n title: z$1.ZodString;\n initialCwd: z$1.ZodString;\n cols: z$1.ZodNumber;\n rows: z$1.ZodNumber;\n status: z$1.ZodEnum<{\n running: \"running\";\n starting: \"starting\";\n disconnected: \"disconnected\";\n exited: \"exited\";\n }>;\n exitCode: z$1.ZodNullable;\n closeReason: z$1.ZodNullable>;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n lastUserInputAt: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype TerminalSession = z$1.infer;\ndeclare const terminalListResponseSchema: z$1.ZodObject<{\n sessions: z$1.ZodArray;\n environmentId: z$1.ZodNullable;\n hostId: z$1.ZodString;\n title: z$1.ZodString;\n initialCwd: z$1.ZodString;\n cols: z$1.ZodNumber;\n rows: z$1.ZodNumber;\n status: z$1.ZodEnum<{\n running: \"running\";\n starting: \"starting\";\n disconnected: \"disconnected\";\n exited: \"exited\";\n }>;\n exitCode: z$1.ZodNullable;\n closeReason: z$1.ZodNullable>;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n lastUserInputAt: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype TerminalListResponse = z$1.infer;\ndeclare const createTerminalRequestSchema: z$1.ZodObject<{\n cols: z$1.ZodNumber;\n rows: z$1.ZodNumber;\n start: z$1.ZodOptional;\n }, z$1.core.$strict>, z$1.ZodObject<{\n mode: z$1.ZodLiteral<\"command\">;\n command: z$1.ZodString;\n }, z$1.core.$strict>], \"mode\">>;\n target: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"environment\">;\n environmentId: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"host_path\">;\n hostId: z$1.ZodString;\n cwd: z$1.ZodNullable;\n }, z$1.core.$strict>], \"kind\">;\n title: z$1.ZodOptional;\n}, z$1.core.$strict>;\ntype CreateTerminalRequest = z$1.infer;\ndeclare const updateTerminalRequestSchema: z$1.ZodObject<{\n title: z$1.ZodString;\n}, z$1.core.$strict>;\ntype UpdateTerminalRequest = z$1.infer;\ndeclare const terminalInputRequestSchema: z$1.ZodObject<{\n dataBase64: z$1.ZodString;\n}, z$1.core.$strict>;\ntype TerminalInputRequest = z$1.infer;\ndeclare const terminalResizeRequestSchema: z$1.ZodObject<{\n cols: z$1.ZodNumber;\n rows: z$1.ZodNumber;\n}, z$1.core.$strict>;\ntype TerminalResizeRequest = z$1.infer;\ndeclare const terminalOutputQuerySchema: z$1.ZodObject<{\n sinceSeq: z$1.ZodOptional>;\n tailBytes: z$1.ZodOptional>;\n limitChunks: z$1.ZodOptional>;\n}, z$1.core.$strict>;\ntype TerminalOutputQuery = z$1.infer;\ndeclare const terminalOutputResponseSchema: z$1.ZodObject<{\n chunks: z$1.ZodArray>;\n nextSeq: z$1.ZodNumber;\n truncated: z$1.ZodBoolean;\n}, z$1.core.$strict>;\ntype TerminalOutputResponse = z$1.infer;\n\ndeclare const timelineRowStatusSchema: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n}>;\ntype TimelineRowStatus = z$1.infer;\ndeclare const timelineRowBaseSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype TimelineRowBase = z$1.infer;\ndeclare const timelineConversationRowSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"conversation\">;\n text: z$1.ZodString;\n attachments: z$1.ZodNullable;\n localImagePaths: z$1.ZodArray;\n localFilePaths: z$1.ZodArray;\n }, z$1.core.$strip>>;\n role: z$1.ZodLiteral<\"user\">;\n initiator: z$1.ZodEnum<{\n user: \"user\";\n agent: \"agent\";\n system: \"system\";\n }>;\n senderThreadId: z$1.ZodNullable;\n systemMessageKind: z$1.ZodEnum<{\n \"ownership-assigned\": \"ownership-assigned\";\n \"ownership-removed\": \"ownership-removed\";\n \"child-needs-attention\": \"child-needs-attention\";\n \"child-completed\": \"child-completed\";\n \"child-failed\": \"child-failed\";\n \"child-interrupted\": \"child-interrupted\";\n \"child-outcome-batch\": \"child-outcome-batch\";\n unlabeled: \"unlabeled\";\n }>;\n systemMessageSubject: z$1.ZodNullable;\n threadId: z$1.ZodString;\n threadName: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread-batch\">;\n count: z$1.ZodNumber;\n }, z$1.core.$strip>], \"kind\">>;\n turnRequest: z$1.ZodObject<{\n kind: z$1.ZodEnum<{\n message: \"message\";\n steer: \"steer\";\n }>;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n accepted: \"accepted\";\n }>;\n }, z$1.core.$strip>;\n mentions: z$1.ZodArray, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"conversation\">;\n text: z$1.ZodString;\n attachments: z$1.ZodNullable;\n localImagePaths: z$1.ZodArray;\n localFilePaths: z$1.ZodArray;\n }, z$1.core.$strip>>;\n role: z$1.ZodLiteral<\"assistant\">;\n turnRequest: z$1.ZodNull;\n}, z$1.core.$strip>], \"role\">;\ntype TimelineConversationRow = z$1.infer;\ndeclare const timelineSystemRowSchema: z$1.ZodUnion;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"system\">;\n title: z$1.ZodString;\n detail: z$1.ZodNullable;\n status: z$1.ZodNullable>;\n systemKind: z$1.ZodEnum<{\n error: \"error\";\n debug: \"debug\";\n reconnect: \"reconnect\";\n }>;\n}, z$1.core.$strip>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"system\">;\n title: z$1.ZodString;\n detail: z$1.ZodNullable;\n status: z$1.ZodNullable>;\n systemKind: z$1.ZodLiteral<\"operation\">;\n operationKind: z$1.ZodEnum<{\n generic: \"generic\";\n compaction: \"compaction\";\n \"thread-provisioning\": \"thread-provisioning\";\n \"thread-interrupted\": \"thread-interrupted\";\n \"provider-unhandled\": \"provider-unhandled\";\n warning: \"warning\";\n deprecation: \"deprecation\";\n }>;\n completedAt: z$1.ZodNullable;\n}, z$1.core.$strip>, z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"system\">;\n title: z$1.ZodString;\n detail: z$1.ZodNullable;\n systemKind: z$1.ZodLiteral<\"operation\">;\n operationKind: z$1.ZodLiteral<\"parent-change\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n parentChange: z$1.ZodObject<{\n action: z$1.ZodEnum<{\n assign: \"assign\";\n release: \"release\";\n transfer: \"transfer\";\n }>;\n previousParentThreadId: z$1.ZodNullable;\n previousParentThreadTitle: z$1.ZodNullable;\n nextParentThreadId: z$1.ZodNullable;\n nextParentThreadTitle: z$1.ZodNullable;\n }, z$1.core.$strip>;\n completedAt: z$1.ZodNullable;\n}, z$1.core.$strip>], \"operationKind\">]>;\ntype TimelineSystemRow = z$1.infer;\ninterface TimelineWorkRowBase extends TimelineRowBase {\n kind: \"work\";\n status: TimelineRowStatus;\n}\ndeclare const timelineCommandWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"command\">;\n callId: z$1.ZodString;\n command: z$1.ZodString;\n cwd: z$1.ZodNullable;\n source: z$1.ZodNullable;\n output: z$1.ZodString;\n exitCode: z$1.ZodNullable;\n completedAt: z$1.ZodNullable;\n approvalStatus: z$1.ZodNullable>;\n activityIntents: z$1.ZodArray;\n command: z$1.ZodString;\n name: z$1.ZodString;\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"list_files\">;\n command: z$1.ZodString;\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"search\">;\n command: z$1.ZodString;\n query: z$1.ZodNullable;\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"unknown\">;\n command: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">>;\n}, z$1.core.$strip>;\ntype TimelineCommandWorkRow = z$1.infer;\ndeclare const timelineToolWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"tool\">;\n callId: z$1.ZodString;\n toolName: z$1.ZodString;\n toolArgs: z$1.ZodNullable>>>;\n output: z$1.ZodString;\n completedAt: z$1.ZodNullable;\n approvalStatus: z$1.ZodNullable>;\n activityIntents: z$1.ZodArray;\n command: z$1.ZodString;\n name: z$1.ZodString;\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"list_files\">;\n command: z$1.ZodString;\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"search\">;\n command: z$1.ZodString;\n query: z$1.ZodNullable;\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"unknown\">;\n command: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">>;\n}, z$1.core.$strip>;\ntype TimelineToolWorkRow = z$1.infer;\ndeclare const timelineFileChangeWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"file-change\">;\n callId: z$1.ZodString;\n change: z$1.ZodObject<{\n path: z$1.ZodString;\n kind: z$1.ZodNullable;\n movePath: z$1.ZodNullable;\n diff: z$1.ZodNullable;\n diffStats: z$1.ZodObject<{\n added: z$1.ZodNumber;\n removed: z$1.ZodNumber;\n }, z$1.core.$strip>;\n }, z$1.core.$strip>;\n stdout: z$1.ZodNullable;\n stderr: z$1.ZodNullable;\n approvalStatus: z$1.ZodNullable>;\n}, z$1.core.$strip>;\ntype TimelineFileChangeWorkRow = z$1.infer;\ndeclare const timelineWebSearchWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"web-search\">;\n callId: z$1.ZodString;\n queries: z$1.ZodArray;\n completedAt: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype TimelineWebSearchWorkRow = z$1.infer;\ndeclare const timelineWebFetchWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"web-fetch\">;\n callId: z$1.ZodString;\n url: z$1.ZodString;\n prompt: z$1.ZodNullable;\n pattern: z$1.ZodNullable;\n completedAt: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype TimelineWebFetchWorkRow = z$1.infer;\ndeclare const timelineImageViewWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"image-view\">;\n callId: z$1.ZodString;\n path: z$1.ZodString;\n completedAt: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype TimelineImageViewWorkRow = z$1.infer;\ndeclare const timelineApprovalWorkRowSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"approval\">;\n interactionId: z$1.ZodString;\n target: z$1.ZodObject<{\n itemId: z$1.ZodString;\n toolName: z$1.ZodNullable;\n }, z$1.core.$strip>;\n approvalKind: z$1.ZodLiteral<\"file-edit\">;\n lifecycle: z$1.ZodEnum<{\n denied: \"denied\";\n waiting: \"waiting\";\n }>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"approval\">;\n interactionId: z$1.ZodString;\n target: z$1.ZodObject<{\n itemId: z$1.ZodString;\n toolName: z$1.ZodNullable;\n }, z$1.core.$strip>;\n approvalKind: z$1.ZodLiteral<\"permission-grant\">;\n lifecycle: z$1.ZodEnum<{\n pending: \"pending\";\n interrupted: \"interrupted\";\n denied: \"denied\";\n resolving: \"resolving\";\n granted: \"granted\";\n }>;\n grantScope: z$1.ZodNullable>;\n statusReason: z$1.ZodNullable;\n}, z$1.core.$strip>], \"approvalKind\">;\ntype TimelineApprovalWorkRow = z$1.infer;\ndeclare const timelineQuestionWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"question\">;\n interactionId: z$1.ZodString;\n lifecycle: z$1.ZodEnum<{\n pending: \"pending\";\n interrupted: \"interrupted\";\n resolving: \"resolving\";\n answered: \"answered\";\n }>;\n questions: z$1.ZodArray;\n multiSelect: z$1.ZodBoolean;\n options: z$1.ZodOptional;\n }, z$1.core.$strip>>>;\n allowFreeText: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n answers: z$1.ZodNullable;\n freeText: z$1.ZodOptional;\n }, z$1.core.$strip>>>;\n statusReason: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype TimelineQuestionWorkRow = z$1.infer;\ninterface TimelineDelegationWorkRow extends TimelineWorkRowBase {\n workKind: \"delegation\";\n callId: string;\n toolName: string;\n subagentType: string | null;\n description: string | null;\n output: string;\n completedAt: number | null;\n childRows: TimelineRow[];\n}\n/**\n * A provider background task โ€” a dynamic workflow (Claude Code Workflow tool)\n * or a backgrounded shell command (Bash run_in_background), discriminated by\n * `taskType`. The row outlives its spawning turn: progress and terminal state\n * arrive via thread-scoped events folded into this single row. `workflow` is\n * the merged phase/agent tree, present only for workflows; null for shell\n * commands and for workflows the provider reported no progress records for\n * (degraded rendering falls back to description + summary).\n */\ndeclare const timelineWorkflowWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"workflow\">;\n itemId: z$1.ZodString;\n taskType: z$1.ZodString;\n workflowName: z$1.ZodNullable;\n description: z$1.ZodString;\n taskStatus: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n running: \"running\";\n paused: \"paused\";\n failed: \"failed\";\n killed: \"killed\";\n stopped: \"stopped\";\n }>;\n workflow: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n agents: z$1.ZodArray;\n model: z$1.ZodString;\n attempt: z$1.ZodNumber;\n cached: z$1.ZodBoolean;\n lastProgressAt: z$1.ZodNumber;\n phaseIndex: z$1.ZodOptional;\n phaseTitle: z$1.ZodOptional;\n agentType: z$1.ZodOptional;\n isolation: z$1.ZodOptional;\n queuedAt: z$1.ZodOptional;\n startedAt: z$1.ZodOptional;\n lastToolName: z$1.ZodOptional;\n lastToolSummary: z$1.ZodOptional;\n promptPreview: z$1.ZodOptional;\n resultPreview: z$1.ZodOptional;\n error: z$1.ZodOptional;\n tokens: z$1.ZodOptional;\n toolCalls: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n usage: z$1.ZodNullable>;\n summary: z$1.ZodNullable;\n error: z$1.ZodNullable;\n completedAt: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype TimelineWorkflowWorkRow = z$1.infer;\ntype TimelineWorkRow = TimelineCommandWorkRow | TimelineToolWorkRow | TimelineFileChangeWorkRow | TimelineWebSearchWorkRow | TimelineWebFetchWorkRow | TimelineImageViewWorkRow | TimelineApprovalWorkRow | TimelineQuestionWorkRow | TimelineDelegationWorkRow | TimelineWorkflowWorkRow;\ninterface TimelineTurnRow extends TimelineRowBase {\n kind: \"turn\";\n turnId: string;\n status: TimelineRowStatus;\n summaryCount: number;\n completedAt: number | null;\n children: TimelineRow[] | null;\n}\ntype TimelineSourceRow = TimelineConversationRow | TimelineWorkRow | TimelineSystemRow;\ntype TimelineRow = TimelineSourceRow | TimelineTurnRow;\n\ndeclare const createThreadRequestSchema: z$1.ZodObject<{\n projectId: z$1.ZodString;\n providerId: z$1.ZodOptional;\n origin: z$1.ZodEnum<{\n plugin: \"plugin\";\n app: \"app\";\n cli: \"cli\";\n sdk: \"sdk\";\n }>;\n originPluginId: z$1.ZodOptional;\n visibility: z$1.ZodOptional>;\n title: z$1.ZodOptional;\n input: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n model: z$1.ZodOptional;\n serviceTier: z$1.ZodOptional>;\n reasoningLevel: z$1.ZodOptional>;\n permissionMode: z$1.ZodOptional, z$1.ZodLiteral<\"workspace-write\">]>, z$1.ZodTransform<\"auto\" | \"accept-edits\" | \"full\", \"auto\" | \"accept-edits\" | \"full\" | \"workspace-write\">>>;\n executionInputSources: z$1.ZodOptional>;\n model: z$1.ZodOptional>;\n serviceTier: z$1.ZodOptional>;\n reasoningLevel: z$1.ZodOptional>;\n permissionMode: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n environment: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"reuse\">;\n environmentId: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host\">;\n hostId: z$1.ZodOptional;\n workspace: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"unmanaged\">;\n path: z$1.ZodNullable;\n branch: z$1.ZodOptional;\n name: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"new\">;\n baseBranch: z$1.ZodString;\n }, z$1.core.$strict>], \"kind\">>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"managed-worktree\">;\n baseBranch: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"named\">;\n name: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"default\">;\n }, z$1.core.$strip>], \"kind\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"personal\">;\n }, z$1.core.$strip>], \"type\">;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"project-default\">;\n }, z$1.core.$strip>], \"type\">;\n parentThreadId: z$1.ZodOptional;\n sectionId: z$1.ZodOptional>;\n sourceThreadId: z$1.ZodOptional;\n sourceSeqEnd: z$1.ZodOptional;\n startedOnBehalfOf: z$1.ZodDefault;\n senderThreadId: z$1.ZodString;\n }, z$1.core.$strip>>>;\n originKind: z$1.ZodDefault>>;\n childOrigin: z$1.ZodDefault>>;\n}, z$1.core.$strip>;\ntype CreateThreadRequest = z$1.infer;\ndeclare const forkThreadRequestSchema: z$1.ZodObject<{\n sourceThreadId: z$1.ZodString;\n sourceSeqEnd: z$1.ZodOptional;\n input: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>>;\n agentContextSeed: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">, z$1.ZodObject<{\n visibility: z$1.ZodLiteral<\"agent-only\">;\n }, z$1.core.$strip>>>>;\n title: z$1.ZodOptional;\n permissionMode: z$1.ZodOptional, z$1.ZodLiteral<\"workspace-write\">]>, z$1.ZodTransform<\"auto\" | \"accept-edits\" | \"full\", \"auto\" | \"accept-edits\" | \"full\" | \"workspace-write\">>>;\n visibility: z$1.ZodDefault>;\n workspace: z$1.ZodDefault>;\n origin: z$1.ZodDefault>;\n originPluginId: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype ForkThreadRequest = z$1.infer;\ndeclare const sendMessageRequestSchema: z$1.ZodObject<{\n input: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n model: z$1.ZodOptional;\n serviceTier: z$1.ZodOptional>;\n reasoningLevel: z$1.ZodOptional>;\n permissionMode: z$1.ZodOptional, z$1.ZodLiteral<\"workspace-write\">]>, z$1.ZodTransform<\"auto\" | \"accept-edits\" | \"full\", \"auto\" | \"accept-edits\" | \"full\" | \"workspace-write\">>>;\n executionInputSources: z$1.ZodOptional>;\n serviceTier: z$1.ZodOptional>;\n reasoningLevel: z$1.ZodOptional>;\n permissionMode: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n mode: z$1.ZodEnum<{\n steer: \"steer\";\n start: \"start\";\n auto: \"auto\";\n \"queue-if-active\": \"queue-if-active\";\n \"steer-if-active\": \"steer-if-active\";\n }>;\n senderThreadId: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype SendMessageRequest = z$1.infer;\ndeclare const createQueuedMessageRequestSchema: z$1.ZodObject<{\n input: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n model: z$1.ZodOptional;\n serviceTier: z$1.ZodOptional>;\n reasoningLevel: z$1.ZodOptional>;\n permissionMode: z$1.ZodOptional, z$1.ZodLiteral<\"workspace-write\">]>, z$1.ZodTransform<\"auto\" | \"accept-edits\" | \"full\", \"auto\" | \"accept-edits\" | \"full\" | \"workspace-write\">>>;\n executionInputSources: z$1.ZodOptional>;\n serviceTier: z$1.ZodOptional>;\n reasoningLevel: z$1.ZodOptional>;\n permissionMode: z$1.ZodOptional>;\n }, z$1.core.$strict>>;\n senderThreadId: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype CreateQueuedMessageRequest = z$1.infer;\ndeclare const updateQueuedMessageRequestSchema: z$1.ZodObject<{\n expectedUpdatedAt: z$1.ZodNumber;\n input: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n}, z$1.core.$strip>;\ntype UpdateQueuedMessageRequest = z$1.infer;\ndeclare const sendQueuedMessageRequestSchema: z$1.ZodObject<{\n mode: z$1.ZodEnum<{\n steer: \"steer\";\n auto: \"auto\";\n }>;\n}, z$1.core.$strip>;\ntype SendQueuedMessageRequest = z$1.infer;\ndeclare const reorderQueuedMessageRequestSchema: z$1.ZodObject<{\n previousQueuedMessageId: z$1.ZodNullable;\n nextQueuedMessageId: z$1.ZodNullable;\n groupBoundaryQueuedMessageId: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype ReorderQueuedMessageRequest = z$1.infer;\ndeclare const setQueuedMessageGroupBoundaryRequestSchema: z$1.ZodObject<{\n expectedGroupedPrefixQueuedMessageIds: z$1.ZodArray;\n groupBoundaryQueuedMessageId: z$1.ZodString;\n}, z$1.core.$strip>;\ntype SetQueuedMessageGroupBoundaryRequest = z$1.infer;\ndeclare const sendQueuedMessageResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n queuedMessage: z$1.ZodObject<{\n id: z$1.ZodString;\n content: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n model: z$1.ZodString;\n reasoningLevel: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n permissionMode: z$1.ZodEnum<{\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n full: \"full\";\n }>;\n serviceTier: z$1.ZodEnum<{\n default: \"default\";\n fast: \"fast\";\n }>;\n groupWithNext: z$1.ZodBoolean;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n }, z$1.core.$strip>;\n}, z$1.core.$strip>;\ntype SendQueuedMessageResponse = z$1.infer;\ndeclare const threadListResponseSchema: z$1.ZodArray;\n providerId: z$1.ZodString;\n title: z$1.ZodNullable;\n titleFallback: z$1.ZodNullable;\n sectionId: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n error: \"error\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n }>;\n parentThreadId: z$1.ZodNullable;\n sourceThreadId: z$1.ZodNullable;\n originKind: z$1.ZodNullable>;\n childOrigin: z$1.ZodNullable>;\n originPluginId: z$1.ZodNullable;\n visibility: z$1.ZodEnum<{\n visible: \"visible\";\n hidden: \"hidden\";\n }>;\n archivedAt: z$1.ZodNullable;\n pinnedAt: z$1.ZodNullable;\n deletedAt: z$1.ZodNullable;\n lastReadAt: z$1.ZodNullable;\n latestAttentionAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n runtime: z$1.ZodObject<{\n displayStatus: z$1.ZodEnum<{\n error: \"error\";\n provisioning: \"provisioning\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n \"host-reconnecting\": \"host-reconnecting\";\n \"waiting-for-host\": \"waiting-for-host\";\n }>;\n hostReconnectGraceExpiresAt: z$1.ZodNullable;\n }, z$1.core.$strip>;\n activity: z$1.ZodObject<{\n activeWorkflowCount: z$1.ZodNumber;\n activeBackgroundAgentCount: z$1.ZodNumber;\n activeBackgroundCommandCount: z$1.ZodNumber;\n activePlanModeCount: z$1.ZodNumber;\n activeGoalCount: z$1.ZodNumber;\n }, z$1.core.$strip>;\n pinSortKey: z$1.ZodNullable;\n hasPendingInteraction: z$1.ZodBoolean;\n environmentHostId: z$1.ZodNullable;\n environmentName: z$1.ZodNullable;\n environmentBranchName: z$1.ZodNullable;\n environmentWorkspaceDisplayKind: z$1.ZodEnum<{\n \"managed-worktree\": \"managed-worktree\";\n \"unmanaged-worktree\": \"unmanaged-worktree\";\n other: \"other\";\n }>;\n}, z$1.core.$strip>>;\ntype ThreadListResponse = z$1.infer;\ndeclare const threadSearchResponseSchema: z$1.ZodObject<{\n active: z$1.ZodObject<{\n total: z$1.ZodNumber;\n results: z$1.ZodArray;\n providerId: z$1.ZodString;\n title: z$1.ZodNullable;\n titleFallback: z$1.ZodNullable;\n sectionId: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n error: \"error\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n }>;\n parentThreadId: z$1.ZodNullable;\n sourceThreadId: z$1.ZodNullable;\n originKind: z$1.ZodNullable>;\n childOrigin: z$1.ZodNullable>;\n originPluginId: z$1.ZodNullable;\n visibility: z$1.ZodEnum<{\n visible: \"visible\";\n hidden: \"hidden\";\n }>;\n archivedAt: z$1.ZodNullable;\n pinnedAt: z$1.ZodNullable;\n deletedAt: z$1.ZodNullable;\n lastReadAt: z$1.ZodNullable;\n latestAttentionAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n runtime: z$1.ZodObject<{\n displayStatus: z$1.ZodEnum<{\n error: \"error\";\n provisioning: \"provisioning\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n \"host-reconnecting\": \"host-reconnecting\";\n \"waiting-for-host\": \"waiting-for-host\";\n }>;\n hostReconnectGraceExpiresAt: z$1.ZodNullable;\n }, z$1.core.$strip>;\n activity: z$1.ZodObject<{\n activeWorkflowCount: z$1.ZodNumber;\n activeBackgroundAgentCount: z$1.ZodNumber;\n activeBackgroundCommandCount: z$1.ZodNumber;\n activePlanModeCount: z$1.ZodNumber;\n activeGoalCount: z$1.ZodNumber;\n }, z$1.core.$strip>;\n pinSortKey: z$1.ZodNullable;\n hasPendingInteraction: z$1.ZodBoolean;\n environmentHostId: z$1.ZodNullable;\n environmentName: z$1.ZodNullable;\n environmentBranchName: z$1.ZodNullable;\n environmentWorkspaceDisplayKind: z$1.ZodEnum<{\n \"managed-worktree\": \"managed-worktree\";\n \"unmanaged-worktree\": \"unmanaged-worktree\";\n other: \"other\";\n }>;\n }, z$1.core.$strip>;\n matches: z$1.ZodArray;\n text: z$1.ZodString;\n highlightRanges: z$1.ZodArray>;\n sourceSeq: z$1.ZodNullable;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>;\n archived: z$1.ZodObject<{\n total: z$1.ZodNumber;\n results: z$1.ZodArray;\n providerId: z$1.ZodString;\n title: z$1.ZodNullable;\n titleFallback: z$1.ZodNullable;\n sectionId: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n error: \"error\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n }>;\n parentThreadId: z$1.ZodNullable;\n sourceThreadId: z$1.ZodNullable;\n originKind: z$1.ZodNullable>;\n childOrigin: z$1.ZodNullable>;\n originPluginId: z$1.ZodNullable;\n visibility: z$1.ZodEnum<{\n visible: \"visible\";\n hidden: \"hidden\";\n }>;\n archivedAt: z$1.ZodNullable;\n pinnedAt: z$1.ZodNullable;\n deletedAt: z$1.ZodNullable;\n lastReadAt: z$1.ZodNullable;\n latestAttentionAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n runtime: z$1.ZodObject<{\n displayStatus: z$1.ZodEnum<{\n error: \"error\";\n provisioning: \"provisioning\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n \"host-reconnecting\": \"host-reconnecting\";\n \"waiting-for-host\": \"waiting-for-host\";\n }>;\n hostReconnectGraceExpiresAt: z$1.ZodNullable;\n }, z$1.core.$strip>;\n activity: z$1.ZodObject<{\n activeWorkflowCount: z$1.ZodNumber;\n activeBackgroundAgentCount: z$1.ZodNumber;\n activeBackgroundCommandCount: z$1.ZodNumber;\n activePlanModeCount: z$1.ZodNumber;\n activeGoalCount: z$1.ZodNumber;\n }, z$1.core.$strip>;\n pinSortKey: z$1.ZodNullable;\n hasPendingInteraction: z$1.ZodBoolean;\n environmentHostId: z$1.ZodNullable;\n environmentName: z$1.ZodNullable;\n environmentBranchName: z$1.ZodNullable;\n environmentWorkspaceDisplayKind: z$1.ZodEnum<{\n \"managed-worktree\": \"managed-worktree\";\n \"unmanaged-worktree\": \"unmanaged-worktree\";\n other: \"other\";\n }>;\n }, z$1.core.$strip>;\n matches: z$1.ZodArray;\n text: z$1.ZodString;\n highlightRanges: z$1.ZodArray>;\n sourceSeq: z$1.ZodNullable;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>;\n}, z$1.core.$strict>;\ntype ThreadSearchResponse = z$1.infer;\ndeclare const threadResponseSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n projectId: z$1.ZodString;\n environmentId: z$1.ZodNullable;\n providerId: z$1.ZodString;\n title: z$1.ZodNullable;\n titleFallback: z$1.ZodNullable;\n sectionId: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n error: \"error\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n }>;\n parentThreadId: z$1.ZodNullable;\n sourceThreadId: z$1.ZodNullable;\n originKind: z$1.ZodNullable>;\n childOrigin: z$1.ZodNullable>;\n originPluginId: z$1.ZodNullable;\n visibility: z$1.ZodEnum<{\n visible: \"visible\";\n hidden: \"hidden\";\n }>;\n archivedAt: z$1.ZodNullable;\n pinnedAt: z$1.ZodNullable;\n deletedAt: z$1.ZodNullable;\n lastReadAt: z$1.ZodNullable;\n latestAttentionAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n runtime: z$1.ZodObject<{\n displayStatus: z$1.ZodEnum<{\n error: \"error\";\n provisioning: \"provisioning\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n \"host-reconnecting\": \"host-reconnecting\";\n \"waiting-for-host\": \"waiting-for-host\";\n }>;\n hostReconnectGraceExpiresAt: z$1.ZodNullable;\n }, z$1.core.$strip>;\n canSpawnChild: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype ThreadResponse = z$1.infer;\ndeclare const threadGetQuerySchema: z$1.ZodObject<{\n include: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype ThreadGetQuery = z$1.infer;\ndeclare const threadWithIncludesResponseSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n projectId: z$1.ZodString;\n environmentId: z$1.ZodNullable;\n providerId: z$1.ZodString;\n title: z$1.ZodNullable;\n titleFallback: z$1.ZodNullable;\n sectionId: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n error: \"error\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n }>;\n parentThreadId: z$1.ZodNullable;\n sourceThreadId: z$1.ZodNullable;\n originKind: z$1.ZodNullable>;\n childOrigin: z$1.ZodNullable>;\n originPluginId: z$1.ZodNullable;\n visibility: z$1.ZodEnum<{\n visible: \"visible\";\n hidden: \"hidden\";\n }>;\n archivedAt: z$1.ZodNullable;\n pinnedAt: z$1.ZodNullable;\n deletedAt: z$1.ZodNullable;\n lastReadAt: z$1.ZodNullable;\n latestAttentionAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n runtime: z$1.ZodObject<{\n displayStatus: z$1.ZodEnum<{\n error: \"error\";\n provisioning: \"provisioning\";\n stopping: \"stopping\";\n idle: \"idle\";\n starting: \"starting\";\n active: \"active\";\n \"host-reconnecting\": \"host-reconnecting\";\n \"waiting-for-host\": \"waiting-for-host\";\n }>;\n hostReconnectGraceExpiresAt: z$1.ZodNullable;\n }, z$1.core.$strip>;\n canSpawnChild: z$1.ZodBoolean;\n environment: z$1.ZodOptional;\n projectId: z$1.ZodString;\n hostId: z$1.ZodString;\n path: z$1.ZodNullable;\n managed: z$1.ZodBoolean;\n isGitRepo: z$1.ZodBoolean;\n isWorktree: z$1.ZodBoolean;\n workspaceProvisionType: z$1.ZodEnum<{\n unmanaged: \"unmanaged\";\n \"managed-worktree\": \"managed-worktree\";\n personal: \"personal\";\n }>;\n branchName: z$1.ZodNullable;\n baseBranch: z$1.ZodNullable;\n defaultBranch: z$1.ZodNullable;\n mergeBaseBranch: z$1.ZodNullable;\n status: z$1.ZodEnum<{\n error: \"error\";\n provisioning: \"provisioning\";\n ready: \"ready\";\n retiring: \"retiring\";\n destroying: \"destroying\";\n destroyed: \"destroyed\";\n }>;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n }, z$1.core.$strip>>>;\n host: z$1.ZodOptional;\n status: z$1.ZodEnum<{\n disconnected: \"disconnected\";\n connected: \"connected\";\n }>;\n lastSeenAt: z$1.ZodNullable;\n lastRejectedProtocolVersion: z$1.ZodNullable;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n }, z$1.core.$strip>>>;\n}, z$1.core.$strip>;\ntype ThreadWithIncludesResponse = z$1.infer;\ndeclare const threadPendingInteractionsResponseSchema: z$1.ZodArray;\n statusReason: z$1.ZodNullable;\n createdAt: z$1.ZodNumber;\n expiresAt: z$1.ZodOptional>;\n resolvedAt: z$1.ZodNullable;\n turnId: z$1.ZodString;\n providerId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n providerRequestId: z$1.ZodString;\n origin: z$1.ZodOptional;\n providerId: z$1.ZodString;\n providerThreadId: z$1.ZodString;\n providerRequestId: z$1.ZodString;\n }, z$1.core.$strip>>;\n payload: z$1.ZodUnion;\n subject: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n itemId: z$1.ZodString;\n command: z$1.ZodString;\n cwd: z$1.ZodNullable;\n actions: z$1.ZodArray;\n command: z$1.ZodString;\n name: z$1.ZodString;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"listFiles\">;\n command: z$1.ZodString;\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"search\">;\n command: z$1.ZodString;\n query: z$1.ZodNullable;\n path: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"unknown\">;\n command: z$1.ZodString;\n }, z$1.core.$strip>], \"type\">>;\n sessionGrant: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"file_change\">;\n itemId: z$1.ZodString;\n writeScope: z$1.ZodNullable;\n sessionGrant: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"permission_grant\">;\n itemId: z$1.ZodString;\n toolName: z$1.ZodNullable;\n permissions: z$1.ZodObject<{\n network: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>;\n }, z$1.core.$strip>], \"kind\">;\n reason: z$1.ZodNullable;\n availableDecisions: z$1.ZodArray>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"user_question\">;\n questions: z$1.ZodArray;\n multiSelect: z$1.ZodBoolean;\n options: z$1.ZodOptional;\n }, z$1.core.$strip>>>;\n allowFreeText: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>]>;\n resolution: z$1.ZodNullable;\n grantedPermissions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"allow_for_session\">;\n grantedPermissions: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable;\n write: z$1.ZodArray;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"deny\">;\n }, z$1.core.$strip>], \"decision\">, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"user_answer\">;\n answers: z$1.ZodRecord;\n freeText: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>]>>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n interrupted: \"interrupted\";\n resolving: \"resolving\";\n resolved: \"resolved\";\n }>;\n statusReason: z$1.ZodNullable;\n createdAt: z$1.ZodNumber;\n expiresAt: z$1.ZodOptional>;\n resolvedAt: z$1.ZodNullable;\n turnId: z$1.ZodNullable;\n origin: z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n rendererId: z$1.ZodString;\n }, z$1.core.$strip>;\n payload: z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n title: z$1.ZodString;\n data: z$1.ZodType>;\n }, z$1.core.$strip>;\n resolution: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>]>>;\ntype ThreadPendingInteractionsResponse = z$1.infer;\ndeclare const threadQueuedMessageListResponseSchema: z$1.ZodArray>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"project\">;\n projectId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"section\">;\n sectionId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"path\">;\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"command\">;\n trigger: z$1.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z$1.ZodString;\n source: z$1.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z$1.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z$1.ZodString;\n argumentHint: z$1.ZodNullable;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional>;\n itemId: z$1.ZodString;\n label: z$1.ZodString;\n }, z$1.core.$strip>], \"kind\">>;\n }, z$1.core.$strip>>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional;\n sizeBytes: z$1.ZodOptional;\n mimeType: z$1.ZodOptional;\n }, z$1.core.$strip>], \"type\">>;\n model: z$1.ZodString;\n reasoningLevel: z$1.ZodEnum<{\n none: \"none\";\n low: \"low\";\n medium: \"medium\";\n high: \"high\";\n xhigh: \"xhigh\";\n ultracode: \"ultracode\";\n max: \"max\";\n ultra: \"ultra\";\n }>;\n permissionMode: z$1.ZodEnum<{\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n full: \"full\";\n }>;\n serviceTier: z$1.ZodEnum<{\n default: \"default\";\n fast: \"fast\";\n }>;\n groupWithNext: z$1.ZodBoolean;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n}, z$1.core.$strip>>;\ntype ThreadQueuedMessageListResponse = z$1.infer;\ndeclare const threadChildSummaryResponseSchema: z$1.ZodObject<{\n nonDeletedChildCount: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype ThreadChildSummaryResponse = z$1.infer;\ndeclare const deleteThreadRequestSchema: z$1.ZodObject<{\n childThreadsConfirmed: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype DeleteThreadRequest = z$1.infer;\ndeclare const updateThreadRequestSchema: z$1.ZodObject<{\n title: z$1.ZodOptional>;\n sectionId: z$1.ZodOptional>;\n parentThreadId: z$1.ZodOptional>;\n model: z$1.ZodOptional>;\n reasoningLevel: z$1.ZodOptional>>;\n visibility: z$1.ZodOptional>;\n}, z$1.core.$strip>;\ntype UpdateThreadRequest = z$1.infer;\ndeclare const reorderPinnedThreadRequestSchema: z$1.ZodObject<{\n previousThreadId: z$1.ZodNullable;\n nextThreadId: z$1.ZodNullable;\n}, z$1.core.$strip>;\ntype ReorderPinnedThreadRequest = z$1.infer;\n/**\n * Requested placement for a thread opened in the app's split layout. Edge\n * placements add panes through the eighth pane; at the cap they replace the\n * focused pane. `replace` always replaces the focused pane.\n */\ndeclare const threadOpenSplitSchema: z$1.ZodEnum<{\n right: \"right\";\n down: \"down\";\n left: \"left\";\n top: \"top\";\n replace: \"replace\";\n}>;\ntype ThreadOpenSplit = z$1.infer;\n/** Optional secondary-panel file to open with a thread. */\ndeclare const threadOpenFileSchema: z$1.ZodObject<{\n source: z$1.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n path: z$1.ZodString;\n lineNumber: z$1.ZodNullable;\n}, z$1.core.$strict>;\ntype ThreadOpenFile = z$1.infer;\n/** Response for POST /threads/:id/open: how many connected clients received it. */\ndeclare const threadOpenResponseSchema: z$1.ZodObject<{\n delivered: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype ThreadOpenResponse = z$1.infer;\n/** Presentation action for one thread pane in each connected app window. */\ndeclare const threadPaneActionSchema: z$1.ZodEnum<{\n maximize: \"maximize\";\n restore: \"restore\";\n toggle: \"toggle\";\n}>;\ntype ThreadPaneAction = z$1.infer;\n/** Number of connected app clients that received the pane action. */\ndeclare const threadPaneActionResponseSchema: z$1.ZodObject<{\n delivered: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype ThreadPaneActionResponse = z$1.infer;\ndeclare const threadArchiveAllResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral;\n archivedThreadIds: z$1.ZodArray;\n}, z$1.core.$strip>;\ntype ThreadArchiveAllResponse = z$1.infer;\ndeclare const threadListQuerySchema: z$1.ZodObject<{\n projectId: z$1.ZodOptional;\n parentThreadId: z$1.ZodOptional;\n sourceThreadId: z$1.ZodOptional;\n archived: z$1.ZodOptional>;\n sectionId: z$1.ZodOptional;\n unsectioned: z$1.ZodOptional>;\n hasParent: z$1.ZodOptional>;\n originKind: z$1.ZodOptional>;\n excludeSideChats: z$1.ZodOptional>;\n childOrigin: z$1.ZodOptional>;\n includeHidden: z$1.ZodOptional>;\n limit: z$1.ZodOptional;\n offset: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype ThreadListQuery = z$1.infer;\ndeclare const threadSearchQuerySchema: z$1.ZodObject<{\n query: z$1.ZodString;\n limitPerGroup: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype ThreadSearchQuery = z$1.infer;\ndeclare const threadTimelineQuerySchema: z$1.ZodObject<{\n includeNestedRows: z$1.ZodOptional>;\n segmentLimit: z$1.ZodOptional;\n beforeAnchorSeq: z$1.ZodOptional;\n beforeAnchorId: z$1.ZodOptional;\n summaryOnly: z$1.ZodOptional>;\n afterSequence: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype ThreadTimelineQuery = z$1.infer;\ndeclare const timelineTurnSummaryDetailsQuerySchema: z$1.ZodObject<{\n turnId: z$1.ZodString;\n sourceSeqStart: z$1.ZodString;\n sourceSeqEnd: z$1.ZodString;\n}, z$1.core.$strip>;\ntype TimelineTurnSummaryDetailsQuery = z$1.infer;\ndeclare const threadStorageFilesQuerySchema: z$1.ZodObject<{\n query: z$1.ZodOptional;\n limit: z$1.ZodOptional;\n}, z$1.core.$strip>;\ntype ThreadStorageFilesQuery = z$1.infer;\ndeclare const threadStoragePathsQuerySchema: z$1.ZodObject<{\n query: z$1.ZodOptional;\n limit: z$1.ZodOptional;\n includeFiles: z$1.ZodEnum<{\n true: \"true\";\n false: \"false\";\n }>;\n includeDirectories: z$1.ZodEnum<{\n true: \"true\";\n false: \"false\";\n }>;\n}, z$1.core.$strip>;\ntype ThreadStoragePathsQuery = z$1.infer;\ndeclare const timelineTurnSummaryDetailsResponseSchema: z$1.ZodObject<{\n rows: z$1.ZodArray>>;\n}, z$1.core.$strip>;\ntype TimelineTurnSummaryDetailsResponse = z$1.infer;\ndeclare const threadTimelineResponseSchema: z$1.ZodObject<{\n rows: z$1.ZodArray>>;\n activePromptMode: z$1.ZodNullable;\n providerId: z$1.ZodEnum<{\n \"claude-code\": \"claude-code\";\n codex: \"codex\";\n }>;\n prompt: z$1.ZodString;\n }, z$1.core.$strict>>;\n activeThinking: z$1.ZodNullable>;\n activeWorkflows: z$1.ZodArray;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"workflow\">;\n itemId: z$1.ZodString;\n taskType: z$1.ZodString;\n workflowName: z$1.ZodNullable;\n description: z$1.ZodString;\n taskStatus: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n running: \"running\";\n paused: \"paused\";\n failed: \"failed\";\n killed: \"killed\";\n stopped: \"stopped\";\n }>;\n workflow: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n agents: z$1.ZodArray;\n model: z$1.ZodString;\n attempt: z$1.ZodNumber;\n cached: z$1.ZodBoolean;\n lastProgressAt: z$1.ZodNumber;\n phaseIndex: z$1.ZodOptional;\n phaseTitle: z$1.ZodOptional;\n agentType: z$1.ZodOptional;\n isolation: z$1.ZodOptional;\n queuedAt: z$1.ZodOptional;\n startedAt: z$1.ZodOptional;\n lastToolName: z$1.ZodOptional;\n lastToolSummary: z$1.ZodOptional;\n promptPreview: z$1.ZodOptional;\n resultPreview: z$1.ZodOptional;\n error: z$1.ZodOptional;\n tokens: z$1.ZodOptional;\n toolCalls: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n usage: z$1.ZodNullable>;\n summary: z$1.ZodNullable;\n error: z$1.ZodNullable;\n completedAt: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n activeBackgroundCommands: z$1.ZodArray;\n sourceSeqStart: z$1.ZodNumber;\n sourceSeqEnd: z$1.ZodNumber;\n startedAt: z$1.ZodNumber;\n createdAt: z$1.ZodNumber;\n kind: z$1.ZodLiteral<\"work\">;\n status: z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>;\n workKind: z$1.ZodLiteral<\"workflow\">;\n itemId: z$1.ZodString;\n taskType: z$1.ZodString;\n workflowName: z$1.ZodNullable;\n description: z$1.ZodString;\n taskStatus: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n running: \"running\";\n paused: \"paused\";\n failed: \"failed\";\n killed: \"killed\";\n stopped: \"stopped\";\n }>;\n workflow: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n agents: z$1.ZodArray;\n model: z$1.ZodString;\n attempt: z$1.ZodNumber;\n cached: z$1.ZodBoolean;\n lastProgressAt: z$1.ZodNumber;\n phaseIndex: z$1.ZodOptional;\n phaseTitle: z$1.ZodOptional;\n agentType: z$1.ZodOptional;\n isolation: z$1.ZodOptional;\n queuedAt: z$1.ZodOptional;\n startedAt: z$1.ZodOptional;\n lastToolName: z$1.ZodOptional;\n lastToolSummary: z$1.ZodOptional;\n promptPreview: z$1.ZodOptional;\n resultPreview: z$1.ZodOptional;\n error: z$1.ZodOptional;\n tokens: z$1.ZodOptional;\n toolCalls: z$1.ZodOptional;\n durationMs: z$1.ZodOptional;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n usage: z$1.ZodNullable>;\n summary: z$1.ZodNullable;\n error: z$1.ZodNullable;\n completedAt: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n pendingTodos: z$1.ZodNullable;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n goal: z$1.ZodNullable;\n tokenBudget: z$1.ZodNullable;\n tokensUsed: z$1.ZodNumber;\n timeUsedSeconds: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n modelFallback: z$1.ZodNullable;\n message: z$1.ZodString;\n }, z$1.core.$strip>>;\n contextWindowUsage: z$1.ZodOptional>;\n timelinePage: z$1.ZodObject<{\n kind: z$1.ZodEnum<{\n latest: \"latest\";\n older: \"older\";\n }>;\n segmentLimit: z$1.ZodNumber;\n returnedSegmentCount: z$1.ZodNumber;\n hasOlderRows: z$1.ZodBoolean;\n olderCursor: z$1.ZodNullable>;\n }, z$1.core.$strict>;\n maxSeq: z$1.ZodNumber;\n delta: z$1.ZodOptional>>;\n rowOrder: z$1.ZodOptional>;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype ThreadTimelineResponse = z$1.infer;\ndeclare const threadConversationOutlineResponseSchema: z$1.ZodObject<{\n items: z$1.ZodArray;\n preview: z$1.ZodString;\n attachmentSummary: z$1.ZodNullable>;\n }, z$1.core.$strict>>;\n maxSeq: z$1.ZodNumber;\n}, z$1.core.$strict>;\ntype ThreadConversationOutlineResponse = z$1.infer;\ndeclare const threadStorageFileListResponseSchema: z$1.ZodObject<{\n files: z$1.ZodArray>;\n truncated: z$1.ZodBoolean;\n storageRootPath: z$1.ZodString;\n}, z$1.core.$strip>;\ntype ThreadStorageFileListResponse = z$1.infer;\ndeclare const threadStoragePathListResponseSchema: z$1.ZodObject<{\n paths: z$1.ZodArray;\n path: z$1.ZodString;\n name: z$1.ZodString;\n score: z$1.ZodNumber;\n positions: z$1.ZodArray;\n }, z$1.core.$strip>>;\n truncated: z$1.ZodBoolean;\n storageRootPath: z$1.ZodString;\n}, z$1.core.$strip>;\ntype ThreadStoragePathListResponse = z$1.infer;\n\ndeclare const threadTabsResponseSchema: z$1.ZodObject<{\n revision: z$1.ZodNumber;\n tabs: z$1.ZodArray;\n }, z$1.core.$strict>, z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"git-diff\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n actionId: z$1.ZodString;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"plugin-panel\">;\n paramsJson: z$1.ZodNullable;\n pluginId: z$1.ZodString;\n title: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"workspace-file-preview\">;\n lineRange: z$1.ZodNullable>;\n path: z$1.ZodString;\n projectId: z$1.ZodNullable;\n source: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"working-tree\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"head\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"merge-base\">;\n ref: z$1.ZodString;\n }, z$1.core.$strict>], \"kind\">;\n statusLabel: z$1.ZodNullable>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"host-file-preview\">;\n lineRange: z$1.ZodNullable>;\n path: z$1.ZodString;\n threadId: z$1.ZodNullable;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable;\n id: z$1.ZodString;\n isPinned: z$1.ZodBoolean;\n kind: z$1.ZodLiteral<\"thread-storage-file-preview\">;\n lineRange: z$1.ZodNullable>;\n path: z$1.ZodString;\n threadId: z$1.ZodNullable;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"browser\">;\n title: z$1.ZodNullable;\n url: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"new-tab\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"side-chat\">;\n sourceMessageText: z$1.ZodString;\n sourceSeqEnd: z$1.ZodNullable;\n threadId: z$1.ZodNullable;\n title: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"terminal\">;\n terminalId: z$1.ZodString;\n }, z$1.core.$strict>], \"kind\">>;\n}, z$1.core.$strict>;\ntype ThreadTabsResponse = z$1.infer;\ndeclare const updateThreadTabsRequestSchema: z$1.ZodObject<{\n expectedRevision: z$1.ZodNumber;\n tabs: z$1.ZodArray;\n }, z$1.core.$strict>, z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"git-diff\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n actionId: z$1.ZodString;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"plugin-panel\">;\n paramsJson: z$1.ZodNullable;\n pluginId: z$1.ZodString;\n title: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"workspace-file-preview\">;\n lineRange: z$1.ZodNullable>;\n path: z$1.ZodString;\n projectId: z$1.ZodNullable;\n source: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"working-tree\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"head\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"merge-base\">;\n ref: z$1.ZodString;\n }, z$1.core.$strict>], \"kind\">;\n statusLabel: z$1.ZodNullable>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"host-file-preview\">;\n lineRange: z$1.ZodNullable>;\n path: z$1.ZodString;\n threadId: z$1.ZodNullable;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable;\n id: z$1.ZodString;\n isPinned: z$1.ZodBoolean;\n kind: z$1.ZodLiteral<\"thread-storage-file-preview\">;\n lineRange: z$1.ZodNullable>;\n path: z$1.ZodString;\n threadId: z$1.ZodNullable;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"browser\">;\n title: z$1.ZodNullable;\n url: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"new-tab\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"side-chat\">;\n sourceMessageText: z$1.ZodString;\n sourceSeqEnd: z$1.ZodNullable;\n threadId: z$1.ZodNullable;\n title: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"terminal\">;\n terminalId: z$1.ZodString;\n }, z$1.core.$strict>], \"kind\">>;\n}, z$1.core.$strict>;\ntype UpdateThreadTabsRequest = z$1.infer;\n\ninterface EnvironmentActionArgs {\n environmentId: string;\n}\ninterface EnvironmentGetArgs extends EnvironmentActionArgs {\n signal?: AbortSignal;\n}\ntype EnvironmentMergeBaseBranchUpdateValue = Exclude;\ntype EnvironmentNameUpdateValue = Exclude;\ninterface EnvironmentMergeBaseBranchUpdate {\n mergeBaseBranch: EnvironmentMergeBaseBranchUpdateValue;\n name?: EnvironmentNameUpdateValue;\n}\ninterface EnvironmentNameUpdate {\n mergeBaseBranch?: EnvironmentMergeBaseBranchUpdateValue;\n name: EnvironmentNameUpdateValue;\n}\ntype EnvironmentUpdateFields = EnvironmentMergeBaseBranchUpdate | EnvironmentNameUpdate;\ntype EnvironmentUpdateArgs = EnvironmentUpdateFields & {\n environmentId: string;\n};\ninterface EnvironmentStatusArgs extends EnvironmentStatusQuery {\n environmentId: string;\n signal?: AbortSignal;\n}\ntype EnvironmentDiffArgs = EnvironmentDiffQuery & {\n environmentId: string;\n signal?: AbortSignal;\n};\ntype EnvironmentDiffFileArgs = EnvironmentDiffFileQuery & {\n environmentId: string;\n signal?: AbortSignal;\n};\ninterface EnvironmentDiffBranchesArgs extends EnvironmentDiffBranchesQuery {\n environmentId: string;\n signal?: AbortSignal;\n}\ninterface EnvironmentCommitArgs {\n environmentId: string;\n}\ninterface EnvironmentSquashMergeArgs {\n environmentId: string;\n mergeBaseBranch: string;\n}\ninterface EnvironmentPullRequestMergeArgs {\n environmentId: string;\n method: PullRequestMergeMethod;\n}\ntype EnvironmentDiffPatchArgs = EnvironmentDiffPatchRequest & {\n environmentId: string;\n signal?: AbortSignal;\n};\ninterface EnvironmentPathsArgs extends EnvironmentPathsQuery {\n environmentId: string;\n signal?: AbortSignal;\n}\ntype EnvironmentArchiveThreadsResult = EnvironmentArchiveThreadsResponse;\ntype EnvironmentCommitResult = CommitActionResponse;\ntype EnvironmentDiffResult = EnvironmentDiffResponse;\ntype EnvironmentDiffBranchesResult = EnvironmentDiffBranchesResponse;\ntype EnvironmentDiffFileResult = EnvironmentDiffFileResponse;\ntype EnvironmentDiffFilesResult = EnvironmentDiffFilesResponse;\ntype EnvironmentDiffPatchResult = EnvironmentDiffPatchResponse;\ntype EnvironmentGetResult = Environment;\ntype EnvironmentMarkPullRequestDraftResult = PullRequestDraftActionResponse;\ntype EnvironmentMarkPullRequestReadyResult = PullRequestReadyActionResponse;\ntype EnvironmentMergePullRequestResult = PullRequestMergeActionResponse;\ntype EnvironmentPathsResult = WorkspacePathListResponse;\ntype EnvironmentPullRequestResult = EnvironmentPullRequestResponse;\ntype EnvironmentSquashMergeResult = SquashMergeActionResponse;\ntype EnvironmentStatusResult = EnvironmentStatusResponse;\ntype EnvironmentUpdateResult = Environment;\ninterface EnvironmentsArea {\n archiveThreads(args: EnvironmentActionArgs): Promise;\n commit(args: EnvironmentCommitArgs): Promise;\n diff(args: EnvironmentDiffArgs): Promise;\n diffBranches(args: EnvironmentDiffBranchesArgs): Promise;\n diffFile(args: EnvironmentDiffFileArgs): Promise;\n diffFiles(args: EnvironmentDiffArgs): Promise;\n diffPatch(args: EnvironmentDiffPatchArgs): Promise;\n get(args: EnvironmentGetArgs): Promise;\n pullRequest(args: EnvironmentGetArgs): Promise;\n markPullRequestDraft(args: EnvironmentActionArgs): Promise;\n markPullRequestReady(args: EnvironmentActionArgs): Promise;\n mergePullRequest(args: EnvironmentPullRequestMergeArgs): Promise;\n paths(args: EnvironmentPathsArgs): Promise;\n squashMerge(args: EnvironmentSquashMergeArgs): Promise;\n status(args: EnvironmentStatusArgs): Promise;\n update(args: EnvironmentUpdateArgs): Promise;\n}\n\n/**\n * Host file primitives. `hostId` may be omitted to target the server's\n * primary (local) host. `rootPath`, when set, confines the target beneath\n * that absolute root on the host (symlink-safe).\n */\ninterface FileReadArgs {\n hostId?: string;\n path: string;\n rootPath?: string;\n signal?: AbortSignal;\n}\ninterface FileWriteArgs {\n hostId?: string;\n path: string;\n rootPath?: string;\n content: string;\n /** Defaults to \"utf8\". */\n contentEncoding?: \"utf8\" | \"base64\";\n /** Defaults to false. */\n createParents?: boolean;\n /**\n * Optimistic-concurrency guard: omitted โ†’ unconditional write; a hash โ†’\n * write only when the current content hashes to it (use `read().sha256`);\n * null โ†’ create-only. A failed guard resolves to the `conflict` outcome.\n */\n expectedSha256?: string | null;\n /** POSIX permission bits used when creating a file (for example 0o600). */\n mode?: number;\n}\ninterface FileListArgs {\n hostId?: string;\n path: string;\n query?: string;\n limit?: number;\n signal?: AbortSignal;\n}\ninterface PathListArgs extends FileListArgs {\n includeFiles: boolean;\n includeDirectories: boolean;\n}\ninterface FileMkdirArgs {\n hostId?: string;\n path: string;\n rootPath?: string;\n recursive?: boolean;\n}\ninterface FileMoveArgs {\n hostId?: string;\n sourcePath: string;\n destinationPath: string;\n rootPath?: string;\n}\ninterface FileRemoveArgs {\n hostId?: string;\n path: string;\n rootPath?: string;\n recursive?: boolean;\n}\ninterface FilePreviewArgs {\n hostId?: string;\n rootPath: string;\n signal?: AbortSignal;\n ttlMs?: number;\n}\ntype FileReadResult = HostFileReadResponse;\ntype FileWriteResult = HostFileWriteResponse;\ntype FileListResult = HostFileListResponse;\ntype PathListResult = HostPathListResponse;\ntype FileMkdirResult = HostMkdirResponse;\ntype FileMoveResult = HostMovePathResponse;\ntype FileRemoveResult = HostRemovePathResponse;\ntype FilePreviewResult = CreateFilePreviewResponse;\ninterface FilesArea {\n read(args: FileReadArgs): Promise;\n write(args: FileWriteArgs): Promise;\n list(args: FileListArgs): Promise;\n listPaths(args: PathListArgs): Promise;\n mkdir(args: FileMkdirArgs): Promise;\n move(args: FileMoveArgs): Promise;\n remove(args: FileRemoveArgs): Promise;\n createPreview(args: FilePreviewArgs): Promise;\n}\n\ninterface GuideRenderArgs {\n chapter?: string;\n}\ninterface GuideRenderResult {\n chapter?: string;\n content: string;\n}\ninterface GuideArea {\n render(args?: GuideRenderArgs): GuideRenderResult;\n}\n\ninterface HostGetArgs {\n hostId: string;\n signal?: AbortSignal;\n}\ninterface HostDeleteArgs {\n hostId: string;\n}\ninterface HostUpdateArgs extends UpdateHostRequest {\n hostId: string;\n}\ninterface HostRetryUpdateArgs {\n hostId: string;\n}\ninterface HostDirectoryArgs extends HostDirectoryQuery {\n hostId: string;\n signal?: AbortSignal;\n}\ninterface HostCloneDefaultPathArgs extends HostCloneDefaultPathQuery {\n hostId: string;\n signal?: AbortSignal;\n}\ninterface HostPathsExistArgs extends HostPathsExistRequest {\n hostId: string;\n signal?: AbortSignal;\n}\ninterface HostPickFolderArgs extends HostPickFolderRequest {\n hostId: string;\n signal?: AbortSignal;\n}\ninterface HostProviderCliInstallArgs extends HostProviderCliInstallRequest {\n hostId: string;\n}\ninterface HostListArgs {\n signal?: AbortSignal;\n}\ntype HostCreateJoinCodeResult = CreateHostJoinCodeResponse;\ntype HostDeleteResult = {\n ok: true;\n};\ntype HostDirectoryResult = HostDirectoryListing;\ntype HostGetResult = Host;\ntype HostCloneDefaultPathResult = HostCloneDefaultPathResponse;\ntype HostProviderCliInstallResult = HostProviderCliInstallEvent[];\ntype HostListResult = Host[];\ntype HostPathsExistResult = HostPathsExistResponse;\ntype HostPickFolderResult = HostPickFolderResponse;\ntype HostProviderCliStatusResult = HostProviderCliStatusResponse;\ntype HostRetryUpdateResult = HostRetryUpdateResponse;\ntype HostUpdateResult = Host;\ninterface HostsArea {\n createJoinCode(): Promise;\n delete(args: HostDeleteArgs): Promise;\n directory(args: HostDirectoryArgs): Promise;\n get(args: HostGetArgs): Promise;\n cloneDefaultPath(args: HostCloneDefaultPathArgs): Promise;\n installProviderCli(args: HostProviderCliInstallArgs): Promise;\n list(args?: HostListArgs): Promise;\n pathsExist(args: HostPathsExistArgs): Promise;\n pickFolder(args: HostPickFolderArgs): Promise;\n providerCliStatus(args: HostGetArgs): Promise;\n retryUpdate(args: HostRetryUpdateArgs): Promise;\n update(args: HostUpdateArgs): Promise;\n}\n\ninterface ProjectListArgs {\n include?: ProjectListQuery[\"include\"];\n /** Include the singleton personal project. Defaults to false for compatibility. */\n includePersonal?: boolean;\n signal?: AbortSignal;\n}\ninterface ProjectCreateArgs extends CreateProjectRequest {\n}\ninterface ProjectGetArgs {\n projectId: string;\n signal?: AbortSignal;\n}\ninterface ProjectUpdateArgs extends UpdateProjectRequest {\n projectId: string;\n}\ninterface ProjectDeleteArgs {\n projectId: string;\n}\ninterface ProjectReorderArgs extends ReorderProjectRequest {\n projectId: string;\n}\ninterface ProjectPromptHistoryArgs extends PromptHistoryQuery {\n projectId: string;\n signal?: AbortSignal;\n}\n/** Select one project workspace source, or omit both for the primary host. */\ntype ProjectWorkspaceRoutingArgs = {\n environmentId: string;\n hostId?: never;\n} | {\n environmentId?: never;\n hostId: string;\n} | {\n environmentId?: never;\n hostId?: never;\n};\ntype ProjectFilesArgs = ProjectWorkspaceRoutingArgs & Omit & {\n projectId: string;\n signal?: AbortSignal;\n};\ntype ProjectPathsArgs = ProjectWorkspaceRoutingArgs & Omit & {\n projectId: string;\n signal?: AbortSignal;\n};\ntype ProjectCommandsArgs = ProjectWorkspaceRoutingArgs & Omit & {\n projectId: string;\n signal?: AbortSignal;\n};\ntype ProjectFileContentArgs = ProjectWorkspaceRoutingArgs & Omit & {\n projectId: string;\n signal?: AbortSignal;\n};\ninterface ProjectBranchesArgs extends ProjectBranchesQuery {\n projectId: string;\n signal?: AbortSignal;\n}\ninterface ProjectDefaultExecutionOptionsArgs {\n projectId: string;\n signal?: AbortSignal;\n}\ninterface ProjectAttachmentFileLike {\n arrayBuffer(): Promise;\n readonly name: string;\n readonly type?: string;\n}\ninterface ProjectAttachmentUploadArgsBase {\n /** MIME override. Omit to use the File/Blob type, when available. */\n mimeType?: string;\n projectId: string;\n}\n/**\n * Upload bytes owned by this SDK client. A bare Blob/byte buffer needs an\n * explicit filename; File-like values can supply their own name.\n */\ntype ProjectAttachmentUploadArgs = ProjectAttachmentUploadArgsBase & ({\n clientFile: ProjectAttachmentFileLike;\n filename?: string;\n} | {\n clientFile: ArrayBuffer | Blob | Uint8Array;\n filename: string;\n});\ninterface ProjectAttachmentReadArgs {\n path: string;\n projectId: string;\n signal?: AbortSignal;\n}\ninterface ProjectAttachmentCopyArgs extends CopyProjectAttachmentsRequest {\n projectId: string;\n}\ntype ProjectSourceAddArgs = CreateProjectSourceRequest & {\n projectId: string;\n};\ninterface ProjectSourceUpdateArgs extends UpdateProjectSourceRequest {\n projectId: string;\n sourceId: string;\n}\ninterface ProjectSourceDeleteArgs {\n projectId: string;\n sourceId: string;\n}\ntype ProjectBranchesResult = ProjectBranchesResponse;\ninterface ProjectAttachmentReadResult {\n bytes: Uint8Array;\n mimeType: string;\n sizeBytes: number;\n}\ntype ProjectAttachmentUploadResult = UploadedPromptAttachment;\ntype ProjectCommandsResult = CommandListResponse;\ntype ProjectCreateResult = ProjectResponse;\ntype ProjectDefaultExecutionOptionsResult = ProjectExecutionDefaults | null;\ntype ProjectDeleteResult = {\n ok: true;\n};\ninterface ProjectFileContentResult {\n /** UTF-8 text or base64, as selected by `contentEncoding`. */\n content: string;\n contentEncoding: \"utf8\" | \"base64\";\n mimeType: string;\n sizeBytes: number;\n}\ntype ProjectFilesResult = WorkspaceFileListResponse;\ntype ProjectGetResult = ProjectResponse;\ntype ProjectListResult = ProjectResponse[] | ProjectWithThreadsResponse[];\ntype ProjectPathsResult = WorkspacePathListResponse;\ntype ProjectPromptHistoryResult = PromptHistoryResponse;\ntype ProjectReorderResult = ProjectResponse[];\ntype ProjectSourceAddResult = ProjectSource;\ntype ProjectSourceDeleteResult = {\n ok: true;\n};\ntype ProjectSourceUpdateResult = ProjectSource;\ntype ProjectUpdateResult = ProjectResponse;\ninterface ProjectSourcesArea {\n add(args: ProjectSourceAddArgs): Promise;\n delete(args: ProjectSourceDeleteArgs): Promise;\n update(args: ProjectSourceUpdateArgs): Promise;\n}\ninterface ProjectAttachmentsArea {\n copy(args: ProjectAttachmentCopyArgs): Promise;\n read(args: ProjectAttachmentReadArgs): Promise;\n upload(args: ProjectAttachmentUploadArgs): Promise;\n}\ninterface ProjectsArea {\n attachments: ProjectAttachmentsArea;\n branches(args: ProjectBranchesArgs): Promise;\n commands(args: ProjectCommandsArgs): Promise;\n create(args: ProjectCreateArgs): Promise;\n defaultExecutionOptions(args: ProjectDefaultExecutionOptionsArgs): Promise;\n delete(args: ProjectDeleteArgs): Promise;\n fileContent(args: ProjectFileContentArgs): Promise;\n files(args: ProjectFilesArgs): Promise;\n get(args: ProjectGetArgs): Promise;\n list(args?: ProjectListArgs): Promise;\n paths(args: ProjectPathsArgs): Promise;\n promptHistory(args: ProjectPromptHistoryArgs): Promise;\n reorder(args: ProjectReorderArgs): Promise;\n sources: ProjectSourcesArea;\n update(args: ProjectUpdateArgs): Promise;\n}\n\n/** Select exactly one provider-discovery host source, or omit both for primary. */\ntype ProviderHostRoutingArgs = {\n environmentId: string;\n hostId?: never;\n} | {\n environmentId?: never;\n hostId: string;\n} | {\n environmentId?: never;\n hostId?: never;\n};\ntype ProviderListArgs = ProviderHostRoutingArgs & {\n signal?: AbortSignal;\n};\ntype ProviderModelsArgs = ProviderHostRoutingArgs & {\n providerId?: string;\n signal?: AbortSignal;\n};\ntype ProviderListResult = ProviderInfo[];\ntype ProviderModelsResult = SystemExecutionOptionsResponse;\ninterface ProvidersArea {\n /** List providers on the environment host, explicit host, or primary host. */\n list(args?: ProviderListArgs): Promise;\n /** List models on the environment host, explicit host, or primary host. */\n models(args?: ProviderModelsArgs): Promise;\n}\n\ninterface PluginIdArgs {\n pluginId: string;\n}\n/** Install directly from a path:, git:, npm:, or builtin: source spec. */\ninterface PluginInstallArgs {\n source: string;\n}\n/** Install an entry from BB's official catalog. */\ninterface PluginCatalogInstallArgs {\n entryId: string;\n}\ninterface PluginReloadArgs {\n pluginId?: string;\n}\ninterface PluginSettingsUpdateArgs extends PluginIdArgs {\n values: Record;\n}\ninterface PluginTokenArgs extends PluginIdArgs {\n rotate?: boolean;\n}\ninterface PluginCheckUpdatesArgs {\n pluginId?: string;\n signal?: AbortSignal;\n}\ninterface PluginRpcArgs extends PluginIdArgs {\n input?: JsonValue;\n method: string;\n outputSchema: z$1.ZodType;\n}\ninterface PluginCatalogSearchArgs {\n query: string;\n signal?: AbortSignal;\n}\ninterface PluginCatalogStatusArgs {\n signal?: AbortSignal;\n}\ninterface PluginGetSettingsArgs extends PluginIdArgs {\n signal?: AbortSignal;\n}\ninterface PluginGetSourceArgs extends PluginIdArgs {\n signal?: AbortSignal;\n}\ninterface PluginListArgs {\n signal?: AbortSignal;\n}\ninterface PluginListUpdateResultsArgs {\n signal?: AbortSignal;\n}\ntype PluginDisableResult = InstalledPlugin;\ntype PluginEnableResult = InstalledPlugin;\ntype PluginGetSettingsResult = PluginSettingsResponse;\ntype PluginInstallResult = InstalledPlugin;\ntype PluginListResult = PluginListResponse;\ntype PluginReloadResult = PluginReloadResponse;\ntype PluginRemoveResult = PluginRemoveResponse;\ntype PluginTokenResult = PluginTokenResponse;\ntype PluginUpdateSettingsResult = PluginSettingsResponse;\ntype PluginGetSourceResult = PluginSourceDetail;\ntype PluginCheckUpdatesResult = PluginUpdateCheckEntry[];\ntype PluginApplyUpdateResult = PluginApplyUpdateResult$1;\ntype PluginCatalogStatusResult = PluginCatalogStatus;\ntype PluginCatalogSearchResult = PluginCatalogSearchResult$1[];\ninterface PluginCatalogArea {\n install(args: PluginCatalogInstallArgs): Promise;\n search(args: PluginCatalogSearchArgs): Promise;\n status(args?: PluginCatalogStatusArgs): Promise;\n}\ninterface PluginsArea {\n applyUpdate(args: PluginIdArgs): Promise;\n callRpc(args: PluginRpcArgs): Promise;\n checkUpdates(args?: PluginCheckUpdatesArgs): Promise;\n catalog: PluginCatalogArea;\n disable(args: PluginIdArgs): Promise;\n enable(args: PluginIdArgs): Promise;\n getSettings(args: PluginGetSettingsArgs): Promise;\n getSource(args: PluginGetSourceArgs): Promise;\n install(args: PluginInstallArgs): Promise;\n list(args?: PluginListArgs): Promise;\n listUpdateResults(args?: PluginListUpdateResultsArgs): Promise;\n reload(args?: PluginReloadArgs): Promise;\n remove(args: PluginIdArgs): Promise;\n token(args: PluginTokenArgs): Promise;\n updateSettings(args: PluginSettingsUpdateArgs): Promise;\n}\n\ntype BbRealtimeUnsubscribe = () => void;\ntype BbRealtimeEventName = \"thread:changed\" | \"project:changed\" | \"environment:changed\" | \"host:changed\" | \"system:changed\" | \"system:config-changed\" | \"realtime:connection\";\ntype ThreadRealtimeEvent = Extract;\ntype ProjectRealtimeEvent = Extract;\ntype EnvironmentRealtimeEvent = Extract;\ntype HostRealtimeEvent = Extract;\ntype SystemRealtimeEvent = Extract;\ntype BbRealtimeConnectionState = \"connecting\" | \"connected\" | \"disconnected\";\ninterface BbRealtimeConnectionEvent {\n reconnectDelayMs: number | null;\n reconnected: boolean;\n state: BbRealtimeConnectionState;\n}\n/**\n * Entity-changed events are delivered as one shared object to every matching\n * listener; their payload types are readonly so a listener cannot mutate what\n * the next listener receives.\n */\ninterface BbRealtimeEventMap {\n \"thread:changed\": ThreadRealtimeEvent;\n \"project:changed\": ProjectRealtimeEvent;\n \"environment:changed\": EnvironmentRealtimeEvent;\n \"host:changed\": HostRealtimeEvent;\n \"system:changed\": SystemRealtimeEvent;\n \"system:config-changed\": SystemRealtimeEvent;\n \"realtime:connection\": BbRealtimeConnectionEvent;\n}\ntype BbRealtimeCallback = (event: BbRealtimeEventMap[TEventName]) => void;\ninterface ThreadRealtimeSubscribeArgs {\n callback: BbRealtimeCallback<\"thread:changed\">;\n event: \"thread:changed\";\n threadId?: string;\n}\ninterface ProjectRealtimeSubscribeArgs {\n callback: BbRealtimeCallback<\"project:changed\">;\n event: \"project:changed\";\n projectId?: string;\n}\ninterface EnvironmentRealtimeSubscribeArgs {\n callback: BbRealtimeCallback<\"environment:changed\">;\n environmentId?: string;\n event: \"environment:changed\";\n}\ninterface HostRealtimeSubscribeArgs {\n callback: BbRealtimeCallback<\"host:changed\">;\n event: \"host:changed\";\n hostId?: string;\n}\ninterface SystemRealtimeSubscribeArgs {\n callback: BbRealtimeCallback<\"system:changed\">;\n event: \"system:changed\";\n}\ninterface SystemConfigRealtimeSubscribeArgs {\n callback: BbRealtimeCallback<\"system:config-changed\">;\n event: \"system:config-changed\";\n}\n/**\n * Connection listeners are pure observers โ€” they never open or hold the\n * socket. A listener registered while a socket already exists receives the\n * latest connection event as a snapshot on the next microtask, so a status\n * UI mounted after connect still learns the current state.\n */\ninterface RealtimeConnectionSubscribeArgs {\n callback: BbRealtimeCallback<\"realtime:connection\">;\n event: \"realtime:connection\";\n}\ntype BbRealtimeSubscribeArgsUnion = ThreadRealtimeSubscribeArgs | ProjectRealtimeSubscribeArgs | EnvironmentRealtimeSubscribeArgs | HostRealtimeSubscribeArgs | SystemRealtimeSubscribeArgs | SystemConfigRealtimeSubscribeArgs | RealtimeConnectionSubscribeArgs;\ntype BbRealtimeSubscribeArgs = Extract;\ninterface BbRealtime {\n subscribe(args: BbRealtimeSubscribeArgs): BbRealtimeUnsubscribe;\n}\n\ninterface StatusGetArgs {\n projectId?: string;\n signal?: AbortSignal;\n threadId?: string;\n}\ninterface StatusThreadSummary {\n environmentId: string | null;\n id: string;\n parentThreadId: string | null;\n pinnedAt: number | null;\n projectId: string;\n status: ThreadStatus;\n title: string | null;\n}\ntype StatusProject = ProjectResponse;\ntype StatusChildThreads = ThreadListResponse;\ninterface StatusResult {\n childThreads: StatusChildThreads | null;\n pendingTodos: ThreadTimelinePendingTodos | null;\n project: StatusProject | null;\n thread: StatusThreadSummary | null;\n}\ninterface StatusArea {\n get(args?: StatusGetArgs): Promise;\n}\n\ninterface SkillWorkspaceArgs {\n projectId: string;\n environmentId: string | null;\n}\ninterface SkillListArgs extends SkillWorkspaceArgs {\n signal?: AbortSignal;\n}\ninterface SkillIdentityArgs extends SkillListArgs {\n skillId: string;\n}\ninterface SkillContentArgs extends SkillIdentityArgs {\n path: string;\n}\ninterface SkillUpdateArgs extends SkillWorkspaceArgs {\n skillId: string;\n content: string;\n revision: string;\n}\ninterface SkillDeleteArgs extends SkillWorkspaceArgs {\n skillId: string;\n}\ninterface RegistrySkillsSearchArgs {\n query?: string;\n page?: number;\n perPage?: number;\n}\ninterface RegistrySkillIdArgs {\n registrySkillId: string;\n}\ninterface RegistrySkillSourceArgs {\n source: string;\n skillId: string;\n}\ntype RegistrySkillInstallArgs = RegistrySkillIdArgs;\ninterface SkillsRegistryArea {\n detail(args: RegistrySkillSourceArgs): Promise;\n get(args: RegistrySkillIdArgs): Promise;\n install(args: RegistrySkillInstallArgs): Promise;\n search(args?: RegistrySkillsSearchArgs): Promise;\n}\ninterface SkillsArea {\n getContent(args: SkillContentArgs): Promise;\n list(args: SkillListArgs): Promise;\n listFiles(args: SkillIdentityArgs): Promise;\n registry: SkillsRegistryArea;\n remove(args: SkillDeleteArgs): Promise<{\n deletedPath: string;\n }>;\n update(args: SkillUpdateArgs): Promise<{\n filePath: string;\n revision: string;\n }>;\n}\n\ntype ThemeGetResult = AppTheme;\ntype ThemeCatalogResult = ThemeCatalogResponse;\ntype ThemeSetInput = AppThemeSelection;\ntype ThemeSetResult = AppTheme;\ninterface ThemeCatalogArgs {\n signal?: AbortSignal;\n}\ninterface ThemeGetArgs {\n signal?: AbortSignal;\n}\ninterface ThemeArea {\n /** The active app palette, resolved server-side (built-in id or custom CSS). */\n get(args?: ThemeGetArgs): Promise;\n /** The custom-theme directory plus discovered themes and the active palette. */\n catalog(args?: ThemeCatalogArgs): Promise;\n /** Set the complete app appearance selection in one request. */\n set(selection: ThemeSetInput): Promise;\n /**\n * Activate a palette by id while preserving the active favicon color. This\n * compatibility shorthand reads the active appearance before writing the\n * complete selection; prefer the object form when both values are known.\n */\n set(themeId: string): Promise;\n}\n\ninterface SystemAttentionArgs {\n signal?: AbortSignal;\n}\ninterface SystemConfigArgs {\n signal?: AbortSignal;\n}\ninterface SystemExecutionOptionsArgs extends SystemExecutionOptionsQuery {\n signal?: AbortSignal;\n}\ninterface SystemUsageLimitsArgs extends SystemUsageLimitsQuery {\n signal?: AbortSignal;\n}\ninterface SystemVersionArgs {\n force?: boolean;\n signal?: AbortSignal;\n}\ninterface SystemVoiceTranscriptionArgs {\n file: Blob;\n prompt?: string;\n signal?: AbortSignal;\n}\ntype SystemAttentionResult = SystemAttentionResponse;\ntype SystemConfigResult = SystemConfigResponse;\ntype SystemExecutionOptionsResult = SystemExecutionOptionsResponse;\ntype SystemReloadConfigResult = SystemConfigReloadResponse;\ntype SystemVoiceTranscriptionResult = SystemVoiceTranscriptionResponse;\ntype SystemUpdateExperimentsResult = Experiments;\ntype SystemUpdateGeneralSettingsResult = AppSettings;\ntype SystemUpdateKeyboardSettingsResult = AppKeybindingOverrides;\ntype SystemUsageLimitsResult = ProviderUsageResponse;\ntype SystemVersionResult = SystemVersionResponse;\ninterface SystemArea {\n attention(args?: SystemAttentionArgs): Promise;\n config(args?: SystemConfigArgs): Promise;\n executionOptions(args?: SystemExecutionOptionsArgs): Promise;\n reloadConfig(): Promise;\n transcribeVoice(args: SystemVoiceTranscriptionArgs): Promise;\n updateExperiments(args: Experiments): Promise;\n updateGeneralSettings(args: AppSettings): Promise;\n updateKeyboardSettings(args: AppKeybindingOverrides): Promise;\n usageLimits(args?: SystemUsageLimitsArgs): Promise;\n version(args?: SystemVersionArgs): Promise;\n}\n\ninterface TerminalThreadScope {\n cwd?: never;\n environmentId?: never;\n hostId?: never;\n kind: \"thread\";\n threadId: string;\n}\ninterface TerminalEnvironmentScope {\n environmentId: string;\n cwd?: never;\n hostId?: never;\n kind: \"environment\";\n threadId?: never;\n}\ninterface TerminalHostPathListScope {\n /** Optional exact initial working-directory filter on the selected host. */\n cwd?: string;\n environmentId?: never;\n hostId: string;\n kind: \"host_path\";\n threadId?: never;\n}\ninterface TerminalHostPathCreateScope {\n /** Null starts in the selected host's home directory. */\n cwd: string | null;\n environmentId?: never;\n hostId: string;\n kind: \"host_path\";\n threadId?: never;\n}\ntype TerminalListScope = TerminalThreadScope | TerminalEnvironmentScope | TerminalHostPathListScope;\ntype TerminalCreateScope = TerminalThreadScope | TerminalEnvironmentScope | TerminalHostPathCreateScope;\ninterface TerminalListArgs {\n signal?: AbortSignal;\n scope: TerminalListScope;\n}\ninterface TerminalCreateArgs {\n cols: number;\n rows: number;\n scope: TerminalCreateScope;\n start?: CreateTerminalRequest[\"start\"];\n title?: string;\n}\ninterface TerminalTargetArgs {\n terminalId: string;\n}\ninterface TerminalGetArgs extends TerminalTargetArgs {\n signal?: AbortSignal;\n}\ninterface TerminalRenameArgs extends TerminalTargetArgs {\n title: UpdateTerminalRequest[\"title\"];\n}\ninterface TerminalCloseArgs extends TerminalTargetArgs {\n mode: \"force\" | \"if-clean\";\n}\ninterface TerminalInputArgs extends TerminalTargetArgs {\n dataBase64: TerminalInputRequest[\"dataBase64\"];\n}\ninterface TerminalResizeArgs extends TerminalTargetArgs {\n cols: TerminalResizeRequest[\"cols\"];\n rows: TerminalResizeRequest[\"rows\"];\n}\ninterface TerminalOutputArgs extends TerminalTargetArgs {\n limitChunks?: TerminalOutputQuery[\"limitChunks\"];\n signal?: AbortSignal;\n sinceSeq?: TerminalOutputQuery[\"sinceSeq\"];\n tailBytes?: TerminalOutputQuery[\"tailBytes\"];\n}\ntype TerminalRestartArgs = TerminalTargetArgs;\ntype TerminalListResult = TerminalListResponse;\ntype TerminalCreateResult = TerminalSession;\ntype TerminalGetResult = TerminalSession;\ntype TerminalRenameResult = TerminalSession;\ntype TerminalCloseResult = TerminalSession;\ntype TerminalInputResult = TerminalSession;\ntype TerminalResizeResult = TerminalSession;\ntype TerminalOutputResult = TerminalOutputResponse;\ntype TerminalRestartResult = TerminalSession;\ninterface TerminalsArea {\n close(args: TerminalCloseArgs): Promise;\n create(args: TerminalCreateArgs): Promise;\n get(args: TerminalGetArgs): Promise;\n input(args: TerminalInputArgs): Promise;\n list(args: TerminalListArgs): Promise;\n output(args: TerminalOutputArgs): Promise;\n rename(args: TerminalRenameArgs): Promise;\n /**\n * Replace a terminal with a shell at the same scope, size, and title.\n * The original command is not replayed because terminal sessions do not\n * persist launch commands. The replacement has a new terminal ID.\n */\n restart(args: TerminalRestartArgs): Promise;\n resize(args: TerminalResizeArgs): Promise;\n}\n\ninterface ThreadListArgs {\n archived?: boolean;\n excludeSideChats?: boolean;\n sectionId?: string;\n hasParent?: boolean;\n includeHidden?: boolean;\n limit?: number;\n offset?: number;\n originKind?: ThreadListQuery[\"originKind\"];\n parentThreadId?: string;\n projectId?: string;\n signal?: AbortSignal;\n sourceThreadId?: string;\n unsectioned?: boolean;\n}\ninterface ThreadSearchArgs extends ThreadSearchQuery {\n signal?: AbortSignal;\n}\ninterface ThreadGetArgs {\n include?: ThreadGetQuery[\"include\"];\n signal?: AbortSignal;\n threadId: string;\n}\ntype ThreadGetResult = ThreadResponse | ThreadWithIncludesResponse;\ntype ThreadListResult = ThreadListResponse;\ntype ThreadSearchResult = ThreadSearchResponse;\ninterface ThreadOutputResponse {\n output: string | null;\n}\ntype ThreadMutationResult = ThreadResponse;\ntype ThreadSpawnResult = ThreadResponse;\ntype ThreadForkResult = ThreadResponse;\ntype ThreadInteractionGetResult = PendingInteraction;\ntype ThreadInteractionListResult = ThreadPendingInteractionsResponse;\ntype ThreadInteractionResolveResult = PendingInteraction;\ntype ThreadInteractionRespondResult = PendingInteraction;\ntype ThreadInteractionCancelResult = PendingInteraction;\ntype ThreadEventsListResult = ThreadEventRow[];\ntype ThreadEventWaitResult = ThreadEventRow | null;\ntype ThreadTimelineResult = ThreadTimelineResponse;\ntype ThreadArchiveResult = ThreadArchiveAllResponse;\ntype ThreadOpenResult = ThreadOpenResponse;\ntype ThreadPaneActionResult = ThreadPaneActionResponse;\ntype ThreadDeleteResult = {\n ok: true;\n};\ntype ThreadSendResult = {\n ok: true;\n};\ntype ThreadStopResult = {\n ok: true;\n};\ntype ThreadBannerActionResult = {\n ok: true;\n};\ntype ThreadUnarchiveResult = {\n ok: true;\n};\ntype ThreadArchiveAllResult = ThreadArchiveAllResponse;\ntype ThreadReadStateResult = ThreadResponse;\ntype ThreadPinOrderResult = ThreadListResponse;\ntype ThreadPromptHistoryResult = PromptHistoryResponse;\ntype ThreadQueuedMessagesResult = ThreadQueuedMessageListResponse;\ntype ThreadQueuedMessageCreateResult = ThreadQueuedMessage;\ntype ThreadQueuedMessageUpdateResult = ThreadQueuedMessage;\ntype ThreadQueuedMessageDeleteResult = {\n ok: true;\n};\ntype ThreadQueuedMessageReorderResult = ThreadQueuedMessageListResponse;\ntype ThreadQueuedMessageSendResult = SendQueuedMessageResponse;\ntype ThreadQueuedMessageGroupBoundaryResult = ThreadQueuedMessageListResponse;\ntype ThreadTabsResult = ThreadTabsResponse;\ntype ThreadTabsUpdateResult = ThreadTabsResponse;\ntype ThreadStorageFilesResult = ThreadStorageFileListResponse;\ntype ThreadStoragePathsResult = ThreadStoragePathListResponse;\ntype ThreadChildSummaryResult = ThreadChildSummaryResponse;\ntype ThreadDefaultExecutionOptionsResult = ResolvedThreadExecutionOptions | null;\ntype ThreadConversationOutlineResult = ThreadConversationOutlineResponse;\ntype ThreadTimelineTurnSummaryDetailsResult = TimelineTurnSummaryDetailsResponse;\ninterface ThreadSpawnBaseArgs extends Omit {\n childOrigin?: CreateThreadRequest[\"childOrigin\"];\n origin?: CreateThreadRequest[\"origin\"];\n originKind?: CreateThreadRequest[\"originKind\"];\n startedOnBehalfOf?: CreateThreadRequest[\"startedOnBehalfOf\"];\n}\ntype ThreadSpawnArgs = ThreadSpawnBaseArgs & ({\n input: CreateThreadRequest[\"input\"];\n prompt?: never;\n} | {\n input?: never;\n prompt: string;\n});\ninterface ThreadForkArgs extends Omit {\n origin?: ForkThreadRequest[\"origin\"];\n visibility?: ForkThreadRequest[\"visibility\"];\n workspace?: ForkThreadRequest[\"workspace\"];\n}\ninterface ThreadUpdateArgs extends UpdateThreadRequest {\n threadId: string;\n}\ninterface ThreadDeleteArgs extends DeleteThreadRequest {\n threadId: string;\n}\ninterface ThreadSendArgs extends SendMessageRequest {\n threadId: string;\n}\ninterface ThreadActionArgs {\n threadId: string;\n}\ninterface ThreadStatusArgs extends ThreadActionArgs {\n signal?: AbortSignal;\n}\ninterface ThreadPromptHistoryArgs extends PromptHistoryQuery {\n signal?: AbortSignal;\n threadId: string;\n}\ninterface ThreadPinOrderArgs extends ReorderPinnedThreadRequest {\n threadId: string;\n}\ninterface ThreadQueuedMessageArgs {\n signal?: AbortSignal;\n threadId: string;\n}\ninterface ThreadQueuedMessageCreateArgs extends CreateQueuedMessageRequest {\n threadId: string;\n}\ninterface ThreadQueuedMessageUpdateArgs extends ThreadQueuedMessageTargetArgs, UpdateQueuedMessageRequest {\n}\ninterface ThreadQueuedMessageTargetArgs {\n queuedMessageId: string;\n threadId: string;\n}\ninterface ThreadQueuedMessageSendArgs extends ThreadQueuedMessageTargetArgs, SendQueuedMessageRequest {\n}\ninterface ThreadQueuedMessageReorderArgs extends ThreadQueuedMessageTargetArgs, ReorderQueuedMessageRequest {\n}\ninterface ThreadQueuedMessageGroupBoundaryArgs extends SetQueuedMessageGroupBoundaryRequest {\n threadId: string;\n}\ninterface ThreadStorageFilesArgs extends ThreadStorageFilesQuery {\n signal?: AbortSignal;\n threadId: string;\n}\ninterface ThreadStoragePathsArgs extends ThreadStoragePathsQuery {\n signal?: AbortSignal;\n threadId: string;\n}\ninterface ThreadTimelineTurnSummaryDetailsArgs extends TimelineTurnSummaryDetailsQuery {\n signal?: AbortSignal;\n threadId: string;\n}\ninterface ThreadTabsUpdateArgs extends UpdateThreadTabsRequest {\n threadId: string;\n}\ninterface ThreadOpenArgs {\n threadId: string;\n split?: ThreadOpenSplit;\n file: ThreadOpenFile | null;\n}\ninterface ThreadPaneActionArgs {\n action: ThreadPaneAction;\n threadId: string;\n}\ninterface ThreadEventsListArgs {\n afterSeq?: string;\n limit?: string;\n signal?: AbortSignal;\n threadId: string;\n}\ninterface ThreadEventWaitArgs {\n afterSeq?: string;\n signal?: AbortSignal;\n threadId: string;\n type: string;\n waitMs: string;\n}\ninterface ThreadTimelineArgs extends ThreadTimelineQuery {\n signal?: AbortSignal;\n threadId: string;\n}\ninterface ThreadOutputArgs {\n signal?: AbortSignal;\n threadId: string;\n}\ninterface ThreadInteractionListArgs {\n signal?: AbortSignal;\n threadId: string;\n}\ninterface ThreadInteractionTargetArgs {\n interactionId: string;\n threadId: string;\n}\ninterface ThreadInteractionGetArgs extends ThreadInteractionTargetArgs {\n signal?: AbortSignal;\n}\ninterface ThreadInteractionResolveArgs extends ThreadInteractionTargetArgs {\n resolution: PendingInteractionResolution;\n}\ninterface ThreadInteractionRespondArgs extends ThreadInteractionTargetArgs {\n value: JsonValue;\n}\ntype ThreadWaitTarget = {\n kind: \"status\";\n status: ThreadStatus;\n} | {\n kind: \"event\";\n eventType: string;\n};\ninterface ThreadWaitArgs {\n event?: string;\n pollIntervalMs?: number;\n signal?: AbortSignal;\n status?: ThreadStatus;\n threadId: string;\n timeoutMs?: number;\n}\ntype ThreadWaitResult = {\n event: NonNullable;\n matched: true;\n target: Extract;\n threadId: string;\n} | {\n matched: true;\n target: Extract;\n thread: ThreadGetResult;\n threadId: string;\n};\ninterface ThreadInteractionsArea {\n cancel(args: ThreadInteractionTargetArgs): Promise;\n get(args: ThreadInteractionGetArgs): Promise;\n list(args: ThreadInteractionListArgs): Promise;\n resolve(args: ThreadInteractionResolveArgs): Promise;\n respond(args: ThreadInteractionRespondArgs): Promise;\n}\ninterface ThreadEventsArea {\n list(args: ThreadEventsListArgs): Promise;\n wait(args: ThreadEventWaitArgs): Promise;\n}\ninterface ThreadQueuedMessagesArea {\n create(args: ThreadQueuedMessageCreateArgs): Promise;\n delete(args: ThreadQueuedMessageTargetArgs): Promise;\n list(args: ThreadQueuedMessageArgs): Promise;\n reorder(args: ThreadQueuedMessageReorderArgs): Promise;\n send(args: ThreadQueuedMessageSendArgs): Promise;\n setGroupBoundary(args: ThreadQueuedMessageGroupBoundaryArgs): Promise;\n update(args: ThreadQueuedMessageUpdateArgs): Promise;\n}\ninterface ThreadTabsArea {\n get(args: ThreadStatusArgs): Promise;\n update(args: ThreadTabsUpdateArgs): Promise;\n}\ninterface ThreadsArea {\n archive(args: ThreadActionArgs): Promise;\n archiveAll(args: ThreadActionArgs): Promise;\n childSummary(args: ThreadStatusArgs): Promise;\n cancelPlan(args: ThreadActionArgs): Promise;\n clearGoal(args: ThreadActionArgs): Promise;\n conversationOutline(args: ThreadStatusArgs): Promise;\n defaultExecutionOptions(args: ThreadStatusArgs): Promise;\n delete(args: ThreadDeleteArgs): Promise;\n events: ThreadEventsArea;\n fork(args: ThreadForkArgs): Promise;\n get(args: ThreadGetArgs): Promise;\n interactions: ThreadInteractionsArea;\n list(args?: ThreadListArgs): Promise;\n markRead(args: ThreadActionArgs): Promise;\n markUnread(args: ThreadActionArgs): Promise;\n open(args: ThreadOpenArgs): Promise;\n paneAction(args: ThreadPaneActionArgs): Promise;\n output(args: ThreadOutputArgs): Promise;\n pin(args: ThreadActionArgs): Promise;\n promptHistory(args: ThreadPromptHistoryArgs): Promise;\n queuedMessages: ThreadQueuedMessagesArea;\n reorderPinned(args: ThreadPinOrderArgs): Promise;\n search(args: ThreadSearchArgs): Promise;\n send(args: ThreadSendArgs): Promise;\n spawn(args: ThreadSpawnArgs): Promise;\n stop(args: ThreadActionArgs): Promise;\n tabs: ThreadTabsArea;\n timeline(args: ThreadTimelineArgs): Promise;\n timelineTurnSummaryDetails(args: ThreadTimelineTurnSummaryDetailsArgs): Promise;\n storageFiles(args: ThreadStorageFilesArgs): Promise;\n storagePaths(args: ThreadStoragePathsArgs): Promise;\n unarchive(args: ThreadActionArgs): Promise;\n unpin(args: ThreadActionArgs): Promise;\n update(args: ThreadUpdateArgs): Promise;\n wait(args: ThreadWaitArgs): Promise;\n}\n\ntype ThreadSectionCreateResult = ThreadSectionResponse;\ntype ThreadSectionUpdateResult = ThreadSectionMutationResponse;\ntype ThreadSectionDeleteResult = ThreadSectionMutationResponse;\ntype ThreadSectionListResult = ThreadSectionResponse[];\ninterface ThreadSectionListArgs {\n signal?: AbortSignal;\n}\ninterface ThreadSectionsArea {\n create(args: CreateThreadSectionRequest): Promise;\n delete(args: DeleteThreadSectionRequest): Promise;\n list(args?: ThreadSectionListArgs): Promise;\n update(args: UpdateThreadSectionRequest): Promise;\n}\n\ninterface BbSdk extends BbRealtime {\n environments: EnvironmentsArea;\n files: FilesArea;\n guide: GuideArea;\n hosts: HostsArea;\n projects: ProjectsArea;\n plugins: PluginsArea;\n providers: ProvidersArea;\n skills: SkillsArea;\n status: StatusArea;\n system: SystemArea;\n terminals: TerminalsArea;\n theme: ThemeArea;\n threadSections: ThreadSectionsArea;\n threads: ThreadsArea;\n}\n\n/**\n * The backend plugin API contract โ€” the `bb` object handed to a plugin's\n * `server.ts` factory (`export default function plugin(bb: BbPluginApi)`).\n *\n * Types only: the implementation lives in the BB server\n * (apps/server/src/services/plugins/plugin-api.ts), which imports these\n * shapes so the contract and the implementation cannot drift. Plugin authors\n * import them type-only (`import type { BbPluginApi } from\n * \"@bb/plugin-sdk\"`); the import is erased when BB loads the file.\n *\n * Runtime classes stay host-side. NeedsConfigurationError in particular is\n * matched by NAME, so plugin code needs no runtime import:\n * `throw Object.assign(new Error(msg), { name: \"NeedsConfigurationError\" })`.\n */\ninterface PluginLogger {\n debug(message: string): void;\n info(message: string): void;\n warn(message: string): void;\n error(message: string): void;\n}\n/**\n * Declarative settings descriptors (`bb.settings.define`). Deliberately plain\n * data โ€” not zod โ€” so the host can render settings forms and the CLI can\n * parse values without executing plugin code.\n */\ntype PluginSettingDescriptor = {\n type: \"string\";\n label: string;\n description?: string;\n /** Stored in a 0600 file under /plugins//secrets/, never in the db or sent to the frontend. */\n secret?: true;\n default?: string;\n} | {\n type: \"boolean\";\n label: string;\n description?: string;\n default?: boolean;\n} | {\n type: \"select\";\n label: string;\n description?: string;\n options: string[];\n default?: string;\n} | {\n type: \"project\";\n label: string;\n description?: string;\n default?: string;\n};\ntype PluginSettingDescriptors = Record;\ntype PluginSettingValue = string | boolean;\n/** `default` present โ†’ non-optional value; absent โ†’ `T | undefined`. */\ntype PluginSettingsValues> = {\n [K in keyof Ds]: Ds[K] extends {\n default: string | boolean;\n } ? PluginSettingValueOf : PluginSettingValueOf | undefined;\n};\ntype PluginSettingValueOf = D extends {\n type: \"boolean\";\n} ? boolean : string;\ninterface PluginSettingsHandle> {\n /** Load-safe: callable inside the factory. */\n get(): Promise>;\n /** Fires after values change through the settings route/CLI. */\n onChange(listener: (next: PluginSettingsValues, prev: PluginSettingsValues) => void): void;\n}\ninterface PluginSettings {\n define>(descriptors: Ds): PluginSettingsHandle;\n}\ninterface PluginKvStorage {\n get(key: string): Promise;\n set(key: string, value: unknown): Promise;\n delete(key: string): Promise;\n list(prefix?: string): Promise;\n}\ninterface PluginStorage {\n /** Namespaced JSON key-value rows in bb.db; values โ‰ค256KB each. */\n kv: PluginKvStorage;\n /**\n * Open (or reuse the path of) the plugin's own SQLite database at\n * /plugins//data.db โ€” the server's better-sqlite3, WAL mode,\n * busy_timeout 5000. Handles are host-tracked and closed on\n * dispose/reload; a closed handle throws on use.\n */\n database(): Database.Database;\n /**\n * Ordered-statement migration helper: statement index = migration id in a\n * `_bb_migrations` table; unapplied statements run in one transaction.\n * Append-only โ€” never reorder or edit shipped statements.\n */\n migrate(db: Database.Database, statements: string[]): void;\n}\n/**\n * Thread lifecycle events a plugin can observe (design ยง4.5). Observe-only:\n * handlers run fire-and-forget after the transition is applied and can never\n * block or veto it. `thread` is the same public DTO GET /threads/:id serves.\n */\ninterface PluginThreadEventPayloads {\n /** Fired after a thread row is created. */\n \"thread.created\": {\n thread: ThreadResponse;\n };\n /** Fired when a thread transitions into `active`. */\n \"thread.active\": {\n thread: ThreadResponse;\n };\n /** Fired when a thread transitions into `idle`. `lastAssistantText` is\n * assembled the same way GET /threads/:id/output is. */\n \"thread.idle\": {\n thread: ThreadResponse;\n lastAssistantText: string | null;\n };\n /** Fired when a thread transitions into `error`. `error` is the latest\n * system/error event message, when one exists. */\n \"thread.failed\": {\n thread: ThreadResponse;\n error: string | null;\n };\n /** Fired after a thread is archived (including cascade archives). */\n \"thread.archived\": {\n thread: ThreadResponse;\n };\n /** Fired after a thread is soft-deleted. */\n \"thread.deleted\": {\n thread: ThreadResponse;\n };\n}\ntype PluginThreadEventName = keyof PluginThreadEventPayloads;\ntype PluginThreadEventHandler = (payload: PluginThreadEventPayloads[E]) => void | Promise;\ntype PluginHttpAuthMode = \"local\" | \"token\" | \"none\";\ntype PluginHttpHandler = (context: Context) => Response | Promise;\ninterface PluginHttp {\n /**\n * Register an HTTP route, mounted at\n * `/api/v1/plugins//http/`. Auth modes (default \"local\"):\n * - \"local\": Origin/Host must be a local BB app origin; non-GET requires\n * content-type application/json (forces a CORS preflight).\n * - \"token\": requires the per-plugin token (`bb plugin token `) via\n * the x-bb-plugin-token header or ?token=.\n * - \"none\": no checks โ€” only for signature-verified webhooks.\n */\n route(method: string, path: string, handler: PluginHttpHandler, opts?: {\n auth?: PluginHttpAuthMode;\n }): void;\n}\ninterface PluginRpc {\n /**\n * Register a Standard Schema-driven rpc contract and its inferred handlers,\n * served at POST\n * `/api/v1/plugins//rpc/` with \"local\" auth semantics. The\n * host validates input before invocation and output before strict JSON\n * serialization. The response is `{ ok: true, result }` or\n * `{ ok: false, error: { code, message, issues? } }`.\n */\n register(contract: Contract, handlers: PluginRpcHandlers): void;\n}\ninterface PluginRealtime {\n /**\n * Broadcast an ephemeral `plugin-signal` WS message\n * `{ pluginId, channel, payload }` to every connected client (V1 has no\n * per-channel subscriptions). `payload` must be JSON-serializable;\n * `undefined` is normalized to `null`. Nothing is persisted.\n */\n publish(channel: string, payload: unknown): void;\n}\ninterface PluginBackground {\n /**\n * Register a long-lived background service. `start` runs after the\n * factory completes and should resolve when `signal` aborts\n * (dispose/reload/disable/shutdown). A crash restarts it with capped\n * exponential backoff; throwing NeedsConfigurationError marks the plugin\n * `needs-configuration` and stops restarting until the next load.\n */\n service(name: string, service: {\n start(signal: AbortSignal): void | Promise;\n }): void;\n /**\n * Register a cron schedule (5-field expression, server-local time). The\n * durable row keyed (pluginId, name) is upserted at load; the periodic\n * sweep claims due rows with a CAS on next_run_at, but only while this\n * plugin is loaded. Failures land in last_status/last_error, visible in\n * `bb plugin list`.\n */\n schedule(name: string, cron: string, fn: () => void | Promise): void;\n}\ninterface PluginCliCommandInfo {\n name: string;\n summary: string;\n usage: string;\n}\n/** Context forwarded from the invoking CLI when known; all fields optional. */\ninterface PluginCliContext {\n cwd?: string;\n threadId?: string;\n projectId?: string;\n /** Aborted when the invoking CLI HTTP request disconnects. */\n signal?: AbortSignal;\n}\ntype PluginInteractionCancelReason = \"user\" | \"request-aborted\" | \"thread-stopped\" | \"thread-deleted\" | \"plugin-disposed\" | \"server-restarted\" | \"timeout\";\ntype PluginInteractionResult = {\n outcome: \"submitted\";\n value: JsonValue$1;\n} | {\n outcome: \"cancelled\";\n reason: PluginInteractionCancelReason;\n};\ninterface PluginInteractionRequest {\n threadId: string;\n rendererId: string;\n title: string;\n payload: JsonValue$1;\n /** Defaults to ten minutes; capped at one hour. */\n timeoutMs?: number;\n}\ninterface PluginCliResult {\n exitCode: number;\n stdout?: string;\n stderr?: string;\n}\n/**\n * Maximum combined UTF-8 bytes accepted from plugin CLI stdout and stderr.\n * This is the shared source of truth for production and the testing harness.\n */\ndeclare const PLUGIN_CLI_OUTPUT_MAX_BYTES: number;\ninterface PluginCliOutputLimitError {\n code: \"plugin_cli_output_too_large\";\n message: string;\n maxBytes: number;\n stdoutBytes: number;\n stderrBytes: number;\n totalBytes: number;\n}\n/** Normalized host result returned by the plugin CLI HTTP/testing boundary. */\ninterface PluginCliExecutionResult {\n exitCode: number;\n stdout: string;\n stderr: string;\n error?: PluginCliOutputLimitError;\n}\ninterface PluginCliRegistration {\n /** Top-level command name (`bb โ€ฆ`): lowercase [a-z0-9-]+, and not\n * a core bb command (see RESERVED_BB_CLI_COMMANDS in the server). */\n name: string;\n summary: string;\n /** Subcommand metadata rendered in help and the plugin-commands skill\n * without executing plugin code. Parsing argv is plugin-owned. */\n commands?: PluginCliCommandInfo[];\n run(argv: string[], ctx: PluginCliContext): PluginCliResult | Promise;\n}\ninterface PluginCli {\n /**\n * Register this plugin's `bb` subcommand. One registration per factory\n * execution; a repeated call is rejected. Core bb commands always win\n * name collisions; reserved names are rejected at registration.\n */\n register(registration: PluginCliRegistration): void;\n}\n/** Per-turn context handed to bb.agents context providers (design ยง4.4). */\n/** MCP-style content parts a native tool may return (design ยง4.4). */\ntype PluginAgentToolContentPart = {\n type: \"text\";\n text: string;\n} | {\n type: \"image\";\n data: string;\n mimeType: string;\n};\ntype PluginAgentToolResult = string | {\n content: PluginAgentToolContentPart[];\n isError?: boolean;\n};\n/** Per-call context handed to a native tool's execute (design ยง4.4). */\ninterface PluginAgentToolContext {\n threadId: string;\n projectId: string;\n /** The tool-call request's abort signal (aborts if the daemon round-trip\n * is torn down mid-call). */\n signal: AbortSignal;\n}\ninterface PluginAgentToolRegistrationBase {\n /** Tool name shown to the model: [a-zA-Z0-9_-]+, unique across plugins,\n * and not a built-in dynamic tool (see RESERVED_AGENT_TOOL_NAMES in the\n * server). */\n name: string;\n description: string;\n /**\n * Optional usage snippet appended to the thread instructions whenever\n * this tool is in the session's tool set (mirrors the built-in\n * update_environment_directory guidance). Limited to 4096 characters.\n */\n instructions?: string;\n}\n/** Stable, plain-data context resolved by the server for one agent session. */\ninterface PluginAgentConfigurationContext {\n thread: {\n id: string;\n title: string | null;\n parentThreadId: string | null;\n sourceThreadId: string | null;\n };\n project: {\n id: string;\n kind: \"standard\" | \"personal\";\n name: string;\n gitRemoteUrl: string | null;\n };\n environment: {\n id: string;\n name: string | null;\n path: string | null;\n workspaceProvisionType: \"unmanaged\" | \"managed-worktree\" | \"personal\";\n branchName: string | null;\n };\n host: {\n id: string;\n name: string;\n };\n provider: {\n id: string;\n model: string;\n };\n sideChat: boolean;\n origin: {\n kind: \"fork\" | \"side-chat\" | null;\n pluginId: string | null;\n };\n}\n/** Object form of a {@link PluginAgentConfiguration} tools entry: selects a\n * registered tool and overrides the parameter schema advertised to the\n * provider for this resolution only. */\ninterface PluginAgentToolSelection {\n /** Name of a tool registered by this plugin via `registerTool`. */\n name: string;\n /** JSON-schema object (root `type: \"object\"`, JSON-serializable, at most\n * 128 KiB serialized) sent to the provider in place of the registered\n * parameter schema. Execution-side validation still runs the registered\n * parameters, so the override must only narrow what the registered schema\n * already accepts. */\n parameters: Record;\n}\n/** Per-resolution selection returned by {@link PluginAgents.configure}. */\ninterface PluginAgentConfiguration {\n /** Tool names registered by this plugin, or {@link PluginAgentToolSelection}\n * entries to also override a tool's advertised parameter schema for this\n * resolution. Duplicate or unknown names, or an invalid override, reject\n * this plugin's complete selection for the resolution. */\n tools: Array;\n /** Skill frontmatter names from this plugin's manifest skill roots.\n * Duplicate or unknown names reject this plugin's complete selection. */\n skills: string[];\n /** Optional dynamic instructions. Output is truncated to 4096 characters. */\n instructions?: string;\n}\ninterface PluginAgents {\n /**\n * Select this plugin's statically registered tools and manifest skills for\n * each thread/session resolution, with optional dynamic instructions. The\n * callback is synchronous and runs at `thread.start` / `turn.submit`; it\n * never rebuilds registrations. Exactly one callback may be registered per\n * factory execution. A throw, malformed result, duplicate id, unknown id,\n * or more than 256 tool/skill ids fails closed for this plugin only.\n *\n * Tools take effect when the provider session is next started or resumed;\n * an already-running session is not hot-mutated. Instructions are resolved\n * for the next turn. Skill changes follow BB's environment runtime policy:\n * a busy runtime keeps its current catalog until a safe relaunch. Side-chat\n * threads receive `sideChat: true`, and their returned tool, skill, and\n * dynamic-instruction selections apply at the same boundaries. Independent\n * side-chat safety policy (such as permission escalation) is unchanged.\n */\n configure(provider: (context: PluginAgentConfigurationContext) => PluginAgentConfiguration): void;\n /**\n * Register a native dynamic tool (design ยง4.4). `parameters` is either a\n * zod schema (validated per call; execute receives the parsed value) or a\n * plain JSON-schema object (no validation; execute receives the raw\n * arguments as `unknown`). Tool-set changes apply on the NEXT session\n * start โ€” a tool registered mid-session is not hot-added to running\n * provider sessions. A second registration of the same name within this\n * plugin is rejected; a name already registered by another plugin is\n * rejected and surfaced as this plugin's status detail.\n */\n registerTool(tool: PluginAgentToolRegistrationBase & {\n parameters: Schema;\n execute(params: z.output, ctx: PluginAgentToolContext): PluginAgentToolResult | Promise;\n }): void;\n registerTool(tool: PluginAgentToolRegistrationBase & {\n /** Raw JSON-schema escape hatch; params arrive unvalidated. */\n parameters: Record;\n execute(params: unknown, ctx: PluginAgentToolContext): PluginAgentToolResult | Promise;\n }): void;\n /**\n * Contribute a dynamic section appended to thread instructions. The\n * provider runs when a thread's runtime command config is resolved\n * (thread.start / turn.submit); return null to contribute nothing for\n * that resolution. Must be synchronous and fast โ€” it sits on the\n * thread-start path. Output longer than 4096 characters is truncated; a\n * throwing provider is logged against the plugin and contributes nothing.\n * A repeated registration within one factory execution is rejected.\n * This legacy contribution is not applied to side-chat threads; use\n * configure() when sideChat-aware dynamic instructions are required.\n */\n contributeInstructions(provider: (ctx: {\n threadId: string;\n projectId: string;\n }) => string | null): void;\n}\ninterface PluginThreadActionContext {\n threadId: string;\n projectId: string;\n}\ninterface PluginThreadActionToast {\n kind: \"success\" | \"error\" | \"info\";\n message: string;\n}\ntype PluginThreadActionResult = void | {\n toast?: PluginThreadActionToast;\n};\ninterface PluginThreadActionRegistration {\n /** Unique within this plugin: [a-zA-Z0-9_-]+ (becomes a URL segment). */\n id: string;\n /** Button label rendered in the thread header. */\n title: string;\n /** Optional icon name; the host falls back to a generic icon. */\n icon?: string;\n /** Optional confirmation prompt the host shows before running. */\n confirm?: string;\n /**\n * Runs server-side when the user clicks the action. The host shows a\n * pending state while in flight, the returned toast on completion, and an\n * automatic error toast when this throws.\n */\n run(ctx: PluginThreadActionContext): PluginThreadActionResult | Promise;\n}\ntype PluginMentionTrigger = \"@\" | \"#\" | \"$\" | \"!\" | \"~\";\n/** Search context handed to a mention provider (design ยง4.9). `projectId`/\n * `threadId` are null when the composer has not committed one yet. */\ninterface PluginMentionSearchContext {\n trigger: PluginMentionTrigger;\n query: string;\n projectId: string | null;\n threadId: string | null;\n}\n/** One row a mention provider returns from `search`. `id` is the provider's\n * own item id โ€” the host namespaces it before it reaches the wire. */\ninterface PluginMentionItem {\n id: string;\n title: string;\n subtitle?: string;\n icon?: string;\n}\ninterface PluginMentionProviderRegistration {\n /** Unique within this plugin: [a-zA-Z0-9_-]+ (no \":\" โ€” the host composes\n * wire item ids as \":\"). */\n id: string;\n /** Section label shown above this provider's rows in the mention menu. */\n label: string;\n /**\n * Composer trigger characters this provider should answer. Omit to use the\n * default `@` mention trigger. Valid triggers are `@`, `#`, `$`, `!`, and `~`.\n */\n triggers?: readonly PluginMentionTrigger[];\n /**\n * Runs server-side as the user types after one of this provider's triggers\n * in the composer. Each call is time-boxed (2s) and failure-isolated: a slow\n * or throwing provider contributes an empty list โ€” it can never break the\n * mention menu.\n */\n search(ctx: PluginMentionSearchContext): PluginMentionItem[] | Promise;\n /**\n * Resolves one picked item into agent context, called once per unique\n * item at message send time. The returned `context` is attached to the\n * message as an agent-visible (user-hidden) prompt input. Throwing blocks\n * the send with a visible error.\n */\n resolve(itemId: string): {\n context: string;\n } | Promise<{\n context: string;\n }>;\n}\ninterface PluginUi {\n /** Block until the app submits or cancels a plugin-owned composer form. */\n requestInput(request: PluginInteractionRequest, options?: {\n signal?: AbortSignal;\n }): Promise;\n /**\n * Register a thread action rendered in the shipped app's thread header\n * (design ยง4.9). Multiple actions per plugin; ids must be unique within\n * the plugin. Invoked via POST /plugins/:id/actions/:actionId.\n */\n registerThreadAction(action: PluginThreadActionRegistration): void;\n /**\n * Register a mention provider for the shipped app's composer (design ยง4.9).\n * Providers default to the `@` trigger and may opt into `#`, `$`, `!`, or\n * `~` with `triggers`. Items group under `label` in the mention menu; a\n * picked item becomes a `{ kind: \"plugin\" }` mention resource whose context\n * is resolved once at send time. Multiple providers per plugin; ids must be\n * unique within the plugin.\n */\n registerMentionProvider(provider: PluginMentionProviderRegistration): void;\n}\ninterface PluginEvents {\n /**\n * Add a thread lifecycle listener. Multiple listeners for the same event are\n * additive and run independently in registration order.\n */\n on(event: E, handler: PluginThreadEventHandler): void;\n}\ninterface PluginServerApi {\n /**\n * This BB server's own loopback base URL (e.g. \"http://127.0.0.1:38886\"),\n * which serves the SPA + /api + /ws. For plugins that proxy or relay\n * traffic back to the server itself (e.g. a tunnel). Bind-gated like\n * `bb.sdk`: reading it before the server is listening throws, so prefer\n * reading it from handlers, services, and timers.\n */\n readonly loopbackBaseUrl: string;\n}\ninterface PluginSharedPortTunnelIdentity {\n /** Gate routing label assigned to this machine. */\n label: string;\n /** Gate apex without a scheme, e.g. \"getbb.app\". */\n baseDomain: string;\n}\ninterface PluginHosts {\n /**\n * Ensure this enrolled host has a gate label and return its read-only public\n * identity. The daemon chooses the trusted gate and desired label; plugins\n * cannot influence either credential-bearing destination.\n */\n ensureSharedPortTunnel(hostId: string): Promise;\n /**\n * Replace this plugin's desired shared-loopback ports for one host. The\n * server aggregates declarations, owns generations, and delivers the\n * resulting set to that host's daemon. Tunnel identity is deliberately not\n * accepted here: it is owned by the daemon's trusted enrollment.\n */\n declareSharedPorts(hostId: string, ports: readonly number[]): void;\n}\ninterface PluginStatusApi {\n /**\n * Mark this plugin `needs-configuration` (with a message shown in\n * `bb plugin list` and the UI) instead of failing โ€” e.g. a factory or\n * service that finds no API key configured. Cleared on the next load;\n * saving settings does not auto-reload in V1, so ask the user to\n * `bb plugin reload ` after configuring.\n */\n needsConfiguration(message: string): void;\n}\n/**\n * The API object handed to a plugin's factory (design ยง4). Implemented by\n * the BB server; this contract is what plugin `server.ts` files compile\n * against.\n */\ninterface BbPluginApi {\n /** The plugin's own id (namespaces storage, routes, commands). */\n readonly pluginId: string;\n /** Leveled, plugin-scoped logger. */\n readonly log: PluginLogger;\n /** Declarative settings (design ยง4.2). */\n readonly settings: PluginSettings;\n /** Namespaced KV + per-plugin database (design ยง4.3). */\n readonly storage: PluginStorage;\n /** HTTP routes under /api/v1/plugins//http/* (design ยง4.6). */\n readonly http: PluginHttp;\n /** RPC methods under /api/v1/plugins//rpc/ (design ยง4.6). */\n readonly rpc: PluginRpc;\n /** Ephemeral push to connected frontends (design ยง4.7). */\n readonly realtime: PluginRealtime;\n /** Long-lived services + cron schedules (design ยง4.8). */\n readonly background: PluginBackground;\n /** Agent-facing `bb` CLI subcommand (design ยง4.4). */\n readonly cli: PluginCli;\n /** Per-turn agent context contributions (design ยง4.4). */\n readonly agents: PluginAgents;\n /** Host-rendered UI contributions (design ยง4.9). */\n readonly ui: PluginUi;\n /** Additive plugin lifecycle listeners (design ยง4.5). */\n readonly events: PluginEvents;\n /** Plugin-reported status (needs-configuration). */\n readonly status: PluginStatusApi;\n /** Read-only facts about the running server (loopback base URL). */\n readonly server: PluginServerApi;\n /** Server-to-daemon host control-plane declarations. */\n readonly hosts: PluginHosts;\n /**\n * The full BB SDK, bound to this server over loopback (design ยง4.1).\n * Bind-gated: reading this before the host binds the SDK throws. The real\n * server binds it before loading plugins, so it is available from the\n * moment factories run there โ€” but isolated harnesses may not, so prefer\n * using it from handlers, services, and timers for portability.\n * `threads.spawn` defaults `origin` to \"plugin\" and `originPluginId` to\n * this plugin's id so spawned threads are attributed automatically.\n */\n readonly sdk: BbSdk;\n /**\n * Register cleanup to run on reload/disable/shutdown. Hooks run LIFO.\n * The sanctioned place to clear timers and close connections.\n */\n onDispose(hook: () => void | Promise): void;\n}\n\nexport { PLUGIN_CLI_OUTPUT_MAX_BYTES, defineRpcContract };\nexport type { BbContext, BbNavigate, BbPluginApi, ComposerCustomization, ComposerPlusMenuItem, ComposerRichTextSpec, ComposerStructuredDraft, ComposerView, JsonValue$1 as JsonValue, MarkdownProps, PluginAgentConfiguration, PluginAgentConfigurationContext, PluginAgentToolContentPart, PluginAgentToolContext, PluginAgentToolRegistrationBase, PluginAgentToolResult, PluginAgentToolSelection, PluginAgents, PluginAppBuilder, PluginAppComposer, PluginAppContentScripts, PluginAppDefinition, PluginAppSetup, PluginAppSlots, PluginBackground, PluginCli, PluginCliCommandInfo, PluginCliContext, PluginCliExecutionResult, PluginCliOutputLimitError, PluginCliRegistration, PluginCliResult, PluginComposerApi, PluginComposerMention, PluginComposerScope, PluginComposerTextEffect, PluginComposerThreadRowStatus, PluginContentScriptContext, PluginContentScriptDisposer, PluginContentScriptRegistration, PluginEvents, PluginFileOpenerProps, PluginFileOpenerRegistration, PluginFileOpenerSource, PluginHomepageSectionProps, PluginHomepageSectionRegistration, PluginHosts, PluginHttp, PluginHttpAuthMode, PluginHttpHandler, PluginInteractionCancelReason, PluginInteractionRequest, PluginInteractionResult, PluginKvStorage, PluginLogger, PluginMentionItem, PluginMentionProviderRegistration, PluginMentionSearchContext, PluginMentionTrigger, PluginMessageActionContext, PluginMessageActionRegistration, PluginMessageActionThreadPanelOptions, PluginMessageDirectiveMessage, PluginMessageDirectiveOpenWorkspaceFile, PluginMessageDirectiveProps, PluginMessageDirectiveRegistration, PluginNavPanelProps, PluginNavPanelRegistration, PluginPendingInteractionProps, PluginPendingInteractionRegistration, PluginPendingInteractionView, PluginRealtime, PluginRealtimeConnectionState, PluginRpc, PluginRpcCallArgs, PluginRpcClient, PluginRpcContract, PluginRpcError, PluginRpcErrorCode, PluginRpcHandlers, PluginRpcIssuePathSegment, PluginRpcMethodContract, PluginRpcResult, PluginRpcValidationIssue, PluginSdkApp, PluginServerApi, PluginSettingDescriptor, PluginSettingDescriptors, PluginSettingValue, PluginSettings, PluginSettingsHandle, PluginSettingsSectionProps, PluginSettingsSectionRegistration, PluginSettingsState, PluginSettingsValues, PluginSharedPortTunnelIdentity, PluginSidebarFooterActionContext, PluginSidebarFooterActionProps, PluginSidebarFooterActionRegistration, PluginStatusApi, PluginStorage, PluginThreadActionContext, PluginThreadActionRegistration, PluginThreadActionResult, PluginThreadActionToast, PluginThreadEventHandler, PluginThreadEventName, PluginThreadEventPayloads, PluginThreadPanelActionContext, PluginThreadPanelActionRegistration, PluginThreadPanelProps, PluginUi, StandardSchemaV1, StandardSchemaV1InferInput, StandardSchemaV1InferOutput, StandardSchemaV1Issue, StandardSchemaV1Result, ThreadChatMessageAction, ThreadChatMessageReference, ThreadChatProps, experimental_PluginMessageActionPlacement, experimental_PluginRenderedTextSelection };\n"; -export const PLUGIN_SDK_APP_DTS = "// Portable type declarations for `@bb/plugin-sdk`. Unpublished BB\n// workspace contracts are flattened; public subpaths may reuse the\n// package root without requiring any other @bb/* package.\n//\n// Confused by the API, or need a symbol that isn't here? Clone the BB repo\n// and read the real source: https://github.com/ymichael/bb\n\nimport * as react from 'react';\nimport { ComponentType, ReactNode } from 'react';\n\n/** A JSON-safe path segment reported by a Standard Schema validation issue. */\ntype PluginRpcIssuePathSegment = string | number;\n/** Validator-neutral validation detail carried by an RPC error envelope. */\ninterface PluginRpcValidationIssue {\n message: string;\n path?: PluginRpcIssuePathSegment[];\n}\n/** Stable wire error categories for plugin RPC. */\ntype PluginRpcErrorCode = \"invalid_json\" | \"invalid_input\" | \"handler_error\" | \"invalid_output\" | \"non_json_result\" | \"unknown_method\";\n/** Structured RPC failure returned as `{ ok: false, error }`. */\ninterface PluginRpcError {\n code: PluginRpcErrorCode;\n message: string;\n issues?: PluginRpcValidationIssue[];\n}\n/**\n * The validator-neutral subset of Standard Schema v1 used by plugin RPC.\n * Zod 4 schemas implement this interface directly; other validators can do\n * the same without becoming part of BB's public protocol.\n */\ninterface StandardSchemaV1 {\n readonly \"~standard\": {\n readonly version: 1;\n readonly vendor: string;\n readonly validate: (value: unknown) => StandardSchemaV1Result | Promise>;\n readonly types?: {\n readonly input: Input;\n readonly output: Output;\n };\n };\n}\ntype StandardSchemaV1Result = {\n readonly value: Output;\n readonly issues?: undefined;\n} | {\n readonly issues: readonly StandardSchemaV1Issue[];\n};\ninterface StandardSchemaV1Issue {\n readonly message: string;\n readonly path?: PropertyKey | readonly (PropertyKey | {\n readonly key: PropertyKey;\n })[];\n}\ntype StandardSchemaV1InferInput = NonNullable[\"input\"];\ntype StandardSchemaV1InferOutput = NonNullable[\"output\"];\ninterface PluginRpcMethodContract {\n readonly input: InputSchema;\n readonly output: OutputSchema;\n}\ntype PluginRpcContract = Readonly>;\ntype PluginRpcHandlers = {\n [Method in keyof Contract]: (input: StandardSchemaV1InferOutput) => StandardSchemaV1InferInput | Promise>;\n};\ntype PluginRpcCallInput = StandardSchemaV1InferInput;\ntype PluginRpcCallArgs = null extends PluginRpcCallInput ? [input?: PluginRpcCallInput] : [input: PluginRpcCallInput];\ntype PluginRpcResult = StandardSchemaV1InferOutput;\n\n/**\n * A value that survives a JSON round trip without coercion or data loss.\n *\n * Host boundaries still validate values at runtime because TypeScript cannot\n * exclude non-finite numbers and plugin bundles can bypass static types.\n */\ntype JsonValue = string | number | boolean | null | JsonValue[] | {\n [key: string]: JsonValue;\n};\n\n/**\n * The `@bb/plugin-sdk/app` contract (plugin design ยง5.2) โ€” pure types with no\n * side effects. The BB app imports these to keep its real implementation in\n * sync (`satisfies PluginSdkApp`). Plugin authors import the same shapes through\n * `@bb/plugin-sdk/app`.\n *\n * Per-slot props are versioned contracts: additive-only within an SDK major.\n */\n/** Props passed to a `homepageSection` component. */\ninterface PluginHomepageSectionProps {\n /** Project in view on the compose surface; null when none is selected. */\n projectId: string | null;\n}\n/**\n * Props passed to a `settingsSection` component.\n *\n * Deliberately empty in V1; versioned additive like the other slot props.\n */\ninterface PluginSettingsSectionProps {\n}\n/** Props passed to a `navPanel` component (it owns its whole route). */\ninterface PluginNavPanelProps {\n /**\n * The route remainder after the panel root, \"\" at the root. The panel's\n * route is `/plugins///*`, so a deep link like\n * `/plugins/notes/notes/work/ideas.md` renders the panel with\n * `subPath: \"work/ideas.md\"`. Navigate within the panel via\n * `useBbNavigate().toPluginPanel(path, { subPath })` โ€” browser\n * back/forward then walks panel-internal history.\n */\n subPath: string;\n}\n/** Props passed to a panel tab opened by a `threadPanelAction`. */\ninterface PluginThreadPanelProps {\n threadId: string;\n /**\n * The JSON value the action's `openPanel` call passed (round-tripped\n * through persistence, so the tab restores across reloads); null when the\n * action opened the panel without params.\n */\n params: JsonValue | null;\n}\ninterface PluginPendingInteractionView {\n id: string;\n threadId: string;\n title: string;\n payload: JsonValue;\n createdAt: number;\n expiresAt: number | null;\n}\ninterface PluginPendingInteractionProps {\n interaction: PluginPendingInteractionView;\n submit(value: JsonValue): Promise;\n cancel(): Promise;\n}\n/**\n * Props for a `sidebarFooterAction` โ€” host-rendered (no plugin component).\n * Deliberately empty; the registration's `run` carries the behavior.\n */\ninterface PluginSidebarFooterActionProps {\n}\n/**\n * Where a file being opened by a `fileOpener` lives. `path` semantics follow\n * the source: workspace paths are relative to the environment's worktree,\n * thread-storage paths are relative to the thread's storage root, host paths\n * are absolute on the thread's host.\n */\ninterface PluginFileOpenerSource {\n kind: \"workspace\" | \"host\" | \"thread-storage\";\n threadId: string | null;\n environmentId: string | null;\n projectId: string | null;\n}\n/** Props passed to a `fileOpener` component (rendered as a panel file tab). */\ninterface PluginFileOpenerProps {\n path: string;\n source: PluginFileOpenerSource;\n}\n/**\n * Message context passed to a `messageDirective` component โ€” the assistant\n * (or nested agent) message that contained the directive.\n */\ninterface PluginMessageDirectiveMessage {\n id: string;\n threadId: string;\n turnId: string | null;\n projectId: string | null;\n}\n/**\n * Open a worktree-relative file in the host's workspace file viewer. Returns\n * true when the host accepted the path; false when the path is invalid or the\n * viewer declined it.\n */\ntype PluginMessageDirectiveOpenWorkspaceFile = (path: string) => boolean;\n/**\n * Props passed to a `messageDirective` component. Attributes are untrusted\n * strings parsed from the directive; the plugin validates its own fields.\n */\ninterface PluginMessageDirectiveProps {\n /** Parsed, untrusted directive attributes (e.g. `{ file: \"demo.html\" }`). */\n attributes: Readonly>;\n /** Original directive source text (useful for diagnostics / crash fallback). */\n source: string;\n message: PluginMessageDirectiveMessage;\n /**\n * Opens a worktree-relative file in the host's workspace file viewer. Null\n * when the message surface has no workspace viewer available.\n */\n openWorkspaceFile: PluginMessageDirectiveOpenWorkspaceFile | null;\n}\ninterface PluginHomepageSectionRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n title: string;\n component: ComponentType;\n}\ninterface PluginSettingsSectionRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Optional host-rendered section heading. */\n title?: string;\n /**\n * Optional one-line host-rendered subheading under `title`, in the built-in\n * SettingsSection idiom (ignored when `title` is absent).\n */\n description?: string;\n component: ComponentType;\n}\ninterface PluginNavPanelRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n title: string;\n /** Icon hint (BB icon name); unknown names fall back to a generic icon. */\n icon: string;\n /** URL segment under `/plugins//`; letters, digits, `-`, `_`. */\n path: string;\n component: ComponentType;\n /**\n * Optional component rendered on the right side of the shared title bar\n * (e.g. a sync button or a count). Contained separately from the body: a\n * throwing headerContent is hidden without breaking the title bar.\n */\n headerContent?: ComponentType;\n}\n/** Context handed to a `threadPanelAction`'s `run`. */\ninterface PluginThreadPanelActionContext {\n /** The thread whose panel launcher invoked the action. */\n threadId: string;\n /**\n * Open a tab in the thread's side panel rendering this action's\n * `component`. `title` labels the tab (default: the action's `title`);\n * `params` must be JSON-serializable โ€” it is persisted with the tab and\n * reaches the component as its `params` prop. Opening with params\n * identical to an already-open tab of this action focuses that tab\n * (updating its title) instead of duplicating it. May be called more than\n * once (different params โ‡’ multiple tabs) or not at all.\n */\n openPanel(options?: {\n title?: string;\n params?: JsonValue;\n }): void;\n}\ninterface PluginThreadPanelActionRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Label of the action row in the panel's new-tab launcher. */\n title: string;\n /**\n * Icon hint (BB icon name) used when the plugin ships no logo; the\n * launcher row and opened tabs prefer the plugin's logo.\n */\n icon?: string;\n /** Rendered inside every panel tab this action opens. */\n component: ComponentType;\n /**\n * How the host frames the tab content. \"padded\" (default) wraps the\n * component in the panel's scroll container with standard padding โ€”\n * right for document-like content. \"flush\" gives the component the full\n * tab area (no padding, definite height, no host scrolling) โ€” right for\n * app-like content that manages its own layout, such as\n * `experimental_ThreadChat`.\n */\n layout?: \"padded\" | \"flush\";\n /**\n * Runs when the user activates the action: call your RPC methods, show a\n * toast, and/or open panel tabs via `context.openPanel`. Omitted =\n * immediately open a panel tab with defaults. Errors (sync or async) are\n * contained and logged; they never break the launcher.\n */\n run?(context: PluginThreadPanelActionContext): void | Promise;\n}\ninterface PluginPendingInteractionRegistration {\n /** Matches `rendererId` passed to `bb.ui.requestInput`. */\n id: string;\n component: ComponentType;\n}\n/** Context handed to a `sidebarFooterAction`'s `run`. */\ninterface PluginSidebarFooterActionContext {\n /**\n * Navigate to this plugin's detail page in Tools, where declarative settings\n * and `settingsSection` slots render.\n */\n openSettings(): void;\n}\n/**\n * An icon button in the app sidebar footer (next to Settings / bug report).\n * Host-rendered for consistent chrome โ€” plugins supply icon, label, and\n * `run` behavior only.\n */\ninterface PluginSidebarFooterActionRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Tooltip and accessible label for the icon button. */\n title: string;\n /** Icon hint (BB icon name); unknown names fall back to a generic icon. */\n icon: string;\n /**\n * Runs when the user activates the action (e.g. call `openSettings()`,\n * open a panel via other surfaces, toast). Errors (sync or async) are\n * contained and logged; they never break the sidebar.\n */\n run(context: PluginSidebarFooterActionContext): void | Promise;\n}\n/**\n * Register this plugin as a viewer/editor for file extensions. The user\n * picks (and can set as default) an opener per extension via the file tab's\n * \"Open with\" menu; matching files opened in the panel then render\n * `component` in a plugin tab instead of the built-in preview. Applies to\n * working-tree, host, and thread-storage files โ€” never to git-ref snapshots\n * (diff views always use the built-in preview). The built-in preview stays\n * one menu click away, and a missing/disabled opener falls back to it.\n */\ninterface PluginFileOpenerRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Label in the \"Open with\" menu (e.g. \"Notes editor\"). */\n title: string;\n /** Lowercase extensions without the dot (e.g. [\"md\", \"mdx\"]). */\n extensions: readonly string[];\n component: ComponentType;\n}\n/**\n * Register a leaf message directive rendered inside assistant (and nested\n * agent) message Markdown. `id` is the directive name: `inline-vis` matches\n * `::inline-vis{file=\"demo.html\"}`.\n */\ninterface PluginMessageDirectiveRegistration {\n /**\n * The directive name. Lowercase kebab-case beginning with a letter.\n */\n id: string;\n component: ComponentType;\n}\n/**\n * A narrow, stable reference to one rendered chat message โ€” NOT an internal\n * timeline row. `sourceSeqEnd` is the last source event sequence the message\n * covers, the anchor the server accepts for provider-history forks.\n */\ninterface ThreadChatMessageReference {\n id: string;\n threadId: string;\n role: \"user\" | \"assistant\";\n /** Visible text of the message. */\n text: string;\n sourceSeqEnd: number;\n}\ninterface PluginMessageActionThreadPanelOptions {\n /** A `threadPanelAction` id registered by this same plugin. */\n actionId: string;\n title?: string;\n params?: JsonValue;\n}\n/** Context handed to a `messageAction`'s `run`. */\ninterface PluginMessageActionContext {\n /** The thread whose timeline surfaced the action. */\n threadId: string;\n message: ThreadChatMessageReference;\n /**\n * Present only when the action was invoked from the text-selection menu;\n * the exact text the user highlighted inside `message`.\n */\n selectedText?: string;\n /**\n * Open one of this plugin's `threadPanelAction` components in the current\n * thread's side panel โ€” the registration-callback equivalent of\n * `useBbNavigate().experimental_openThreadPanel`. Returns true when the host\n * accepted (the action id exists and the surface has a panel); false\n * otherwise.\n */\n openPanel(options: PluginMessageActionThreadPanelOptions): boolean;\n}\n/**\n * An action on chat messages: an icon button in the per-message action bar\n * (user and assistant messages) and an entry in the assistant-message\n * text-selection menu. Host-rendered chrome โ€” the plugin supplies title,\n * icon hint, and `run` behavior only.\n */\ninterface PluginMessageActionRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Tooltip / menu label for the action. */\n title: string;\n /** Icon hint (BB icon name); unknown names fall back to a generic icon. */\n icon?: string;\n /**\n * Runs when the user activates the action. Errors (sync or async) are\n * contained and logged; they never break the timeline.\n */\n run(context: PluginMessageActionContext): void | Promise;\n}\ninterface PluginAppSlots {\n homepageSection(registration: PluginHomepageSectionRegistration): void;\n settingsSection(registration: PluginSettingsSectionRegistration): void;\n navPanel(registration: PluginNavPanelRegistration): void;\n threadPanelAction(registration: PluginThreadPanelActionRegistration): void;\n pendingInteraction(registration: PluginPendingInteractionRegistration): void;\n sidebarFooterAction(registration: PluginSidebarFooterActionRegistration): void;\n fileOpener(registration: PluginFileOpenerRegistration): void;\n messageDirective(registration: PluginMessageDirectiveRegistration): void;\n experimental_messageAction(registration: PluginMessageActionRegistration): void;\n}\ninterface PluginAppComposer {\n customize(registration: ComposerCustomization): void;\n}\n/** Stable lifecycle values for one content-script instance in one bb client. */\ninterface PluginContentScriptContext {\n /** The id of the plugin that owns this script. */\n readonly pluginId: string;\n /** Monotonic per-client generation, starting at 1. */\n readonly generation: number;\n /** Aborted before cleanup begins on replacement, deactivation, or teardown. */\n readonly signal: AbortSignal;\n}\n/** Cleanup returned by a frontend content script. */\ntype PluginContentScriptDisposer = () => void | Promise;\n/**\n * Trusted same-origin JavaScript/TypeScript mounted once per active frontend\n * generation in each bb app window or browser tab.\n */\ninterface PluginContentScriptRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /**\n * Install behavior into the bb app shell. The host awaits a returned\n * promise, contains failures, and calls the returned disposer exactly once.\n */\n mount(context: PluginContentScriptContext): void | PluginContentScriptDisposer | Promise;\n}\n/** Experimental lifecycle surface for trusted frontend content scripts. */\ninterface PluginAppContentScripts {\n register(registration: PluginContentScriptRegistration): void;\n}\ninterface PluginAppBuilder {\n slots: PluginAppSlots;\n composer: PluginAppComposer;\n experimental_contentScripts: PluginAppContentScripts;\n}\ntype PluginAppSetup = (app: PluginAppBuilder) => void;\n/**\n * The opaque product of `definePluginApp` โ€” a plugin's `app.tsx` default\n * export. The host re-runs `setup` against a fresh collector on every\n * (re)interpretation, replacing that plugin's registrations wholesale.\n */\ninterface PluginAppDefinition {\n /** Brand the host checks before interpreting a bundle's default export. */\n readonly __bbPluginApp: true;\n readonly setup: PluginAppSetup;\n}\ninterface PluginRpcClient {\n /**\n * Invoke one of the plugin's `bb.rpc` methods (POST\n * /api/v1/plugins/<id>/rpc/<method>). Resolves with the method's\n * inferred output; rejects with an `Error` carrying the server's message,\n * stable `code`, and validation `issues` when present.\n */\n call>(method: Method, ...args: PluginRpcCallArgs): Promise>;\n}\ninterface PluginSettingsState {\n /**\n * Effective non-secret setting values (secret settings are excluded โ€”\n * read them server-side). Undefined while loading or unavailable.\n */\n values: Record | undefined;\n isLoading: boolean;\n}\n/** State of the app's shared realtime connection to the bb server. */\ntype PluginRealtimeConnectionState = \"connecting\" | \"connected\" | \"reconnecting\";\n/** Where `useComposer()` writes. */\ntype PluginComposerScope = {\n kind: \"thread\";\n threadId: string;\n} | {\n kind: \"queued-message\";\n threadId: string;\n queuedMessageId: string;\n} | {\n kind: \"side-chat\";\n projectId: string;\n parentThreadId: string;\n tabId: string;\n childThreadId: string | null;\n} | {\n kind: \"new-thread\";\n /** Root compose's effective selected project; null only while unresolved. */\n projectId: string | null;\n};\n/** One plugin-owned composer customization registration. */\ninterface ComposerCustomization {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Composer kinds where this customization is active; omit for all kinds. */\n scopes?: readonly PluginComposerScope[\"kind\"][];\n actions?: readonly {\n id: string;\n component: ComponentType;\n }[];\n banners?: readonly {\n id: string;\n /** Host chrome around the banner. Defaults to `\"card\"`. */\n chrome?: \"card\" | \"bare\";\n component: ComponentType;\n }[];\n plusMenu?: readonly ComposerPlusMenuItem[];\n richText?: ComposerRichTextSpec;\n}\n/** Host-rendered menu row in the composer's `+` menu. */\ninterface ComposerPlusMenuItem {\n id: string;\n label: string;\n /** BB icon name; unknown names fall back to the generic plugin icon. */\n icon?: string;\n /** Accessible description for the host-rendered row. */\n description?: string;\n disabled?: boolean | ((view: ComposerView) => boolean);\n run(context: {\n composer: PluginComposerApi;\n view: ComposerView;\n }): void | Promise;\n}\n/** Reactive read-side of the composer a plugin surface is mounted in. */\ninterface ComposerView {\n scope: PluginComposerScope;\n layout: \"expanded\" | \"compact\" | \"zen\";\n draft: {\n text: string;\n isEmpty: boolean;\n attachmentCount: number;\n };\n run: {\n isRunning: boolean;\n isSubmitting: boolean;\n };\n}\ninterface ComposerRichTextSpec {\n /** Content-derived paint: match ranges receive `className`; text is never mutated. */\n effects?: readonly {\n id: string;\n /** Plain-text offsets into the current structured draft. */\n match(text: string): readonly {\n from: number;\n to: number;\n }[];\n className: string;\n }[];\n /** Debounced, read-only observation of the structured draft. */\n onDraftChange?(draft: ComposerStructuredDraft, view: ComposerView): void;\n}\ninterface ComposerStructuredDraft {\n text: string;\n mentions: readonly {\n from: number;\n to: number;\n provider: string;\n id: string;\n label: string;\n }[];\n}\n/** Host-rendered paint applied to the editable composer text. */\ninterface PluginComposerTextEffect {\n className: string;\n}\n/** Host-rendered status that temporarily replaces a thread's draft glyph. */\ninterface PluginComposerThreadRowStatus {\n /** BB icon-name hint; unknown names fall back to the generic plugin icon. */\n icon: string;\n /** Accessible label for the status glyph. */\n label: string;\n /**\n * Semantic host treatment for the status glyph. `running` automatically\n * shimmers; terminal `success` and `error` tones are static. Defaults to the\n * neutral tone.\n */\n tone?: \"default\" | \"running\" | \"success\" | \"error\";\n}\n/** An @-mention pill bound to one of the calling plugin's mention providers. */\ninterface PluginComposerMention {\n /** Mention provider id registered by THIS plugin via `bb.ui.registerMentionProvider`. */\n provider: string;\n /** Item id your provider's `resolve` will receive at send time. */\n id: string;\n /** Pill text shown in the composer. */\n label: string;\n}\n/**\n * Programmatic access to the chat composer draft โ€” the same shared draft the\n * built-in \"Add to chat\" affordances (file preview, diff, terminal selections)\n * write to. While a queued message is being edited, writes land in that\n * message's inline editor. In a side chat, writes land in the visible side-chat\n * draft. Otherwise, inside a thread context writes land in that thread's draft;\n * anywhere else (nav panel, homepage section) they seed the new-thread composer\n * draft, which persists until the user sends or clears it.\n */\ninterface PluginComposerApi {\n scope: PluginComposerScope;\n /** Current plain text for this composer scope. */\n readonly text: string;\n /**\n * Replace the draft's plain text. Attachments are preserved. Inline mentions\n * outside the changed range are preserved and rebased; mentions overlapped\n * by the replacement are removed because their text representation changed.\n */\n setText(next: string): void;\n /**\n * Replace the draft's plain text from the latest committed value. Uses the\n * same structured-state reconciliation as `setText`.\n */\n updateText(updater: (current: string) => string): void;\n /** Clear plain text without clearing independently attached files. */\n clear(): void;\n /**\n * Apply a host-rendered effect to this composer's editable text, or clear it.\n * Effects are scoped to the calling plugin and automatically clear when the\n * slot unmounts or its composer scope changes.\n */\n setTextEffect(effect: PluginComposerTextEffect | null): void;\n /**\n * Lock or unlock editing for this composer. Locks are scoped to the calling\n * plugin and automatically release when the slot unmounts or its composer\n * scope changes.\n */\n setInputLock(locked: boolean): void;\n /**\n * Replace this composer's thread-row draft glyph with a host-rendered status,\n * or clear it. New-thread composers have no row, so calls are a no-op.\n * Side-chat and queued side-chat scopes decorate the visible parent-thread\n * row. Status is scoped to the calling plugin and automatically clears when\n * the slot unmounts or its composer scope changes.\n */\n setThreadRowStatus(status: PluginComposerThreadRowStatus | null): void;\n /**\n * Append text to the draft as a `> ` blockquote block and focus the\n * composer. Blank text is a no-op. This is the \"reference this selection\n * in chat\" primitive.\n */\n addQuote(text: string): void;\n /**\n * Insert an @-mention pill that resolves through this plugin's mention\n * provider at send time โ€” the durable way to reference an entity whose\n * content should be fetched fresh when the message is sent.\n */\n insertMention(mention: PluginComposerMention): void;\n /** Focus the composer caret at the end of the draft. */\n focus(): void;\n}\n/**\n * A consumer-supplied action on the messages of one `ThreadChat` instance,\n * rendered in the embedded timeline's per-message action bar alongside the\n * native and slot-registered actions. Unlike the `messageAction` slot this is\n * scoped to the rendering component, not registered globally.\n */\ninterface ThreadChatMessageAction {\n /** Unique within this ThreadChat instance; letters, digits, `-`, `_`. */\n id: string;\n /** Tooltip / menu label for the action. */\n title: string;\n /** Icon hint (BB icon name); unknown names fall back to a generic icon. */\n icon?: string;\n /**\n * Message roles the action applies to. Omitted = both user and assistant\n * messages.\n */\n roles?: readonly (\"user\" | \"assistant\")[];\n /**\n * Runs when the user activates the action. Errors (sync or async) are\n * contained and logged; they never break the timeline.\n */\n run(message: ThreadChatMessageReference): void | Promise;\n}\n/**\n * Props of the host-owned `ThreadChat` component โ€” one thread's chat\n * (timeline, and for the composer variants the full send/queue/draft\n * engine), rendered by the BB app inside a plugin slot. This is the\n * deliberate exception to the no-host-components rule (ยง5.5): a stable\n * product capability, not a UI kit. Versioned additive like slot props;\n * internal timeline rows, query hooks, and prompt-box configuration are\n * deliberately not exposed.\n */\ninterface ThreadChatProps {\n threadId: string;\n /**\n * \"full\" (default) is the page presentation (centered reading width);\n * \"compact\" is the side-panel presentation; \"timeline\" renders the\n * transcript without a composer.\n */\n variant?: \"full\" | \"compact\" | \"timeline\";\n /**\n * \"contained\" (default) fills and scrolls inside a bounded parent;\n * \"document\" grows with its content and defers scrolling to the page.\n */\n layout?: \"contained\" | \"document\";\n /** Bump to focus the composer (ignored by `variant: \"timeline\"`). */\n focusRequest?: number;\n className?: string;\n /** Rendered above the conversation, scrolling with it. */\n leadingContent?: ReactNode;\n /**\n * Actions rendered in this instance's per-message action bar (see\n * {@link ThreadChatMessageAction}).\n */\n messageActions?: readonly ThreadChatMessageAction[];\n}\n/**\n * Props of the host-owned `Markdown` component โ€” bb's chat message renderer\n * (the same typography, spacing, and code styling as timeline messages).\n * Use it wherever plugin UI quotes or previews message content so it reads\n * like the rest of the chat. Like `ThreadChat`, this is a stable product\n * capability, not a UI kit; renderer internals stay private.\n */\ninterface MarkdownProps {\n /** Markdown source, rendered exactly like a chat message body. */\n content: string;\n className?: string;\n}\n/** Current app selection, derived from the route. */\ninterface BbContext {\n projectId: string | null;\n threadId: string | null;\n}\ninterface BbNavigate {\n toThread(threadId: string): void;\n toProject(projectId: string): void;\n /**\n * Navigate to one of this plugin's own nav panels by its `path`.\n * `subPath` targets a location inside the panel (the component's\n * `subPath` prop); `replace` swaps the current history entry instead of\n * pushing โ€” use it for redirects so back does not bounce.\n */\n toPluginPanel(path: string, options?: {\n subPath?: string;\n replace?: boolean;\n }): void;\n /**\n * Navigate to the root compose surface (the new-thread screen). Pass\n * `initialPrompt` to seed the composer draft and `focusPrompt` to focus the\n * composer on arrival โ€” the pairing behind \"Create via chat\" style entry\n * points that drop the user into chat with a prefilled prompt.\n */\n toCompose(options?: {\n initialPrompt?: string;\n focusPrompt?: boolean;\n }): void;\n /**\n * Open one of this plugin's registered thread-panel actions in the current\n * thread surface. Returns false when the surface has no thread side panel or\n * the action is unavailable.\n */\n experimental_openThreadPanel(options: {\n actionId: string;\n title?: string;\n params?: JsonValue;\n }): boolean;\n}\n/**\n * Everything `@bb/plugin-sdk/app` resolves to at runtime. The BB app builds\n * the real implementation and `satisfies` this interface; `bb plugin build`\n * shims the specifier to that object on `globalThis.__bbPluginRuntime`.\n */\ninterface PluginSdkApp {\n definePluginApp(setup: PluginAppSetup): PluginAppDefinition;\n useRpc(): PluginRpcClient;\n useRealtime(channel: string, handler: (payload: unknown) => void): void;\n /**\n * Observe the same shared connection that delivers `useRealtime` signals.\n * Use a subsequent transition to `connected` to reconcile server state that\n * may have changed while ephemeral signals could not be delivered. The first\n * connection can transition from `connecting` and is not a reconnection.\n */\n useRealtimeConnectionState(): PluginRealtimeConnectionState;\n useSettings(): PluginSettingsState;\n useBbContext(): BbContext;\n useBbNavigate(): BbNavigate;\n useComposer(): PluginComposerApi;\n /**\n * The host-owned chat component (see {@link ThreadChatProps}). Together\n * with `Markdown`, the only components the SDK ships โ€” everything else\n * stays vendored per ยง5.5.\n */\n experimental_ThreadChat: ComponentType;\n /**\n * The host-owned chat-message markdown renderer (see\n * {@link MarkdownProps}).\n */\n experimental_Markdown: ComponentType;\n useComposerView(): ComposerView;\n}\n\ndeclare const definePluginApp: (setup: PluginAppSetup) => PluginAppDefinition;\ndeclare const experimental_ThreadChat: react.ComponentType;\ndeclare const experimental_Markdown: react.ComponentType;\ndeclare const useRpc: , StandardSchemaV1>>>>() => PluginRpcClient;\ndeclare const useRealtime: (channel: string, handler: (payload: unknown) => void) => void;\ndeclare const useRealtimeConnectionState: () => PluginRealtimeConnectionState;\ndeclare const useSettings: () => PluginSettingsState;\ndeclare const useBbContext: () => BbContext;\ndeclare const useBbNavigate: () => BbNavigate;\ndeclare const useComposer: () => PluginComposerApi;\ndeclare const useComposerView: () => ComposerView;\n\nexport { definePluginApp, experimental_Markdown, experimental_ThreadChat, useBbContext, useBbNavigate, useComposer, useComposerView, useRealtime, useRealtimeConnectionState, useRpc, useSettings };\nexport type { BbContext, BbNavigate, ComposerCustomization, ComposerPlusMenuItem, ComposerRichTextSpec, ComposerStructuredDraft, ComposerView, JsonValue, MarkdownProps, PluginAppBuilder, PluginAppComposer, PluginAppContentScripts, PluginAppDefinition, PluginAppSetup, PluginAppSlots, PluginComposerApi, PluginComposerMention, PluginComposerScope, PluginComposerTextEffect, PluginComposerThreadRowStatus, PluginContentScriptContext, PluginContentScriptDisposer, PluginContentScriptRegistration, PluginFileOpenerProps, PluginFileOpenerRegistration, PluginFileOpenerSource, PluginHomepageSectionProps, PluginHomepageSectionRegistration, PluginMessageActionContext, PluginMessageActionRegistration, PluginMessageActionThreadPanelOptions, PluginMessageDirectiveMessage, PluginMessageDirectiveOpenWorkspaceFile, PluginMessageDirectiveProps, PluginMessageDirectiveRegistration, PluginNavPanelProps, PluginNavPanelRegistration, PluginPendingInteractionProps, PluginPendingInteractionRegistration, PluginPendingInteractionView, PluginRealtimeConnectionState, PluginRpcCallArgs, PluginRpcClient, PluginRpcContract, PluginRpcError, PluginRpcErrorCode, PluginRpcHandlers, PluginRpcIssuePathSegment, PluginRpcMethodContract, PluginRpcResult, PluginRpcValidationIssue, PluginSdkApp, PluginSettingsSectionProps, PluginSettingsSectionRegistration, PluginSettingsState, PluginSidebarFooterActionContext, PluginSidebarFooterActionProps, PluginSidebarFooterActionRegistration, PluginThreadPanelActionContext, PluginThreadPanelActionRegistration, PluginThreadPanelProps, StandardSchemaV1, StandardSchemaV1InferInput, StandardSchemaV1InferOutput, StandardSchemaV1Issue, StandardSchemaV1Result, ThreadChatMessageAction, ThreadChatMessageReference, ThreadChatProps };\n"; +export const PLUGIN_SDK_APP_DTS = "// Portable type declarations for `@bb/plugin-sdk`. Unpublished BB\n// workspace contracts are flattened; public subpaths may reuse the\n// package root without requiring any other @bb/* package.\n//\n// Confused by the API, or need a symbol that isn't here? Clone the BB repo\n// and read the real source: https://github.com/ymichael/bb\n\nimport * as react from 'react';\nimport { ComponentType, ReactNode } from 'react';\n\n/** A JSON-safe path segment reported by a Standard Schema validation issue. */\ntype PluginRpcIssuePathSegment = string | number;\n/** Validator-neutral validation detail carried by an RPC error envelope. */\ninterface PluginRpcValidationIssue {\n message: string;\n path?: PluginRpcIssuePathSegment[];\n}\n/** Stable wire error categories for plugin RPC. */\ntype PluginRpcErrorCode = \"invalid_json\" | \"invalid_input\" | \"handler_error\" | \"invalid_output\" | \"non_json_result\" | \"unknown_method\";\n/** Structured RPC failure returned as `{ ok: false, error }`. */\ninterface PluginRpcError {\n code: PluginRpcErrorCode;\n message: string;\n issues?: PluginRpcValidationIssue[];\n}\n/**\n * The validator-neutral subset of Standard Schema v1 used by plugin RPC.\n * Zod 4 schemas implement this interface directly; other validators can do\n * the same without becoming part of BB's public protocol.\n */\ninterface StandardSchemaV1 {\n readonly \"~standard\": {\n readonly version: 1;\n readonly vendor: string;\n readonly validate: (value: unknown) => StandardSchemaV1Result | Promise>;\n readonly types?: {\n readonly input: Input;\n readonly output: Output;\n };\n };\n}\ntype StandardSchemaV1Result = {\n readonly value: Output;\n readonly issues?: undefined;\n} | {\n readonly issues: readonly StandardSchemaV1Issue[];\n};\ninterface StandardSchemaV1Issue {\n readonly message: string;\n readonly path?: PropertyKey | readonly (PropertyKey | {\n readonly key: PropertyKey;\n })[];\n}\ntype StandardSchemaV1InferInput = NonNullable[\"input\"];\ntype StandardSchemaV1InferOutput = NonNullable[\"output\"];\ninterface PluginRpcMethodContract {\n readonly input: InputSchema;\n readonly output: OutputSchema;\n}\ntype PluginRpcContract = Readonly>;\ntype PluginRpcHandlers = {\n [Method in keyof Contract]: (input: StandardSchemaV1InferOutput) => StandardSchemaV1InferInput | Promise>;\n};\ntype PluginRpcCallInput = StandardSchemaV1InferInput;\ntype PluginRpcCallArgs = null extends PluginRpcCallInput ? [input?: PluginRpcCallInput] : [input: PluginRpcCallInput];\ntype PluginRpcResult = StandardSchemaV1InferOutput;\n\n/**\n * A value that survives a JSON round trip without coercion or data loss.\n *\n * Host boundaries still validate values at runtime because TypeScript cannot\n * exclude non-finite numbers and plugin bundles can bypass static types.\n */\ntype JsonValue = string | number | boolean | null | JsonValue[] | {\n [key: string]: JsonValue;\n};\n\n/**\n * The `@bb/plugin-sdk/app` contract (plugin design ยง5.2) โ€” pure types with no\n * side effects. The BB app imports these to keep its real implementation in\n * sync (`satisfies PluginSdkApp`). Plugin authors import the same shapes through\n * `@bb/plugin-sdk/app`.\n *\n * Per-slot props are versioned contracts: additive-only within an SDK major.\n */\n/** Props passed to a `homepageSection` component. */\ninterface PluginHomepageSectionProps {\n /** Project in view on the compose surface; null when none is selected. */\n projectId: string | null;\n}\n/**\n * Props passed to a `settingsSection` component.\n *\n * Deliberately empty in V1; versioned additive like the other slot props.\n */\ninterface PluginSettingsSectionProps {\n}\n/** Props passed to a `navPanel` component (it owns its whole route). */\ninterface PluginNavPanelProps {\n /**\n * The route remainder after the panel root, \"\" at the root. The panel's\n * route is `/plugins///*`, so a deep link like\n * `/plugins/notes/notes/work/ideas.md` renders the panel with\n * `subPath: \"work/ideas.md\"`. Navigate within the panel via\n * `useBbNavigate().toPluginPanel(path, { subPath })` โ€” browser\n * back/forward then walks panel-internal history.\n */\n subPath: string;\n}\n/** Props passed to a panel tab opened by a `threadPanelAction`. */\ninterface PluginThreadPanelProps {\n threadId: string;\n /**\n * The JSON value the action's `openPanel` call passed (round-tripped\n * through persistence, so the tab restores across reloads); null when the\n * action opened the panel without params.\n */\n params: JsonValue | null;\n /**\n * Reveal a native user or assistant conversation message in this panel's\n * thread. The host loads older history and expands containing groups as\n * needed, centers the stable row, and resolves only after its canonical\n * prose root mounts. A message from another thread is reported as missing.\n */\n experimental_revealMessage(messageId: string): Promise<\"revealed\" | \"missing\">;\n}\ninterface PluginPendingInteractionView {\n id: string;\n threadId: string;\n title: string;\n payload: JsonValue;\n createdAt: number;\n expiresAt: number | null;\n}\ninterface PluginPendingInteractionProps {\n interaction: PluginPendingInteractionView;\n submit(value: JsonValue): Promise;\n cancel(): Promise;\n}\n/**\n * Props for a `sidebarFooterAction` โ€” host-rendered (no plugin component).\n * Deliberately empty; the registration's `run` carries the behavior.\n */\ninterface PluginSidebarFooterActionProps {\n}\n/**\n * Where a file being opened by a `fileOpener` lives. `path` semantics follow\n * the source: workspace paths are relative to the environment's worktree,\n * thread-storage paths are relative to the thread's storage root, host paths\n * are absolute on the thread's host.\n */\ninterface PluginFileOpenerSource {\n kind: \"workspace\" | \"host\" | \"thread-storage\";\n threadId: string | null;\n environmentId: string | null;\n projectId: string | null;\n}\n/** Props passed to a `fileOpener` component (rendered as a panel file tab). */\ninterface PluginFileOpenerProps {\n path: string;\n source: PluginFileOpenerSource;\n}\n/**\n * Message context passed to a `messageDirective` component โ€” the assistant\n * (or nested agent) message that contained the directive.\n */\ninterface PluginMessageDirectiveMessage {\n id: string;\n threadId: string;\n turnId: string | null;\n projectId: string | null;\n}\n/**\n * Open a worktree-relative file in the host's workspace file viewer. Returns\n * true when the host accepted the path; false when the path is invalid or the\n * viewer declined it.\n */\ntype PluginMessageDirectiveOpenWorkspaceFile = (path: string) => boolean;\n/**\n * Props passed to a `messageDirective` component. Attributes are untrusted\n * strings parsed from the directive; the plugin validates its own fields.\n */\ninterface PluginMessageDirectiveProps {\n /** Parsed, untrusted directive attributes (e.g. `{ file: \"demo.html\" }`). */\n attributes: Readonly>;\n /** Original directive source text (useful for diagnostics / crash fallback). */\n source: string;\n message: PluginMessageDirectiveMessage;\n /**\n * Opens a worktree-relative file in the host's workspace file viewer. Null\n * when the message surface has no workspace viewer available.\n */\n openWorkspaceFile: PluginMessageDirectiveOpenWorkspaceFile | null;\n}\ninterface PluginHomepageSectionRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n title: string;\n component: ComponentType;\n}\ninterface PluginSettingsSectionRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Optional host-rendered section heading. */\n title?: string;\n /**\n * Optional one-line host-rendered subheading under `title`, in the built-in\n * SettingsSection idiom (ignored when `title` is absent).\n */\n description?: string;\n component: ComponentType;\n}\ninterface PluginNavPanelRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n title: string;\n /** Icon hint (BB icon name); unknown names fall back to a generic icon. */\n icon: string;\n /** URL segment under `/plugins//`; letters, digits, `-`, `_`. */\n path: string;\n component: ComponentType;\n /**\n * Optional component rendered on the right side of the shared title bar\n * (e.g. a sync button or a count). Contained separately from the body: a\n * throwing headerContent is hidden without breaking the title bar.\n */\n headerContent?: ComponentType;\n}\n/** Context handed to a `threadPanelAction`'s `run`. */\ninterface PluginThreadPanelActionContext {\n /** The thread whose panel launcher invoked the action. */\n threadId: string;\n /**\n * Open a tab in the thread's side panel rendering this action's\n * `component`. `title` labels the tab (default: the action's `title`);\n * `params` must be JSON-serializable โ€” it is persisted with the tab and\n * reaches the component as its `params` prop. Opening with params\n * identical to an already-open tab of this action focuses that tab\n * (updating its title) instead of duplicating it. May be called more than\n * once (different params โ‡’ multiple tabs) or not at all.\n */\n openPanel(options?: {\n title?: string;\n params?: JsonValue;\n }): void;\n}\ninterface PluginThreadPanelActionRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Label of the action row in the panel's new-tab launcher. */\n title: string;\n /**\n * Icon hint (BB icon name) used when the plugin ships no logo; the\n * launcher row and opened tabs prefer the plugin's logo.\n */\n icon?: string;\n /** Rendered inside every panel tab this action opens. */\n component: ComponentType;\n /**\n * How the host frames the tab content. \"padded\" (default) wraps the\n * component in the panel's scroll container with standard padding โ€”\n * right for document-like content. \"flush\" gives the component the full\n * tab area (no padding, definite height, no host scrolling) โ€” right for\n * app-like content that manages its own layout, such as\n * `experimental_ThreadChat`.\n */\n layout?: \"padded\" | \"flush\";\n /**\n * Runs when the user activates the action: call your RPC methods, show a\n * toast, and/or open panel tabs via `context.openPanel`. Omitted =\n * immediately open a panel tab with defaults. Errors (sync or async) are\n * contained and logged; they never break the launcher.\n */\n run?(context: PluginThreadPanelActionContext): void | Promise;\n}\ninterface PluginPendingInteractionRegistration {\n /** Matches `rendererId` passed to `bb.ui.requestInput`. */\n id: string;\n component: ComponentType;\n}\n/** Context handed to a `sidebarFooterAction`'s `run`. */\ninterface PluginSidebarFooterActionContext {\n /**\n * Navigate to this plugin's detail page in Tools, where declarative settings\n * and `settingsSection` slots render.\n */\n openSettings(): void;\n}\n/**\n * An icon button in the app sidebar footer (next to Settings / bug report).\n * Host-rendered for consistent chrome โ€” plugins supply icon, label, and\n * `run` behavior only.\n */\ninterface PluginSidebarFooterActionRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Tooltip and accessible label for the icon button. */\n title: string;\n /** Icon hint (BB icon name); unknown names fall back to a generic icon. */\n icon: string;\n /**\n * Runs when the user activates the action (e.g. call `openSettings()`,\n * open a panel via other surfaces, toast). Errors (sync or async) are\n * contained and logged; they never break the sidebar.\n */\n run(context: PluginSidebarFooterActionContext): void | Promise;\n}\n/**\n * Register this plugin as a viewer/editor for file extensions. The user\n * picks (and can set as default) an opener per extension via the file tab's\n * \"Open with\" menu; matching files opened in the panel then render\n * `component` in a plugin tab instead of the built-in preview. Applies to\n * working-tree, host, and thread-storage files โ€” never to git-ref snapshots\n * (diff views always use the built-in preview). The built-in preview stays\n * one menu click away, and a missing/disabled opener falls back to it.\n */\ninterface PluginFileOpenerRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Label in the \"Open with\" menu (e.g. \"Notes editor\"). */\n title: string;\n /** Lowercase extensions without the dot (e.g. [\"md\", \"mdx\"]). */\n extensions: readonly string[];\n component: ComponentType;\n}\n/**\n * Register a leaf message directive rendered inside assistant (and nested\n * agent) message Markdown. `id` is the directive name: `inline-vis` matches\n * `::inline-vis{file=\"demo.html\"}`.\n */\ninterface PluginMessageDirectiveRegistration {\n /**\n * The directive name. Lowercase kebab-case beginning with a letter.\n */\n id: string;\n component: ComponentType;\n}\n/**\n * A narrow, stable reference to one rendered chat message โ€” NOT an internal\n * timeline row. `sourceSeqEnd` is the last source event sequence the message\n * covers, the anchor the server accepts for provider-history forks.\n */\ninterface ThreadChatMessageReference {\n id: string;\n threadId: string;\n role: \"user\" | \"assistant\";\n /** Visible text of the message. */\n text: string;\n sourceSeqEnd: number;\n}\ninterface PluginMessageActionThreadPanelOptions {\n /** A `threadPanelAction` id registered by this same plugin. */\n actionId: string;\n title?: string;\n params?: JsonValue;\n}\n/** Where a plugin message action is rendered by host chrome. */\ntype experimental_PluginMessageActionPlacement = \"action-bar\" | \"selection-menu\";\n/**\n * A stable rendered-text selector captured inside one canonical message prose\n * root. Offsets index the concatenation of descendant DOM text nodes in DOM\n * order and therefore survive Markdown element boundaries.\n */\ninterface experimental_PluginRenderedTextSelection {\n version: 1;\n coordinateSpace: \"rendered-text-utf16\";\n start: number;\n end: number;\n exact: string;\n /** At most 32 UTF-16 code units, never ending inside a surrogate pair. */\n prefix: string;\n /** At most 32 UTF-16 code units, never starting inside a surrogate pair. */\n suffix: string;\n /** Viewport-relative line-fragment rectangles for the captured range. */\n rects: readonly {\n x: number;\n y: number;\n width: number;\n height: number;\n }[];\n}\n/** Context handed to a `messageAction`'s `run`. */\ninterface PluginMessageActionContext {\n /** The thread whose timeline surfaced the action. */\n threadId: string;\n message: ThreadChatMessageReference;\n /**\n * Present only when the action was invoked from the text-selection menu;\n * the exact text the user highlighted inside `message`.\n */\n selectedText?: string;\n /**\n * Present with `selectedText` for selection-menu invocations. Omitted for\n * action-bar invocations. `experimental_selection.exact` always equals\n * `selectedText`.\n */\n experimental_selection?: experimental_PluginRenderedTextSelection;\n /**\n * Open one of this plugin's `threadPanelAction` components in the current\n * thread's side panel โ€” the registration-callback equivalent of\n * `useBbNavigate().experimental_openThreadPanel`. Returns true when the host\n * accepted (the action id exists and the surface has a panel); false\n * otherwise.\n */\n openPanel(options: PluginMessageActionThreadPanelOptions): boolean;\n}\n/**\n * An action on chat messages: an icon button in the per-message action bar\n * (user and assistant messages) and an entry in the assistant-message\n * text-selection menu. Host-rendered chrome โ€” the plugin supplies title,\n * icon hint, and `run` behavior only.\n */\ninterface PluginMessageActionRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Tooltip / menu label for the action. */\n title: string;\n /** Icon hint (BB icon name); unknown names fall back to a generic icon. */\n icon?: string;\n /**\n * Host placements where the action appears. Omission preserves the legacy\n * behavior of rendering in both the per-message action bar and the floating\n * selection menu.\n */\n experimental_placements?: readonly experimental_PluginMessageActionPlacement[];\n /**\n * Runs when the user activates the action. Errors (sync or async) are\n * contained and logged; they never break the timeline.\n */\n run(context: PluginMessageActionContext): void | Promise;\n}\ninterface PluginAppSlots {\n homepageSection(registration: PluginHomepageSectionRegistration): void;\n settingsSection(registration: PluginSettingsSectionRegistration): void;\n navPanel(registration: PluginNavPanelRegistration): void;\n threadPanelAction(registration: PluginThreadPanelActionRegistration): void;\n pendingInteraction(registration: PluginPendingInteractionRegistration): void;\n sidebarFooterAction(registration: PluginSidebarFooterActionRegistration): void;\n fileOpener(registration: PluginFileOpenerRegistration): void;\n messageDirective(registration: PluginMessageDirectiveRegistration): void;\n experimental_messageAction(registration: PluginMessageActionRegistration): void;\n}\ninterface PluginAppComposer {\n customize(registration: ComposerCustomization): void;\n}\n/** Stable lifecycle values for one content-script instance in one bb client. */\ninterface PluginContentScriptContext {\n /** The id of the plugin that owns this script. */\n readonly pluginId: string;\n /** Monotonic per-client generation, starting at 1. */\n readonly generation: number;\n /** Aborted before cleanup begins on replacement, deactivation, or teardown. */\n readonly signal: AbortSignal;\n /** Plugin-scoped schema-validated RPC transport. */\n readonly experimental_rpc: PluginRpcClient;\n /** Plugin-scoped realtime signals and shared socket lifecycle. */\n readonly experimental_realtime: {\n subscribe(channel: string, handler: (payload: unknown) => void): PluginContentScriptDisposer;\n getConnectionState(): PluginRealtimeConnectionState;\n subscribeConnectionState(handler: (state: PluginRealtimeConnectionState) => void): PluginContentScriptDisposer;\n };\n /** Imperative navigation available outside a React slot. */\n readonly experimental_navigate: Pick;\n}\n/** Cleanup returned by a frontend content script. */\ntype PluginContentScriptDisposer = () => void | Promise;\n/**\n * Trusted same-origin JavaScript/TypeScript mounted once per active frontend\n * generation in each bb app window or browser tab.\n */\ninterface PluginContentScriptRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /**\n * Install behavior into the bb app shell. The host awaits a returned\n * promise, contains failures, and calls the returned disposer exactly once.\n */\n mount(context: PluginContentScriptContext): void | PluginContentScriptDisposer | Promise;\n}\n/** Experimental lifecycle surface for trusted frontend content scripts. */\ninterface PluginAppContentScripts {\n register(registration: PluginContentScriptRegistration): void;\n}\ninterface PluginAppBuilder {\n slots: PluginAppSlots;\n composer: PluginAppComposer;\n experimental_contentScripts: PluginAppContentScripts;\n}\ntype PluginAppSetup = (app: PluginAppBuilder) => void;\n/**\n * The opaque product of `definePluginApp` โ€” a plugin's `app.tsx` default\n * export. The host re-runs `setup` against a fresh collector on every\n * (re)interpretation, replacing that plugin's registrations wholesale.\n */\ninterface PluginAppDefinition {\n /** Brand the host checks before interpreting a bundle's default export. */\n readonly __bbPluginApp: true;\n readonly setup: PluginAppSetup;\n}\ninterface PluginRpcClient {\n /**\n * Invoke one of the plugin's `bb.rpc` methods (POST\n * /api/v1/plugins/<id>/rpc/<method>). Resolves with the method's\n * inferred output; rejects with an `Error` carrying the server's message,\n * stable `code`, and validation `issues` when present.\n */\n call>(method: Method, ...args: PluginRpcCallArgs): Promise>;\n}\ninterface PluginSettingsState {\n /**\n * Effective non-secret setting values (secret settings are excluded โ€”\n * read them server-side). Undefined while loading or unavailable.\n */\n values: Record | undefined;\n isLoading: boolean;\n}\n/** State of the app's shared realtime connection to the bb server. */\ntype PluginRealtimeConnectionState = \"connecting\" | \"connected\" | \"reconnecting\";\n/** Where `useComposer()` writes. */\ntype PluginComposerScope = {\n kind: \"thread\";\n threadId: string;\n} | {\n kind: \"queued-message\";\n threadId: string;\n queuedMessageId: string;\n} | {\n kind: \"side-chat\";\n projectId: string;\n parentThreadId: string;\n tabId: string;\n childThreadId: string | null;\n} | {\n kind: \"new-thread\";\n /** Root compose's effective selected project; null only while unresolved. */\n projectId: string | null;\n};\n/** One plugin-owned composer customization registration. */\ninterface ComposerCustomization {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Composer kinds where this customization is active; omit for all kinds. */\n scopes?: readonly PluginComposerScope[\"kind\"][];\n actions?: readonly {\n id: string;\n component: ComponentType;\n }[];\n banners?: readonly {\n id: string;\n /** Host chrome around the banner. Defaults to `\"card\"`. */\n chrome?: \"card\" | \"bare\";\n component: ComponentType;\n }[];\n plusMenu?: readonly ComposerPlusMenuItem[];\n richText?: ComposerRichTextSpec;\n}\n/** Host-rendered menu row in the composer's `+` menu. */\ninterface ComposerPlusMenuItem {\n id: string;\n label: string;\n /** BB icon name; unknown names fall back to the generic plugin icon. */\n icon?: string;\n /** Accessible description for the host-rendered row. */\n description?: string;\n disabled?: boolean | ((view: ComposerView) => boolean);\n run(context: {\n composer: PluginComposerApi;\n view: ComposerView;\n }): void | Promise;\n}\n/** Reactive read-side of the composer a plugin surface is mounted in. */\ninterface ComposerView {\n scope: PluginComposerScope;\n layout: \"expanded\" | \"compact\" | \"zen\";\n draft: {\n text: string;\n isEmpty: boolean;\n attachmentCount: number;\n };\n run: {\n isRunning: boolean;\n isSubmitting: boolean;\n };\n}\ninterface ComposerRichTextSpec {\n /** Content-derived paint: match ranges receive `className`; text is never mutated. */\n effects?: readonly {\n id: string;\n /** Plain-text offsets into the current structured draft. */\n match(text: string): readonly {\n from: number;\n to: number;\n }[];\n className: string;\n }[];\n /** Debounced, read-only observation of the structured draft. */\n onDraftChange?(draft: ComposerStructuredDraft, view: ComposerView): void;\n}\ninterface ComposerStructuredDraft {\n text: string;\n mentions: readonly {\n from: number;\n to: number;\n provider: string;\n id: string;\n label: string;\n }[];\n}\n/** Host-rendered paint applied to the editable composer text. */\ninterface PluginComposerTextEffect {\n className: string;\n}\n/** Host-rendered status that temporarily replaces a thread's draft glyph. */\ninterface PluginComposerThreadRowStatus {\n /** BB icon-name hint; unknown names fall back to the generic plugin icon. */\n icon: string;\n /** Accessible label for the status glyph. */\n label: string;\n /**\n * Semantic host treatment for the status glyph. `running` automatically\n * shimmers; terminal `success` and `error` tones are static. Defaults to the\n * neutral tone.\n */\n tone?: \"default\" | \"running\" | \"success\" | \"error\";\n}\n/** An @-mention pill bound to one of the calling plugin's mention providers. */\ninterface PluginComposerMention {\n /** Mention provider id registered by THIS plugin via `bb.ui.registerMentionProvider`. */\n provider: string;\n /** Item id your provider's `resolve` will receive at send time. */\n id: string;\n /** Pill text shown in the composer. */\n label: string;\n}\n/**\n * Programmatic access to the chat composer draft โ€” the same shared draft the\n * built-in \"Add to chat\" affordances (file preview, diff, terminal selections)\n * write to. While a queued message is being edited, writes land in that\n * message's inline editor. In a side chat, writes land in the visible side-chat\n * draft. Otherwise, inside a thread context writes land in that thread's draft;\n * anywhere else (nav panel, homepage section) they seed the new-thread composer\n * draft, which persists until the user sends or clears it.\n */\ninterface PluginComposerApi {\n scope: PluginComposerScope;\n /** Current plain text for this composer scope. */\n readonly text: string;\n /**\n * Replace the draft's plain text. Attachments are preserved. Inline mentions\n * outside the changed range are preserved and rebased; mentions overlapped\n * by the replacement are removed because their text representation changed.\n */\n setText(next: string): void;\n /**\n * Replace the draft's plain text from the latest committed value. Uses the\n * same structured-state reconciliation as `setText`.\n */\n updateText(updater: (current: string) => string): void;\n /** Clear plain text without clearing independently attached files. */\n clear(): void;\n /**\n * Apply a host-rendered effect to this composer's editable text, or clear it.\n * Effects are scoped to the calling plugin and automatically clear when the\n * slot unmounts or its composer scope changes.\n */\n setTextEffect(effect: PluginComposerTextEffect | null): void;\n /**\n * Lock or unlock editing for this composer. Locks are scoped to the calling\n * plugin and automatically release when the slot unmounts or its composer\n * scope changes.\n */\n setInputLock(locked: boolean): void;\n /**\n * Replace this composer's thread-row draft glyph with a host-rendered status,\n * or clear it. New-thread composers have no row, so calls are a no-op.\n * Side-chat and queued side-chat scopes decorate the visible parent-thread\n * row. Status is scoped to the calling plugin and automatically clears when\n * the slot unmounts or its composer scope changes.\n */\n setThreadRowStatus(status: PluginComposerThreadRowStatus | null): void;\n /**\n * Append text to the draft as a `> ` blockquote block and focus the\n * composer. Blank text is a no-op. This is the \"reference this selection\n * in chat\" primitive.\n */\n addQuote(text: string): void;\n /**\n * Insert an @-mention pill that resolves through this plugin's mention\n * provider at send time โ€” the durable way to reference an entity whose\n * content should be fetched fresh when the message is sent.\n */\n insertMention(mention: PluginComposerMention): void;\n /** Focus the composer caret at the end of the draft. */\n focus(): void;\n}\n/**\n * A consumer-supplied action on the messages of one `ThreadChat` instance,\n * rendered in the embedded timeline's per-message action bar alongside the\n * native and slot-registered actions. Unlike the `messageAction` slot this is\n * scoped to the rendering component, not registered globally.\n */\ninterface ThreadChatMessageAction {\n /** Unique within this ThreadChat instance; letters, digits, `-`, `_`. */\n id: string;\n /** Tooltip / menu label for the action. */\n title: string;\n /** Icon hint (BB icon name); unknown names fall back to a generic icon. */\n icon?: string;\n /**\n * Message roles the action applies to. Omitted = both user and assistant\n * messages.\n */\n roles?: readonly (\"user\" | \"assistant\")[];\n /**\n * Runs when the user activates the action. Errors (sync or async) are\n * contained and logged; they never break the timeline.\n */\n run(message: ThreadChatMessageReference): void | Promise;\n}\n/**\n * Props of the host-owned `ThreadChat` component โ€” one thread's chat\n * (timeline, and for the composer variants the full send/queue/draft\n * engine), rendered by the BB app inside a plugin slot. This is the\n * deliberate exception to the no-host-components rule (ยง5.5): a stable\n * product capability, not a UI kit. Versioned additive like slot props;\n * internal timeline rows, query hooks, and prompt-box configuration are\n * deliberately not exposed.\n */\ninterface ThreadChatProps {\n threadId: string;\n /**\n * \"full\" (default) is the page presentation (centered reading width);\n * \"compact\" is the side-panel presentation; \"timeline\" renders the\n * transcript without a composer.\n */\n variant?: \"full\" | \"compact\" | \"timeline\";\n /**\n * \"contained\" (default) fills and scrolls inside a bounded parent;\n * \"document\" grows with its content and defers scrolling to the page.\n */\n layout?: \"contained\" | \"document\";\n /** Bump to focus the composer (ignored by `variant: \"timeline\"`). */\n focusRequest?: number;\n className?: string;\n /** Rendered above the conversation, scrolling with it. */\n leadingContent?: ReactNode;\n /**\n * Actions rendered in this instance's per-message action bar (see\n * {@link ThreadChatMessageAction}).\n */\n messageActions?: readonly ThreadChatMessageAction[];\n}\n/**\n * Props of the host-owned `Markdown` component โ€” bb's chat message renderer\n * (the same typography, spacing, and code styling as timeline messages).\n * Use it wherever plugin UI quotes or previews message content so it reads\n * like the rest of the chat. Like `ThreadChat`, this is a stable product\n * capability, not a UI kit; renderer internals stay private.\n */\ninterface MarkdownProps {\n /** Markdown source, rendered exactly like a chat message body. */\n content: string;\n className?: string;\n}\n/** Current app selection, derived from the route. */\ninterface BbContext {\n projectId: string | null;\n threadId: string | null;\n}\ninterface BbNavigate {\n toThread(threadId: string): void;\n toProject(projectId: string): void;\n /**\n * Navigate to one of this plugin's own nav panels by its `path`.\n * `subPath` targets a location inside the panel (the component's\n * `subPath` prop); `replace` swaps the current history entry instead of\n * pushing โ€” use it for redirects so back does not bounce.\n */\n toPluginPanel(path: string, options?: {\n subPath?: string;\n replace?: boolean;\n }): void;\n /**\n * Navigate to the root compose surface (the new-thread screen). Pass\n * `initialPrompt` to seed the composer draft and `focusPrompt` to focus the\n * composer on arrival โ€” the pairing behind \"Create via chat\" style entry\n * points that drop the user into chat with a prefilled prompt.\n */\n toCompose(options?: {\n initialPrompt?: string;\n focusPrompt?: boolean;\n }): void;\n /**\n * Open one of this plugin's registered thread-panel actions in the current\n * thread surface. Returns false when the surface has no thread side panel or\n * the action is unavailable.\n */\n experimental_openThreadPanel(options: {\n actionId: string;\n title?: string;\n params?: JsonValue;\n }): boolean;\n}\n/**\n * Everything `@bb/plugin-sdk/app` resolves to at runtime. The BB app builds\n * the real implementation and `satisfies` this interface; `bb plugin build`\n * shims the specifier to that object on `globalThis.__bbPluginRuntime`.\n */\ninterface PluginSdkApp {\n definePluginApp(setup: PluginAppSetup): PluginAppDefinition;\n useRpc(): PluginRpcClient;\n useRealtime(channel: string, handler: (payload: unknown) => void): void;\n /**\n * Observe the same shared connection that delivers `useRealtime` signals.\n * Use a subsequent transition to `connected` to reconcile server state that\n * may have changed while ephemeral signals could not be delivered. The first\n * connection can transition from `connecting` and is not a reconnection.\n */\n useRealtimeConnectionState(): PluginRealtimeConnectionState;\n useSettings(): PluginSettingsState;\n useBbContext(): BbContext;\n useBbNavigate(): BbNavigate;\n useComposer(): PluginComposerApi;\n /**\n * The host-owned chat component (see {@link ThreadChatProps}). Together\n * with `Markdown`, the only components the SDK ships โ€” everything else\n * stays vendored per ยง5.5.\n */\n experimental_ThreadChat: ComponentType;\n /**\n * The host-owned chat-message markdown renderer (see\n * {@link MarkdownProps}).\n */\n experimental_Markdown: ComponentType;\n useComposerView(): ComposerView;\n}\n\ndeclare const definePluginApp: (setup: PluginAppSetup) => PluginAppDefinition;\ndeclare const experimental_ThreadChat: react.ComponentType;\ndeclare const experimental_Markdown: react.ComponentType;\ndeclare const useRpc: , StandardSchemaV1>>>>() => PluginRpcClient;\ndeclare const useRealtime: (channel: string, handler: (payload: unknown) => void) => void;\ndeclare const useRealtimeConnectionState: () => PluginRealtimeConnectionState;\ndeclare const useSettings: () => PluginSettingsState;\ndeclare const useBbContext: () => BbContext;\ndeclare const useBbNavigate: () => BbNavigate;\ndeclare const useComposer: () => PluginComposerApi;\ndeclare const useComposerView: () => ComposerView;\n\nexport { definePluginApp, experimental_Markdown, experimental_ThreadChat, useBbContext, useBbNavigate, useComposer, useComposerView, useRealtime, useRealtimeConnectionState, useRpc, useSettings };\nexport type { BbContext, BbNavigate, ComposerCustomization, ComposerPlusMenuItem, ComposerRichTextSpec, ComposerStructuredDraft, ComposerView, JsonValue, MarkdownProps, PluginAppBuilder, PluginAppComposer, PluginAppContentScripts, PluginAppDefinition, PluginAppSetup, PluginAppSlots, PluginComposerApi, PluginComposerMention, PluginComposerScope, PluginComposerTextEffect, PluginComposerThreadRowStatus, PluginContentScriptContext, PluginContentScriptDisposer, PluginContentScriptRegistration, PluginFileOpenerProps, PluginFileOpenerRegistration, PluginFileOpenerSource, PluginHomepageSectionProps, PluginHomepageSectionRegistration, PluginMessageActionContext, PluginMessageActionRegistration, PluginMessageActionThreadPanelOptions, PluginMessageDirectiveMessage, PluginMessageDirectiveOpenWorkspaceFile, PluginMessageDirectiveProps, PluginMessageDirectiveRegistration, PluginNavPanelProps, PluginNavPanelRegistration, PluginPendingInteractionProps, PluginPendingInteractionRegistration, PluginPendingInteractionView, PluginRealtimeConnectionState, PluginRpcCallArgs, PluginRpcClient, PluginRpcContract, PluginRpcError, PluginRpcErrorCode, PluginRpcHandlers, PluginRpcIssuePathSegment, PluginRpcMethodContract, PluginRpcResult, PluginRpcValidationIssue, PluginSdkApp, PluginSettingsSectionProps, PluginSettingsSectionRegistration, PluginSettingsState, PluginSidebarFooterActionContext, PluginSidebarFooterActionProps, PluginSidebarFooterActionRegistration, PluginThreadPanelActionContext, PluginThreadPanelActionRegistration, PluginThreadPanelProps, StandardSchemaV1, StandardSchemaV1InferInput, StandardSchemaV1InferOutput, StandardSchemaV1Issue, StandardSchemaV1Result, ThreadChatMessageAction, ThreadChatMessageReference, ThreadChatProps, experimental_PluginMessageActionPlacement, experimental_PluginRenderedTextSelection };\n"; diff --git a/plugins/side-chat/app.test.tsx b/plugins/side-chat/app.test.tsx index 528c2cdc9..6df8a4c93 100644 --- a/plugins/side-chat/app.test.tsx +++ b/plugins/side-chat/app.test.tsx @@ -198,7 +198,11 @@ describe("SideChatPanel", () => { it("renders ThreadChat with the ReplyingTo header and send-to-main action", () => { const slot = renderSlot( app.threadPanelActions[0]!, - { threadId: "thr_src", params }, + { + threadId: "thr_src", + params, + experimental_revealMessage: async () => "missing", + }, { rpc: {} }, ); @@ -223,7 +227,11 @@ describe("SideChatPanel", () => { const sendToMain = vi.fn(() => ({ ok: true })); const slot = renderSlot( app.threadPanelActions[0]!, - { threadId: "thr_src", params }, + { + threadId: "thr_src", + params, + experimental_revealMessage: async () => "missing", + }, { rpc: { sendToMain } }, ); @@ -243,11 +251,14 @@ describe("SideChatPanel", () => { }); }); - it("reports a missing thread reference for malformed params", () => { const slot = renderSlot( app.threadPanelActions[0]!, - { threadId: "thr_src", params: { bogus: true } }, + { + threadId: "thr_src", + params: { bogus: true }, + experimental_revealMessage: async () => "missing", + }, { rpc: {} }, ); expect(slot.getByRole("alert").textContent).toContain( diff --git a/plugins/workflows/src/app.test.tsx b/plugins/workflows/src/app.test.tsx index 161669246..51f05ffab 100644 --- a/plugins/workflows/src/app.test.tsx +++ b/plugins/workflows/src/app.test.tsx @@ -569,7 +569,11 @@ describe("workflow thread panel", () => { let stopped = false; const slot = renderSlot( app.threadPanelActions[0]!, - { threadId: "thr_origin", params: { runId: run.id } }, + { + threadId: "thr_origin", + params: { runId: run.id }, + experimental_revealMessage: async () => "missing", + }, { rpc: { workflowRunView: () => ({ @@ -614,6 +618,7 @@ describe("workflow thread panel", () => { { threadId: "thr_origin", params: { runId: run.id, unexpected: true }, + experimental_revealMessage: async () => "missing", }, { rpc: {} }, );