diff --git a/apps/app/.ladle/model-picker-query-provider.tsx b/apps/app/.ladle/model-picker-query-provider.tsx index 31ecf35b51..a11dfabdb4 100644 --- a/apps/app/.ladle/model-picker-query-provider.tsx +++ b/apps/app/.ladle/model-picker-query-provider.tsx @@ -62,6 +62,7 @@ const STORY_PROVIDER_INFOS: ProviderInfo[] = STORY_PROVIDER_OPTIONS.map( supportsServiceTier: STORY_SERVICE_TIER_SUPPORT[provider.value] ?? false, supportsUserQuestion: true, supportsFork: true, + supportsSessionImport: false, supportedPermissionModes: [...supportedPermissionModes], }, }), diff --git a/apps/app/src/hooks/useThreadCreationOptions.test.tsx b/apps/app/src/hooks/useThreadCreationOptions.test.tsx index 8ae3d2b096..e6df0f27a4 100644 --- a/apps/app/src/hooks/useThreadCreationOptions.test.tsx +++ b/apps/app/src/hooks/useThreadCreationOptions.test.tsx @@ -38,6 +38,7 @@ function executionOptionsResponse(): SystemExecutionOptionsResponse { supportsServiceTier: true, supportsUserQuestion: true, supportsFork: true, + supportsSessionImport: false, supportedPermissionModes: ["accept-edits", "auto", "full"], }, }, @@ -53,6 +54,7 @@ function executionOptionsResponse(): SystemExecutionOptionsResponse { supportsServiceTier: true, supportsUserQuestion: true, supportsFork: true, + supportsSessionImport: false, supportedPermissionModes: ["accept-edits", "auto", "full"], }, }, @@ -104,6 +106,7 @@ function claudeExecutionOptionsResponse(): SystemExecutionOptionsResponse { supportsServiceTier: true, supportsUserQuestion: true, supportsFork: true, + supportsSessionImport: false, supportedPermissionModes: ["accept-edits", "auto", "full"], }, }, diff --git a/apps/cli/src/commands/thread/import.ts b/apps/cli/src/commands/thread/import.ts new file mode 100644 index 0000000000..ebcbea12fe --- /dev/null +++ b/apps/cli/src/commands/thread/import.ts @@ -0,0 +1,86 @@ +import { Command } from "commander"; +import { threadVisibilitySchema, type Thread } from "@bb/domain"; +import { action } from "../../action.js"; +import { createCliBbSdk } from "../../client.js"; +import { outputJson, prependErrorContext } from "../helpers.js"; +import { parsePermissionMode, PERMISSION_MODE_HELP } from "./helpers.js"; + +interface ThreadImportCommandOptions { + project: string; + provider: string; + providerSession: string; + host?: string; + cwd: string; + json?: boolean; + permissionMode?: string; + title?: string; + visibility?: string; +} + +export function registerImportCommand( + parent: Command, + getUrl: () => string, +): void { + parent + .command("import") + .description( + "Import an existing external ACP provider session as a thread", + ) + .requiredOption("--project ", "Project the imported thread belongs to") + .requiredOption( + "--provider ", + 'ACP provider that owns the session (e.g. "acp-omp")', + ) + .requiredOption( + "--provider-session ", + "External provider session ID to import", + ) + .option("--host ", "Host the session lives on (default: primary host)") + .requiredOption( + "--cwd ", + "Working directory the session ran in; must match the project source " + + "path or an existing workspace of the project", + ) + .option("--title ", "Thread title") + .option("--permission-mode <mode>", PERMISSION_MODE_HELP) + .option("--visibility <visibility>", "Thread visibility: visible or hidden") + .option("--json", "Print machine-readable JSON output") + .action( + action(async (opts: ThreadImportCommandOptions) => { + const permissionMode = parsePermissionMode(opts.permissionMode); + const visibility = + opts.visibility === undefined + ? undefined + : threadVisibilitySchema.parse(opts.visibility); + + let thread: Thread; + try { + thread = await createCliBbSdk(getUrl()).threads.import({ + projectId: opts.project, + providerId: opts.provider, + providerSessionId: opts.providerSession, + origin: "cli", + ...(opts.host === undefined ? {} : { hostId: opts.host }), + cwd: opts.cwd, + ...(opts.title === undefined ? {} : { title: opts.title }), + ...(permissionMode === undefined ? {} : { permissionMode }), + ...(visibility === undefined ? {} : { visibility }), + }); + } catch (error: unknown) { + throw prependErrorContext( + `Failed to import provider session ${opts.providerSession}`, + error, + ); + } + + if (outputJson(opts, thread)) return; + console.log(`Thread imported: ${thread.id}`); + console.log(`Provider: ${opts.provider}`); + console.log(`Provider session: ${opts.providerSession}`); + console.log(`Status: ${thread.status}`); + if (thread.visibility === "hidden") { + console.log("Visibility: hidden"); + } + }), + ); +} diff --git a/apps/cli/src/commands/thread/index.ts b/apps/cli/src/commands/thread/index.ts index 1267070867..b9463ac7f0 100644 --- a/apps/cli/src/commands/thread/index.ts +++ b/apps/cli/src/commands/thread/index.ts @@ -8,6 +8,7 @@ import { registerOrganizationCommands } from "./organization.js"; import { registerShowCommand } from "./show.js"; import { registerSpawnCommand } from "./spawn.js"; import { registerForkCommand } from "./fork.js"; +import { registerImportCommand } from "./import.js"; import { registerWaitCommand } from "./wait.js"; export function registerThreadCommands( @@ -18,6 +19,7 @@ export function registerThreadCommands( registerWaitCommand(thread, getUrl); registerSpawnCommand(thread, getUrl); registerForkCommand(thread, getUrl); + registerImportCommand(thread, getUrl); registerListCommand(thread, getUrl); registerShowCommand(thread, getUrl); registerOpenCommand(thread, getUrl); diff --git a/apps/host-daemon/src/command-dispatch-support.ts b/apps/host-daemon/src/command-dispatch-support.ts index 68f8af7853..86a4b98cde 100644 --- a/apps/host-daemon/src/command-dispatch-support.ts +++ b/apps/host-daemon/src/command-dispatch-support.ts @@ -55,6 +55,7 @@ export interface CommandDispatchOptions { }) => Promise<{ models: AvailableModel[]; selectedOnlyModels: AvailableModel[]; + supportsSessionImport?: boolean; }>; getProviderCliStatusForProvider?: ( providerId: string, @@ -121,6 +122,7 @@ export async function defaultListModels( ): Promise<{ models: AvailableModel[]; selectedOnlyModels: AvailableModel[]; + supportsSessionImport?: boolean; }> { const runtimeKey = `${options.bridgeBundleDir ?? ""}` + diff --git a/apps/host-daemon/src/command-handlers/thread.ts b/apps/host-daemon/src/command-handlers/thread.ts index e7fe31f285..df34716e2c 100644 --- a/apps/host-daemon/src/command-handlers/thread.ts +++ b/apps/host-daemon/src/command-handlers/thread.ts @@ -229,6 +229,7 @@ export async function startThread( disallowedTools: command.disallowedTools, instructionMode: command.instructionMode, ...(command.fork ? { fork: command.fork } : {}), + ...(command.sessionImport ? { sessionImport: command.sessionImport } : {}), }); return result; } catch (error) { diff --git a/apps/server/src/internal/events.ts b/apps/server/src/internal/events.ts index a133fab2b4..8a5592a10f 100644 --- a/apps/server/src/internal/events.ts +++ b/apps/server/src/internal/events.ts @@ -373,6 +373,11 @@ async function applyEventEffects( try { const event = entry.event; if (event.type === "turn/started") { + // Replayed history from an imported provider session is persisted for + // display only; it must not drive thread lifecycle transitions. + if (event.historical) { + continue; + } const turnId = requireThreadEventScopeTurnId({ type: event.type, scope: event.scope, @@ -401,6 +406,11 @@ async function applyEventEffects( } if (event.type === "turn/completed") { + // See turn/started above: imported-history frames complete with no + // turn-completion side effects. + if (event.historical) { + continue; + } const turnId = requireThreadEventScopeTurnId({ type: event.type, scope: event.scope, diff --git a/apps/server/src/routes/threads/base.ts b/apps/server/src/routes/threads/base.ts index 48a2ec01ad..923052be7d 100644 --- a/apps/server/src/routes/threads/base.ts +++ b/apps/server/src/routes/threads/base.ts @@ -44,6 +44,7 @@ import { } from "../../services/threads/thread-lifecycle.js"; import { createThreadFromRequest } from "../../services/threads/thread-create.js"; import { createThreadForkFromRequest } from "../../services/threads/thread-fork.js"; +import { createThreadImportFromRequest } from "../../services/threads/thread-import.js"; import { requireChildThreadsConfirmation } from "../../services/threads/child-thread-confirmation.js"; import { toThreadListEntryResponses, @@ -275,6 +276,11 @@ export function registerThreadBaseRoutes(app: Hono, deps: AppDeps): void { return context.json(toThreadResponseFromThread(deps, { thread }), 201); }); + post(routes.import, async (context, payload) => { + const thread = await createThreadImportFromRequest(deps, payload); + return context.json(toThreadResponseFromThread(deps, { thread }), 201); + }); + get(routes.get, (context, query) => { const thread = requirePublicThread(deps.db, context.req.param("id")); return context.json( diff --git a/apps/server/src/services/skills/builtin-skills/bb-cli/SKILL.md b/apps/server/src/services/skills/builtin-skills/bb-cli/SKILL.md index 4491817d09..57d44726c4 100644 --- a/apps/server/src/services/skills/builtin-skills/bb-cli/SKILL.md +++ b/apps/server/src/services/skills/builtin-skills/bb-cli/SKILL.md @@ -145,6 +145,16 @@ message agents, or inspect projects, providers, and environments. creates an idle fork by default; add `--prompt`, select `--workspace isolated|reuse`, or anchor with `--source-seq-end`. Permission mode inherits the source thread unless explicitly overridden. +- Use `bb thread import --project <id> --provider <acp-provider> + --provider-session <external-session-id> --cwd <path>` to import an + existing external ACP agent session (for example an `omp acp` session) as a + bb thread. The agent must support ACP `session/load`; bb replays the + session's history into the thread timeline and the thread lands idle, ready + for follow-up turns. `--cwd` is required: it is the caller's assertion of + the working directory the session ran in (bb has no way to read this back + from the external session), and must match the project source path or an + existing workspace already attached to the project — anything else is + refused. Pass `--host` when the session lives on a non-primary machine. - Pass `--visibility hidden` for background/plugin workers that should remain out of sidebar organization without contributing unread/pending favicon attention. `bb thread list` excludes them by diff --git a/apps/server/src/services/system/known-acp-agents.ts b/apps/server/src/services/system/known-acp-agents.ts index 41fecf016b..d5630ee0d8 100644 --- a/apps/server/src/services/system/known-acp-agents.ts +++ b/apps/server/src/services/system/known-acp-agents.ts @@ -1,6 +1,13 @@ import { buildAcpProviderInfo } from "@bb/agent-providers"; +import { + formatCustomAcpAgentProviderId, + type CustomAcpAgent, +} from "@bb/config/bb-app-managed-config"; import type { ProviderInfo } from "@bb/domain"; -import type { HostDaemonAcpLaunchSpec } from "@bb/host-daemon-contract"; +import { + normalizeHostDaemonAcpLaunchSpec, + type HostDaemonAcpLaunchSpec, +} from "@bb/host-daemon-contract"; export interface KnownAcpAgent extends HostDaemonAcpLaunchSpec { id: string; @@ -102,3 +109,32 @@ export function findKnownAcpAgentForProviderId( ): KnownAcpAgent | undefined { return KNOWN_ACP_AGENTS.find((agent) => agent.id === providerId); } + +export function findCustomAcpAgentForProviderId( + customAcpAgents: readonly CustomAcpAgent[], + providerId: string, +): CustomAcpAgent | undefined { + return customAcpAgents.find( + (agent) => formatCustomAcpAgentProviderId(agent.id) === providerId, + ); +} + +/** + * Resolve the launch spec exactly as thread.start does: a configured custom + * ACP agent shadows a built-in known agent that shares its provider id, and + * falls back to the static KNOWN_ACP_AGENTS entry otherwise. Callers that + * need to probe or launch an ACP agent (thread start/resume/import) must + * share this resolution so what gets probed is what actually serves the + * thread. + */ +export function buildAcpLaunchSpecForProviderId( + customAcpAgents: readonly CustomAcpAgent[], + providerId: string, +): HostDaemonAcpLaunchSpec | undefined { + const agent = findCustomAcpAgentForProviderId(customAcpAgents, providerId); + if (agent) { + return normalizeHostDaemonAcpLaunchSpec(agent); + } + const knownAgent = findKnownAcpAgentForProviderId(providerId); + return knownAgent ? normalizeHostDaemonAcpLaunchSpec(knownAgent) : undefined; +} diff --git a/apps/server/src/services/threads/parent-system-messages.ts b/apps/server/src/services/threads/parent-system-messages.ts index 60aa77bfc9..41e7c0bfe9 100644 --- a/apps/server/src/services/threads/parent-system-messages.ts +++ b/apps/server/src/services/threads/parent-system-messages.ts @@ -332,9 +332,10 @@ async function queueReadyParentSystemMessage( const command = await prepareReadyThreadTurnCommand(deps, { thread: args.thread, - // A parent system message targets an already-started thread; forking only - // happens at create time. + // A parent system message targets an already-started thread; forking and + // session import only happen at create time. fork: null, + sessionImport: null, input: args.input, requestId, execution: args.execution, diff --git a/apps/server/src/services/threads/thread-commands.ts b/apps/server/src/services/threads/thread-commands.ts index dffa56dce7..595d1481f1 100644 --- a/apps/server/src/services/threads/thread-commands.ts +++ b/apps/server/src/services/threads/thread-commands.ts @@ -10,10 +10,6 @@ import { getBuiltInAgentProviderInfo, isAgentProviderId, } from "@bb/agent-providers"; -import { - formatCustomAcpAgentProviderId, - type CustomAcpAgent, -} from "@bb/config/bb-app-managed-config"; import { DEFAULT_CLAUDE_CODE_MOCK_CLI_TRAFFIC_ENDPOINT, type ClaudeCodeMockCliTrafficConfig, @@ -28,11 +24,9 @@ import { WorkspaceProvisionType, promptInputHasCommandMention, } from "@bb/domain"; -import { - normalizeHostDaemonAcpLaunchSpec, - type HostDaemonAcpLaunchSpec, - type HostDaemonCommand, - type TurnSubmitTarget, +import type { + HostDaemonCommand, + TurnSubmitTarget, } from "@bb/host-daemon-contract"; import type { AppDeps, LoggedWorkSessionDeps } from "../../types.js"; import type { CommandResultSideEffectsDeps } from "../../internal/command-result-side-effects.js"; @@ -42,7 +36,10 @@ import { startLiveHostCommand, } from "../hosts/live-command.js"; import { getLastProviderThreadId } from "./thread-events.js"; -import type { ThreadForkDescriptor } from "./thread-provisioning-context.js"; +import type { + ThreadForkDescriptor, + ThreadSessionImportDescriptor, +} from "./thread-provisioning-context.js"; import { resolveThreadRuntimeCommandConfig, type ResolvedThreadRuntimeCommandConfig, @@ -56,7 +53,7 @@ import { } from "./thread-execution-plan.js"; import { clampPermissionModeToHost } from "../hosts/permission-ceiling.js"; import { workspaceContextFromPath } from "../environments/workspace-command-target.js"; -import { findKnownAcpAgentForProviderId } from "../system/known-acp-agents.js"; +import { buildAcpLaunchSpecForProviderId } from "../system/known-acp-agents.js"; export type ExecutionOptionsRequest = ExistingThreadExecutionInputRequest; @@ -91,6 +88,9 @@ export interface ThreadStartCommandArgs { // Non-null ⇒ clone the parent's provider session at its branch point (native // fork) instead of starting fresh. null ⇒ a normal start. fork: ThreadForkDescriptor | null; + // Non-null ⇒ bind the new thread to this existing external provider session + // (ACP session import) and replay its history. null ⇒ a normal start. + sessionImport: ThreadSessionImportDescriptor | null; permissionEscalation: PermissionEscalation; input: PromptInput[]; inputGroups?: PromptInput[][]; @@ -195,30 +195,6 @@ function providerSupportsThreadArchiveForwarding(providerId: string): boolean { return getBuiltInAgentProviderInfo(providerId).capabilities.supportsArchive; } -function findCustomAcpAgentForProviderId( - customAcpAgents: CustomAcpAgent[], - providerId: string, -): CustomAcpAgent | undefined { - return customAcpAgents.find( - (agent) => formatCustomAcpAgentProviderId(agent.id) === providerId, - ); -} - -function buildAcpLaunchSpecForProviderId( - deps: Pick<AppDeps, "config">, - providerId: string, -): HostDaemonAcpLaunchSpec | undefined { - const agent = findCustomAcpAgentForProviderId( - deps.config.customAcpAgents, - providerId, - ); - if (agent) { - return normalizeHostDaemonAcpLaunchSpec(agent); - } - const knownAgent = findKnownAcpAgentForProviderId(providerId); - return knownAgent ? normalizeHostDaemonAcpLaunchSpec(knownAgent) : undefined; -} - function resolveClaudeCodeMockCliTrafficConfig( deps: Pick<AppDeps, "db">, ): ClaudeCodeMockCliTrafficConfig { @@ -354,7 +330,10 @@ export async function buildThreadStartCommand( environment: args.environment, model: args.execution.model, }); - const acpLaunchSpec = buildAcpLaunchSpecForProviderId(deps, args.providerId); + const acpLaunchSpec = buildAcpLaunchSpecForProviderId( + deps.config.customAcpAgents, + args.providerId, + ); return { type: "thread.start", environmentId: args.environment.id, @@ -391,6 +370,7 @@ export async function buildThreadStartCommand( instructionMode: runtimeContext.instructionMode, threadStoragePath: runtimeContext.threadStoragePath, ...(args.fork ? { fork: args.fork } : {}), + ...(args.sessionImport ? { sessionImport: args.sessionImport } : {}), }; } @@ -398,7 +378,7 @@ function buildPreparedTurnSubmitCommandPayload( args: PreparedTurnSubmitCommandBuildArgs, ): PreparedTurnSubmitCommandPayload { const acpLaunchSpec = buildAcpLaunchSpecForProviderId( - args.deps, + args.deps.config.customAcpAgents, args.runtimeContext.providerId, ); return { diff --git a/apps/server/src/services/threads/thread-create-request.ts b/apps/server/src/services/threads/thread-create-request.ts index 384b147144..5f2efd817b 100644 --- a/apps/server/src/services/threads/thread-create-request.ts +++ b/apps/server/src/services/threads/thread-create-request.ts @@ -34,6 +34,13 @@ export interface ThreadCreateServiceRequestInput { providerId?: CreateThreadRequest["providerId"]; reasoningLevel?: CreateThreadRequest["reasoningLevel"]; serviceTier?: CreateThreadRequest["serviceTier"]; + /** + * Present ⇒ bind the new thread to this existing external provider session + * (ACP session import) and replay its history instead of starting fresh. + * Set only by the thread-import service; incompatible with source-derived + * creation (originKind/sourceThreadId) and requires empty input. + */ + sessionImport?: { providerThreadId: string }; sourceSeqEnd?: CreateThreadRequest["sourceSeqEnd"]; sourceThreadId?: string; startedOnBehalfOf: StartedOnBehalfOf | null; diff --git a/apps/server/src/services/threads/thread-create.ts b/apps/server/src/services/threads/thread-create.ts index ce4129f30c..2e38a0c129 100644 --- a/apps/server/src/services/threads/thread-create.ts +++ b/apps/server/src/services/threads/thread-create.ts @@ -62,6 +62,7 @@ import type { ThreadForkDescriptor, ThreadProvisionContext, ThreadProvisionEnvironmentIntent, + ThreadSessionImportDescriptor, } from "./thread-provisioning-context.js"; import { resolveManagedDefaultBaseBranchSpec } from "../projects/worktree-base-branch.js"; import { applyLoggedEnvironmentLifecycleEvent } from "../environments/lifecycle-outcome.js"; @@ -89,6 +90,7 @@ interface CreateProvisioningThreadArgs { typeof buildExecutionOptions >[2]["projectDefaults"]; fork: ThreadForkDescriptor | null; + sessionImport: ThreadSessionImportDescriptor | null; request: ThreadCreateServiceRequest; providerInput?: ThreadCreateServiceRequestInput["input"]; } @@ -530,6 +532,7 @@ async function createProvisioningThread( environmentIntent: args.environmentIntent, execution, fork: args.fork, + sessionImport: args.sessionImport, input: args.request.input, ...(args.providerInput !== undefined ? { providerInput: args.providerInput } @@ -658,6 +661,25 @@ export async function createThreadFromRequest( "sourceSeqEnd requires an originKind", ); } + const sessionImport = requestInput.sessionImport ?? null; + if (sessionImport !== null) { + // An import binds to an external session; it cannot also derive from a bb + // source thread, and its "first turn" is pure history replay. + if (originKind !== null || sourceThreadId !== undefined) { + throw new ApiError( + 400, + "invalid_request", + "sessionImport is incompatible with source-derived thread creation", + ); + } + if (requestInput.input.length > 0) { + throw new ApiError( + 400, + "invalid_request", + "sessionImport requires empty input", + ); + } + } const sourceThread = sourceThreadId ? requireLiveSourceThread(deps, { projectId: requestInput.projectId, @@ -901,6 +923,7 @@ export async function createThreadFromRequest( environmentIntent, executionDefaults: resolvedExecutionDefaults, fork, + sessionImport, ...(options.providerInput !== undefined ? { providerInput: options.providerInput } : {}), diff --git a/apps/server/src/services/threads/thread-import.ts b/apps/server/src/services/threads/thread-import.ts new file mode 100644 index 0000000000..8a05975661 --- /dev/null +++ b/apps/server/src/services/threads/thread-import.ts @@ -0,0 +1,205 @@ +import { + findLiveThreadIdByProviderThreadId, + findProjectEnvironmentByHostPath, +} from "@bb/db"; +import { normalizeProjectPathInput } from "@bb/domain"; +import { + isAcpProviderId, + supportsProviderSessionImport, +} from "@bb/agent-providers"; +import type { ImportThreadRequest } from "@bb/server-contract"; +import type { LoggedPendingInteractionWorkSessionDeps } from "../../types.js"; +import { COMMAND_TIMEOUT_MS } from "../../constants.js"; +import { ApiError } from "../../errors.js"; +import { callHostRetryableOnlineRpc } from "../hosts/online-rpc.js"; +import { requireConnectedPrimaryHostId } from "../hosts/primary-host.js"; +import { buildAcpLaunchSpecForProviderId } from "../system/known-acp-agents.js"; +import { createThreadFromRequest } from "./thread-create.js"; +import { + requirePublicProjectForThreadCreate, + requireSourceForHost, +} from "./thread-create-helpers.js"; + +type ThreadImportDeps = LoggedPendingInteractionWorkSessionDeps; + +/** + * The static ACP-family constant only says the protocol has a session/load + * primitive; whether this specific agent binary actually implements it is + * only knowable from its live `initialize` handshake + * (agentCapabilities.loadSession). Ask the daemon for that live capability + * (the same probe model discovery already performs, including for agents + * whose model list comes from a CLI command rather than ACP-native session + * discovery), resolving the launch spec the exact same way thread.start does + * (buildAcpLaunchSpecForProviderId: a configured custom ACP agent shadows a + * built-in known agent with the same provider id) so the probed binary is + * the one that will actually serve the thread. An agent that doesn't + * support it is refused here instead of silently provisioning an + * environment and dispatching a doomed thread.start. Best-effort: any probe + * failure or a provider id with no resolvable launch spec falls back to the + * static family check, with the bridge's own refusal + * (packages/agent-runtime/src/acp/bridge/bridge.ts) as the final backstop. + */ +async function probeAcpSupportsSessionImport( + deps: ThreadImportDeps, + args: { hostId: string; providerId: string }, +): Promise<boolean | undefined> { + const acpLaunchSpec = buildAcpLaunchSpecForProviderId( + deps.config.customAcpAgents, + args.providerId, + ); + if (!acpLaunchSpec) { + return undefined; + } + try { + const result = await callHostRetryableOnlineRpc(deps, { + hostId: args.hostId, + timeoutMs: COMMAND_TIMEOUT_MS, + command: { + type: "provider.list_models", + providerId: args.providerId, + acpLaunchSpec, + }, + }); + return result.supportsSessionImport; + } catch { + return undefined; + } +} + +async function requireImportCapableProvider( + deps: ThreadImportDeps, + args: { hostId: string; providerId: string }, +): Promise<void> { + if (!supportsProviderSessionImport(args.providerId)) { + throw new ApiError( + 400, + "invalid_request", + `Provider ${args.providerId} does not support session import`, + ); + } + if (!isAcpProviderId(args.providerId)) { + return; + } + const liveSupportsSessionImport = await probeAcpSupportsSessionImport( + deps, + args, + ); + if (liveSupportsSessionImport === false) { + throw new ApiError( + 400, + "invalid_request", + `Provider ${args.providerId}'s agent does not support session/load, so it cannot import an existing session`, + ); + } +} + +/** + * Non-Codex ACP threads share one bridge process per provider, which routes + * turns by provider session id (packages/agent-runtime/src/acp/bridge/bridge.ts). + * Binding a second bb thread to a provider session another live thread + * already binds would make the bridge misroute turns between the two, so + * refuse it up front. + */ +function requireUnboundProviderSession( + deps: Pick<ThreadImportDeps, "db">, + args: { hostId: string; providerSessionId: string }, +): void { + const existingThreadId = findLiveThreadIdByProviderThreadId(deps.db, { + hostId: args.hostId, + providerThreadId: args.providerSessionId, + }); + if (existingThreadId !== null) { + throw new ApiError( + 409, + "provider_session_already_bound", + `Provider session ${args.providerSessionId} is already bound to thread ${existingThreadId}`, + ); + } +} + +/** + * Validate the caller-asserted working directory the imported session ran + * in. bb cannot read this back from the external session itself (ACP has no + * such query), so `requestedCwd` is an assertion, not a verified fact: it + * must match the project source path or an existing workspace already + * attached to this project; anything else is refused so the imported + * conversation cannot be bound to an unrelated project. A mismatch the + * caller doesn't catch here may still surface later as an agent-side + * session/load failure (packages/agent-runtime/src/acp/bridge/bridge.ts). + */ +function resolveImportCwd( + deps: Pick<ThreadImportDeps, "db">, + args: { + hostId: string; + projectId: string; + requestedCwd: string; + sourcePath: string; + }, +): string { + const cwd = normalizeProjectPathInput(args.requestedCwd); + if (cwd === normalizeProjectPathInput(args.sourcePath)) { + return cwd; + } + const environment = findProjectEnvironmentByHostPath( + deps.db, + args.projectId, + args.hostId, + cwd, + ); + if (environment) { + return cwd; + } + throw new ApiError( + 400, + "invalid_request", + `Imported session cwd ${cwd} does not match the project source ` + + `${args.sourcePath} or an existing workspace of this project`, + ); +} + +export async function createThreadImportFromRequest( + deps: ThreadImportDeps, + request: ImportThreadRequest, +) { + requirePublicProjectForThreadCreate(deps, request.projectId); + const hostId = request.hostId ?? requireConnectedPrimaryHostId(deps); + await requireImportCapableProvider(deps, { + hostId, + providerId: request.providerId, + }); + requireUnboundProviderSession(deps, { + hostId, + providerSessionId: request.providerSessionId, + }); + const source = requireSourceForHost(deps, request.projectId, hostId); + const cwd = resolveImportCwd(deps, { + hostId, + projectId: request.projectId, + requestedCwd: request.cwd, + sourcePath: source.path, + }); + + return createThreadFromRequest(deps, { + environment: { + type: "host", + hostId, + workspace: { type: "unmanaged", path: cwd }, + }, + // The imported session's first "turn" is pure history replay; no live run + // is dispatched, so the start carries no input. + input: [], + origin: request.origin, + ...(request.originPluginId === undefined + ? {} + : { originPluginId: request.originPluginId }), + ...(request.permissionMode === undefined + ? {} + : { permissionMode: request.permissionMode }), + projectId: request.projectId, + providerId: request.providerId, + sessionImport: { providerThreadId: request.providerSessionId }, + startedOnBehalfOf: null, + ...(request.title === undefined ? {} : { title: request.title }), + visibility: request.visibility, + }); +} diff --git a/apps/server/src/services/threads/thread-lifecycle.ts b/apps/server/src/services/threads/thread-lifecycle.ts index 94217153b7..8a92be9d24 100644 --- a/apps/server/src/services/threads/thread-lifecycle.ts +++ b/apps/server/src/services/threads/thread-lifecycle.ts @@ -7,6 +7,7 @@ import { isNull, notInArray, or, + sql, } from "drizzle-orm"; import { deleteThread, @@ -645,6 +646,12 @@ function hasThreadInterruptedEventAtOrAfter( ); } +// Imported-session replay stamps its turn/completed rows `historical: true` +// (see markHistoricalTurnFraming); those frames close a synthetic replay +// turn, not a live one, so they must never count toward start-activation +// staleness. +const isNotHistoricalTurnCompletedEventData = sql`COALESCE(json_extract(${events.data}, '$.historical'), 0) = 0`; + function hasProviderTurnCompletedEventAtOrAfter( deps: ThreadLifecycleReadDeps, args: HasProviderTurnCompletedEventAtOrAfterArgs, @@ -659,6 +666,7 @@ function hasProviderTurnCompletedEventAtOrAfter( eq(events.providerThreadId, args.providerThreadId), eq(events.type, "turn/completed"), gte(events.createdAt, args.createdAt), + isNotHistoricalTurnCompletedEventData, ), ) .limit(1) @@ -694,7 +702,13 @@ function isThreadStartActivationStale( function lifecycleEventForSuccessfulThreadStart( command: ThreadStartCommand, ): ThreadLifecycleEvent { - if (command.fork && command.input.length === 0) { + // A fork established with empty input and an imported session (whose + // "first turn" is pure history replay) both run no live turn: the start is + // a zero-work run, settled straight to idle. + if ( + (command.fork !== undefined || command.sessionImport !== undefined) && + command.input.length === 0 + ) { return { type: "run.succeeded" }; } return { type: "run.started" }; @@ -703,7 +717,10 @@ function lifecycleEventForSuccessfulThreadStart( function shouldAutoSendQueuedMessagesAfterThreadStart( command: ThreadStartCommand, ): boolean { - return command.fork !== null && command.input.length === 0; + return ( + (command.fork !== undefined || command.sessionImport !== undefined) && + command.input.length === 0 + ); } function recordEmptyThreadStartProviderSessionInTransaction( diff --git a/apps/server/src/services/threads/thread-provisioning-context.ts b/apps/server/src/services/threads/thread-provisioning-context.ts index 536ed0f09c..e2d893c6b6 100644 --- a/apps/server/src/services/threads/thread-provisioning-context.ts +++ b/apps/server/src/services/threads/thread-provisioning-context.ts @@ -63,6 +63,10 @@ export const threadForkDescriptorSchema = z.object({ sourceProviderThreadId: z.string().min(1), }); +export const threadSessionImportDescriptorSchema = z.object({ + providerThreadId: z.string().min(1), +}); + export const threadProvisionCommonPayloadSchema = z.object({ branchSlug: z.string().nullable().default(null), clientRequestId: clientTurnRequestIdSchema, @@ -73,6 +77,11 @@ export const threadProvisionCommonPayloadSchema = z.object({ // not a fork. Only populated for forkable forks; the server gates on // originKind/provider capability/source session/host at create time. fork: threadForkDescriptorSchema.nullable().default(null), + // Non-null ⇒ provision this thread by loading an existing external provider + // session (ACP session import) and replaying its history as historical + // events. null ⇒ not an import. The server gates on provider capability and + // cwd/workspace match at create time. + sessionImport: threadSessionImportDescriptorSchema.nullable().default(null), input: z.array(promptInputSchema), inputGroups: z.array(z.array(promptInputSchema).min(1)).min(1).optional(), titleProvided: z.boolean(), @@ -84,6 +93,9 @@ export const threadProvisionCommonPayloadSchema = z.object({ }); export type ThreadForkDescriptor = z.infer<typeof threadForkDescriptorSchema>; +export type ThreadSessionImportDescriptor = z.infer< + typeof threadSessionImportDescriptorSchema +>; export type ThreadProvisionEnvironmentIntent = z.infer< typeof threadProvisionEnvironmentIntentSchema >; @@ -198,6 +210,7 @@ export interface CreateMetadataPendingContextArgs { environmentIntent: ThreadProvisionEnvironmentIntent; execution: ResolvedThreadExecutionOptions; fork: ThreadForkDescriptor | null; + sessionImport: ThreadSessionImportDescriptor | null; input: PromptInput[]; seedWithoutRun: boolean; titleProvided: boolean; @@ -358,6 +371,7 @@ export function createMetadataPendingContext( environmentIntent: args.environmentIntent, execution: args.execution, fork: args.fork, + sessionImport: args.sessionImport, input: args.input, titleProvided: args.titleProvided, seedWithoutRun: args.seedWithoutRun, @@ -464,8 +478,10 @@ export function createReprovisioningContext( }, clientRequestId: args.clientRequestId, execution: args.execution, - // Reprovision is a new turn on an existing thread, never a fork. + // Reprovision is a new turn on an existing thread, never a fork or an + // import. fork: null, + sessionImport: null, input: args.input, ...(args.inputGroups !== undefined ? { inputGroups: args.inputGroups } diff --git a/apps/server/src/services/threads/thread-provisioning.ts b/apps/server/src/services/threads/thread-provisioning.ts index f1648f1041..617a6d6dfb 100644 --- a/apps/server/src/services/threads/thread-provisioning.ts +++ b/apps/server/src/services/threads/thread-provisioning.ts @@ -25,6 +25,7 @@ import { createMetadataPendingContext, createReprovisioningContext, type ThreadForkDescriptor, + type ThreadSessionImportDescriptor, type ThreadProvisionEnvironmentIntent, type ThreadProvisionContext, type ThreadProvisionProvisionableContext, @@ -52,6 +53,11 @@ interface RequestThreadProvisionArgs { // (native fork) instead of starting fresh. null ⇒ not a fork. Resolved by the // server at create time (originKind/provider capability/source session/host). fork: ThreadForkDescriptor | null; + // Non-null ⇒ provision this thread by loading the caller-supplied external + // provider session (ACP session import) and replaying its history. null ⇒ + // not an import. Resolved by the server at create time (provider capability + // and cwd/workspace match). + sessionImport: ThreadSessionImportDescriptor | null; input: PromptInput[]; /** Input sent to the provider when the persisted start input is seed-only. */ providerInput?: PromptInput[]; @@ -232,6 +238,7 @@ async function startThreadIfEnvironmentReady( workspaceProvisionType: args.environment.workspaceProvisionType, }, fork: args.context.request.fork, + sessionImport: args.context.request.sessionImport, input: args.context.request.input, ...(args.context.request.inputGroups !== undefined ? { inputGroups: args.context.request.inputGroups } diff --git a/apps/server/src/services/threads/thread-send.ts b/apps/server/src/services/threads/thread-send.ts index f26220d55d..e4ee5a9359 100644 --- a/apps/server/src/services/threads/thread-send.ts +++ b/apps/server/src/services/threads/thread-send.ts @@ -502,9 +502,10 @@ export async function sendThreadMessage( if (mode === "start") { const command = await prepareReadyThreadTurnCommand(deps, { thread, - // A send/steer always targets an already-started thread; forking only - // happens at create time. + // A send/steer always targets an already-started thread; forking and + // session import only happen at create time. fork: null, + sessionImport: null, input, ...(inputGroups !== undefined ? { inputGroups } : {}), requestId, diff --git a/apps/server/test/app/install-machine-script.test.ts b/apps/server/test/app/install-machine-script.test.ts index aa8dd88654..e14220142b 100644 --- a/apps/server/test/app/install-machine-script.test.ts +++ b/apps/server/test/app/install-machine-script.test.ts @@ -1,10 +1,12 @@ import { spawnSync } from "node:child_process"; import { chmodSync, + existsSync, mkdtempSync, mkdirSync, readFileSync, rmSync, + symlinkSync, writeFileSync, } from "node:fs"; import { tmpdir } from "node:os"; @@ -26,6 +28,10 @@ function createFixture(): { binDir: string; dataDir: string; homeDir: string } { mkdirSync(binDir, { recursive: true }); mkdirSync(dataDir, { recursive: true }); mkdirSync(homeDir, { recursive: true }); + // The script resolves `node` off PATH; symlink the runner's own node into + // the fixture bin dir so it stays reachable once the real PATH is filtered + // below, without depending on any particular OS layout. + symlinkSync(process.execPath, join(binDir, "node")); return { binDir, dataDir, homeDir }; } @@ -34,6 +40,18 @@ function writeExecutable(path: string, contents: string): void { chmodSync(path, 0o755); } +// A developer machine (or a shared CI cache) can have a real `bb-app` already +// installed globally on PATH. Tests that exercise the "no bb-app on PATH" +// fallback must not let that leak in and silently use the real, network- +// reaching binary instead of the fixture's mocks, so drop any PATH entry that +// resolves `bb-app` before handing PATH to the script. +function hermeticPath(binDir: string): string { + const inherited = (process.env.PATH ?? "") + .split(delimiter) + .filter((dir) => dir.length > 0 && !existsSync(join(dir, "bb-app"))); + return [binDir, ...inherited].join(delimiter); +} + function runScript( args: string[], fixture: ReturnType<typeof createFixture>, @@ -45,7 +63,7 @@ function runScript( ...process.env, BB_DATA_DIR: fixture.dataDir, HOME: fixture.homeDir, - PATH: `${fixture.binDir}${delimiter}${process.env.PATH ?? ""}`, + PATH: hermeticPath(fixture.binDir), ...env, }, }); diff --git a/apps/server/test/helpers/commands.ts b/apps/server/test/helpers/commands.ts index c0e77e363f..748ad33d6e 100644 --- a/apps/server/test/helpers/commands.ts +++ b/apps/server/test/helpers/commands.ts @@ -229,6 +229,28 @@ function respondToRuntimeWorkspaceFileCommand( return true; } +// Test-only override for the mocked `provider.list_models` response's +// `supportsSessionImport` field, keyed by providerId. Lets a test simulate a +// live ACP `initialize` handshake result without spawning a real agent. +const testProviderListModelsSupportsSessionImportOverride = new Map< + string, + boolean +>(); + +export function setTestProviderSupportsSessionImport( + providerId: string, + supportsSessionImport: boolean, +): void { + testProviderListModelsSupportsSessionImportOverride.set( + providerId, + supportsSessionImport, + ); +} + +export function clearTestProviderSupportsSessionImportOverrides(): void { + testProviderListModelsSupportsSessionImportOverride.clear(); +} + function respondToProviderModelListCommand( deps: Pick<TestAppHarness, "hub">, args: RegisterTestHostRpcCaptureArgs, @@ -236,6 +258,11 @@ function respondToProviderModelListCommand( ): boolean { if (message.command.type !== "provider.list_models") return false; + const supportsSessionImport = + testProviderListModelsSupportsSessionImportOverride.get( + message.command.providerId, + ); + deps.hub.recordHostOnlineRpcResponse({ message: hostDaemonOnlineRpcResponseMessageSchema.parse({ type: "host-rpc.response", @@ -252,6 +279,9 @@ function respondToProviderModelListCommand( }), ], selectedOnlyModels: [], + ...(supportsSessionImport !== undefined + ? { supportsSessionImport } + : {}), }, }), sessionId: args.sessionId, diff --git a/apps/server/test/internal/internal-skill-trees.test.ts b/apps/server/test/internal/internal-skill-trees.test.ts index fedeb305a1..78d78f6a49 100644 --- a/apps/server/test/internal/internal-skill-trees.test.ts +++ b/apps/server/test/internal/internal-skill-trees.test.ts @@ -12,7 +12,9 @@ describe("internal skill tree routes", () => { const { host } = seedHostSession(harness.deps, { id: "host-skill-tree" }); const rootPath = path.join(harness.config.dataDir, "tree-route-skill"); await mkdir(rootPath, { recursive: true }); - await writeFile(path.join(rootPath, "SKILL.md"), "tree route bytes\n"); + await writeFile(path.join(rootPath, "SKILL.md"), "tree route bytes\n", { + mode: 0o644, + }); const manifest = readSkillTreeManifest(rootPath); harness.deps.skillTreeRegistry.register(manifest.treeHash, rootPath); diff --git a/apps/server/test/public/public-thread-import.test.ts b/apps/server/test/public/public-thread-import.test.ts new file mode 100644 index 0000000000..617f8e4fa7 --- /dev/null +++ b/apps/server/test/public/public-thread-import.test.ts @@ -0,0 +1,343 @@ +import { upsertProjectExecutionDefaults } from "@bb/db"; +import { threadScope } from "@bb/domain"; +import { groupHostDaemonEvents } from "@bb/host-daemon-contract"; +import { threadResponseSchema } from "@bb/server-contract"; +import { afterEach, describe, expect, it } from "vitest"; +import { + clearTestProviderSupportsSessionImportOverrides, + createTestDaemonEventEnvelope, + internalAuthHeaders, + setTestProviderSupportsSessionImport, + waitForQueuedCommand, +} from "../helpers/commands.js"; +import { readJson } from "../helpers/json.js"; +import { + seedEnvironment, + seedHostSession, + seedProjectWithSource, +} from "../helpers/seed.js"; +import { withTestHarness, type TestAppHarness } from "../helpers/test-app.js"; + +const SOURCE_PATH = "/tmp/public-thread-import"; + +function seedImportTarget(harness: TestAppHarness) { + const { host } = seedHostSession(harness.deps); + const { project } = seedProjectWithSource(harness.deps, { + hostId: host.id, + path: SOURCE_PATH, + }); + const environment = seedEnvironment(harness.deps, { + hostId: host.id, + projectId: project.id, + path: SOURCE_PATH, + }); + // Stored defaults keep the create flow off the live model-catalog probe. + upsertProjectExecutionDefaults(harness.deps.db, { + projectId: project.id, + providerId: "acp-omp", + model: "omp/default", + reasoningLevel: "medium", + permissionMode: "full", + serviceTier: "default", + }); + return { environment, host, project }; +} + +async function postImport( + harness: TestAppHarness, + body: Record<string, unknown>, +) { + return harness.app.request("/api/v1/threads/import", { + method: "POST", + headers: { "content-type": "application/json" }, + body: JSON.stringify(body), + }); +} + +describe("public thread import route", () => { + afterEach(() => { + clearTestProviderSupportsSessionImportOverrides(); + }); + + it("imports an external ACP session bound to the project source", async () => { + await withTestHarness(async (harness) => { + const { host, project } = seedImportTarget(harness); + + const response = await postImport(harness, { + projectId: project.id, + providerId: "acp-omp", + providerSessionId: "external-omp-session-1", + hostId: host.id, + cwd: SOURCE_PATH, + }); + + expect(response.status).toBe(201); + const thread = threadResponseSchema.parse(await readJson(response)); + expect(thread).toMatchObject({ + projectId: project.id, + providerId: "acp-omp", + status: "starting", + }); + const queued = await waitForQueuedCommand( + harness, + ({ command }) => + command.type === "thread.start" && command.threadId === thread.id, + ); + if (queued.command.type !== "thread.start") { + throw new Error("Expected thread.start"); + } + expect(queued.command.input).toEqual([]); + expect(queued.command.fork).toBeUndefined(); + expect(queued.command.sessionImport).toEqual({ + providerThreadId: "external-omp-session-1", + }); + }); + }); + + it("refuses an import request with no cwd", async () => { + await withTestHarness(async (harness) => { + const { host, project } = seedImportTarget(harness); + + const response = await postImport(harness, { + projectId: project.id, + providerId: "acp-omp", + providerSessionId: "external-omp-session-no-cwd", + hostId: host.id, + }); + + // cwd is a required assertion, not a defaulted field: bb cannot read + // the external session's actual working directory back from it. + expect(response.status).toBe(400); + }); + }); + + it("refuses a cwd matching neither the project source nor a project workspace", async () => { + await withTestHarness(async (harness) => { + const { host, project } = seedImportTarget(harness); + + const response = await postImport(harness, { + projectId: project.id, + providerId: "acp-omp", + providerSessionId: "external-omp-session-2", + hostId: host.id, + cwd: "/tmp/somewhere-else-entirely", + }); + + expect(response.status).toBe(400); + const body = await readJson(response); + expect(body).toMatchObject({ code: "invalid_request" }); + expect(JSON.stringify(body)).toContain( + "does not match the project source", + ); + }); + }); + + it("refuses providers without session import support", async () => { + await withTestHarness(async (harness) => { + const { host, project } = seedImportTarget(harness); + + const response = await postImport(harness, { + projectId: project.id, + providerId: "codex", + providerSessionId: "external-codex-session", + hostId: host.id, + cwd: SOURCE_PATH, + }); + + expect(response.status).toBe(400); + const body = await readJson(response); + expect(JSON.stringify(body)).toContain("does not support session import"); + }); + }); + + it("refuses importing a provider session another live thread already binds", async () => { + await withTestHarness(async (harness) => { + const { host, project } = seedImportTarget(harness); + const providerSessionId = "external-omp-session-shared"; + + const firstResponse = await postImport(harness, { + projectId: project.id, + providerId: "acp-omp", + providerSessionId, + hostId: host.id, + cwd: SOURCE_PATH, + }); + expect(firstResponse.status).toBe(201); + const firstThread = threadResponseSchema.parse( + await readJson(firstResponse), + ); + + const startCommand = await waitForQueuedCommand( + harness, + ({ command }) => + command.type === "thread.start" && + command.threadId === firstThread.id, + ); + const sessionId = startCommand.row.sessionId; + if (!sessionId) { + throw new Error("Queued thread start is missing sessionId"); + } + // The bridge records the binding by sending thread/identity once the + // agent accepts session/load; that's what the reverse lookup relies on. + const eventResponse = await harness.app.request( + "/internal/session/events", + { + method: "POST", + headers: internalAuthHeaders(harness), + body: JSON.stringify({ + sessionId, + eventGroups: groupHostDaemonEvents([ + createTestDaemonEventEnvelope({ + event: { + type: "thread/identity", + threadId: firstThread.id, + providerThreadId: providerSessionId, + scope: threadScope(), + }, + }), + ]), + }), + }, + ); + expect(eventResponse.status).toBe(200); + + const secondResponse = await postImport(harness, { + projectId: project.id, + providerId: "acp-omp", + providerSessionId, + hostId: host.id, + cwd: SOURCE_PATH, + }); + + expect(secondResponse.status).toBe(409); + const body = await readJson(secondResponse); + expect(body).toMatchObject({ code: "provider_session_already_bound" }); + expect(JSON.stringify(body)).toContain(firstThread.id); + }); + }); + + it("refuses importing when the agent's live handshake reports no session/load support", async () => { + await withTestHarness(async (harness) => { + const { host, project } = seedImportTarget(harness); + // Static ACP_CAPABILITIES advertises supportsSessionImport for every + // acp-* provider; this simulates the agent's own live `initialize` + // handshake (agentCapabilities.loadSession) reporting otherwise, which + // must override the static family-level constant. + setTestProviderSupportsSessionImport("acp-omp", false); + + const response = await postImport(harness, { + projectId: project.id, + providerId: "acp-omp", + providerSessionId: "external-omp-session-no-load", + hostId: host.id, + cwd: SOURCE_PATH, + }); + + expect(response.status).toBe(400); + const body = await readJson(response); + expect(body).toMatchObject({ code: "invalid_request" }); + expect(JSON.stringify(body)).toContain("does not support session/load"); + }); + }); + + it("refuses importing a purely custom ACP agent whose live handshake reports no session/load support", async () => { + // Unlike acp-omp, "acp-mycoder" has no KNOWN_ACP_AGENTS entry: the + // capability gate can only probe it at all if it resolves the launch + // spec through the configured custom agent (the same resolution + // thread.start uses), not the built-in-only lookup. Without that, this + // provider would skip the live probe entirely and fall back to the + // static ACP-family allow, silently admitting the import. + await withTestHarness( + { + customAcpAgents: [ + { + id: "mycoder", + displayName: "My Coder", + command: "mycoder-agent", + args: ["acp"], + env: {}, + }, + ], + }, + async (harness) => { + const { host, project } = seedImportTarget(harness); + setTestProviderSupportsSessionImport("acp-mycoder", false); + + const response = await postImport(harness, { + projectId: project.id, + providerId: "acp-mycoder", + providerSessionId: "external-mycoder-session-no-load", + hostId: host.id, + cwd: SOURCE_PATH, + }); + + expect(response.status).toBe(400); + const body = await readJson(response); + expect(body).toMatchObject({ code: "invalid_request" }); + expect(JSON.stringify(body)).toContain( + "does not support session/load", + ); + }, + ); + }); + + it("imports a workspace whose path differs from the project source", async () => { + await withTestHarness(async (harness) => { + const WORKSPACE_PATH = "/tmp/public-thread-import-workspace"; + const { host, project } = seedImportTarget(harness); + seedEnvironment(harness.deps, { + hostId: host.id, + projectId: project.id, + path: WORKSPACE_PATH, + }); + + const response = await postImport(harness, { + projectId: project.id, + providerId: "acp-omp", + providerSessionId: "external-omp-session-workspace", + hostId: host.id, + cwd: WORKSPACE_PATH, + }); + + expect(response.status).toBe(201); + const thread = threadResponseSchema.parse(await readJson(response)); + expect(thread).toMatchObject({ + projectId: project.id, + providerId: "acp-omp", + status: "starting", + }); + }); + }); + + it("refuses a cwd matching a workspace that belongs to a different project", async () => { + await withTestHarness(async (harness) => { + const OTHER_PROJECT_WORKSPACE_PATH = + "/tmp/public-thread-import-other-project-workspace"; + const { host, project } = seedImportTarget(harness); + const { project: otherProject } = seedProjectWithSource(harness.deps, { + hostId: host.id, + path: "/tmp/public-thread-import-other-project-source", + }); + seedEnvironment(harness.deps, { + hostId: host.id, + projectId: otherProject.id, + path: OTHER_PROJECT_WORKSPACE_PATH, + }); + + const response = await postImport(harness, { + projectId: project.id, + providerId: "acp-omp", + providerSessionId: "external-omp-session-cross-project", + hostId: host.id, + cwd: OTHER_PROJECT_WORKSPACE_PATH, + }); + + expect(response.status).toBe(400); + const body = await readJson(response); + expect(body).toMatchObject({ code: "invalid_request" }); + expect(JSON.stringify(body)).toContain( + "does not match the project source", + ); + }); + }); +}); diff --git a/apps/server/test/services/plugins/ask-user-question-plugin.test.ts b/apps/server/test/services/plugins/ask-user-question-plugin.test.ts index d069c4bfcf..fafdc1a511 100644 --- a/apps/server/test/services/plugins/ask-user-question-plugin.test.ts +++ b/apps/server/test/services/plugins/ask-user-question-plugin.test.ts @@ -77,6 +77,7 @@ describe("ask-user-question builtin plugin", () => { environment, execution, fork: null, + sessionImport: null, permissionEscalation: "ask", input: textInput("hello"), projectId: project.id, diff --git a/apps/server/test/services/plugins/heroes-phase2.test.ts b/apps/server/test/services/plugins/heroes-phase2.test.ts index f17d138c64..f0e1595983 100644 --- a/apps/server/test/services/plugins/heroes-phase2.test.ts +++ b/apps/server/test/services/plugins/heroes-phase2.test.ts @@ -85,6 +85,7 @@ describe("hero plugin: agent-enrichment (Phase 2 surfaces)", () => { environment, execution, fork: null, + sessionImport: null, permissionEscalation: "ask", input: textInput("hello"), projectId: project.id, diff --git a/apps/server/test/services/plugins/plugin-agent-contributions.test.ts b/apps/server/test/services/plugins/plugin-agent-contributions.test.ts index 08382b6feb..68f66300a7 100644 --- a/apps/server/test/services/plugins/plugin-agent-contributions.test.ts +++ b/apps/server/test/services/plugins/plugin-agent-contributions.test.ts @@ -265,6 +265,7 @@ describe("plugin agent contributions reach thread runtime config", () => { environment, execution, fork: null, + sessionImport: null, permissionEscalation: "ask", input: textInput("hello"), projectId: project.id, diff --git a/apps/server/test/services/plugins/plugin-agent-tools.test.ts b/apps/server/test/services/plugins/plugin-agent-tools.test.ts index 1af2d8a42b..902e8d0ce0 100644 --- a/apps/server/test/services/plugins/plugin-agent-tools.test.ts +++ b/apps/server/test/services/plugins/plugin-agent-tools.test.ts @@ -557,6 +557,7 @@ describe("plugin tools reach thread runtime config", () => { environment, execution, fork: null, + sessionImport: null, permissionEscalation: "ask", input: textInput("hello"), projectId: project.id, @@ -724,6 +725,7 @@ describe("plugin tools reach thread runtime config", () => { environment: target.environment, execution, fork: null, + sessionImport: null, permissionEscalation: "ask", input: textInput("hello"), projectId: target.project.id, diff --git a/apps/server/test/threads/generated-branch-names.test.ts b/apps/server/test/threads/generated-branch-names.test.ts index 025bd06cf0..51d0b10bec 100644 --- a/apps/server/test/threads/generated-branch-names.test.ts +++ b/apps/server/test/threads/generated-branch-names.test.ts @@ -284,6 +284,7 @@ describe("generated managed branch names", () => { }, execution: THREAD_START_EXECUTION, fork: null, + sessionImport: null, input, startedOnBehalfOf: null, thread, @@ -823,6 +824,7 @@ describe("generated managed branch names", () => { }, execution: THREAD_START_EXECUTION, fork: null, + sessionImport: null, input: textInput("Generate a title for this non-managed reuse thread"), startedOnBehalfOf: null, thread, @@ -946,6 +948,7 @@ describe("generated managed branch names", () => { }, execution: THREAD_START_EXECUTION, fork: null, + sessionImport: null, input: textInput("Generate a title for this non-managed reuse thread"), startedOnBehalfOf: null, thread, diff --git a/apps/server/test/threads/thread-live-start-handoff.test.ts b/apps/server/test/threads/thread-live-start-handoff.test.ts index f78dc37b6b..e340f829af 100644 --- a/apps/server/test/threads/thread-live-start-handoff.test.ts +++ b/apps/server/test/threads/thread-live-start-handoff.test.ts @@ -86,6 +86,7 @@ async function startLiveThreadStartRpc( thread, environment, fork: null, + sessionImport: null, input: textInput("start live runtime"), requestId: encodeClientTurnRequestIdNumber({ value: args.requestIdValue, @@ -373,6 +374,73 @@ describe("live thread start handoff", () => { }); }); + it("does not treat a historical turn/completed event as start activation staleness", async () => { + await withTestHarness(async (harness) => { + const fixture = await startLiveThreadStartRpc({ + harness, + requestIdValue: 7, + }); + const providerThreadId = "provider-historical-replay-race"; + const turnId = "turn-historical-replay-race"; + const sessionId = fixture.startCommand.row.sessionId; + if (!sessionId) { + throw new Error("Queued thread start is missing sessionId"); + } + + // A replayed import history frame can land stamped with the same + // providerThreadId the live start later settles with (e.g. a retried + // import on a runtime whose identity registry still holds the prior + // session id). Historical frames must never count as activation + // staleness, or the start never applies run.started and the thread + // sticks in `starting` forever. + const eventResponse = await harness.app.request( + "/internal/session/events", + { + method: "POST", + headers: internalAuthHeaders(harness), + body: JSON.stringify({ + sessionId, + eventGroups: groupHostDaemonEvents([ + createTestDaemonEventEnvelope({ + event: { + type: "turn/started", + threadId: fixture.thread.id, + providerThreadId, + scope: turnScope(turnId), + historical: true, + }, + }), + createTestDaemonEventEnvelope({ + event: { + type: "turn/completed", + threadId: fixture.thread.id, + providerThreadId, + scope: turnScope(turnId), + status: "completed", + historical: true, + }, + }), + ]), + }), + }, + ); + expect(eventResponse.status).toBe(200); + // Historical frames carry no lifecycle side effects, so the thread stays + // in its pre-activation `starting` status. + expect(getThread(harness.db, fixture.thread.id)).toMatchObject({ + status: "starting", + }); + + await reportQueuedCommandSuccess(harness, fixture.startCommand, { + providerThreadId, + }); + + expect(getThread(harness.db, fixture.thread.id)).toMatchObject({ + status: "active", + }); + }); + }); + it("does not reactivate an archived thread when a late thread start succeeds", async () => { await withTestHarness(async (harness) => { const fixture = await startLiveThreadStartRpc({ diff --git a/apps/server/test/threads/thread-provisioning-recovery.test.ts b/apps/server/test/threads/thread-provisioning-recovery.test.ts index e9f3979f8b..838f6f97c1 100644 --- a/apps/server/test/threads/thread-provisioning-recovery.test.ts +++ b/apps/server/test/threads/thread-provisioning-recovery.test.ts @@ -119,6 +119,7 @@ describe("thread provisioning recovery", () => { }, execution: THREAD_START_EXECUTION, fork: null, + sessionImport: null, input: textInput("start after workspace ready"), titleProvided: true, seedWithoutRun: false, @@ -242,6 +243,7 @@ describe("thread provisioning recovery", () => { }, execution: THREAD_START_EXECUTION, fork: null, + sessionImport: null, input: textInput("start before first turn event"), titleProvided: true, seedWithoutRun: false, diff --git a/apps/server/test/threads/thread-provisioning-state.test.ts b/apps/server/test/threads/thread-provisioning-state.test.ts index 15f0c0905a..b0e907e125 100644 --- a/apps/server/test/threads/thread-provisioning-state.test.ts +++ b/apps/server/test/threads/thread-provisioning-state.test.ts @@ -68,6 +68,7 @@ describe("thread provisioning state", () => { source: "client/turn/requested", }, fork: null, + sessionImport: null, startedOnBehalfOf: null, titleProvided: true, }, diff --git a/apps/server/test/threads/thread-runtime-config.test.ts b/apps/server/test/threads/thread-runtime-config.test.ts index 9d8cf245c5..a1064ca5e9 100644 --- a/apps/server/test/threads/thread-runtime-config.test.ts +++ b/apps/server/test/threads/thread-runtime-config.test.ts @@ -211,6 +211,7 @@ describe("thread runtime config", () => { environment, execution, fork: null, + sessionImport: null, permissionEscalation: "ask", input: textInput("hello"), projectId: project.id, @@ -347,6 +348,7 @@ describe("thread runtime config", () => { environment, execution, fork: null, + sessionImport: null, permissionEscalation: "ask", input: textInput("hello"), projectId: project.id, @@ -766,6 +768,7 @@ describe("thread runtime config", () => { environment, execution, fork: null, + sessionImport: null, permissionEscalation: "ask", input: textInput("hello"), projectId: project.id, @@ -833,6 +836,7 @@ describe("thread runtime config", () => { environment, execution, fork: null, + sessionImport: null, permissionEscalation: "ask", input: textInput("hello"), projectId: project.id, @@ -895,6 +899,7 @@ describe("thread runtime config", () => { environment, execution, fork: null, + sessionImport: null, permissionEscalation: "ask", input: textInput("hello"), projectId: project.id, @@ -946,6 +951,7 @@ describe("thread runtime config", () => { environment, execution, fork: null, + sessionImport: null, permissionEscalation: "ask", input: textInput("hello"), projectId: project.id, @@ -1016,6 +1022,7 @@ describe("thread runtime config", () => { source: "client/turn/requested", }, fork: null, + sessionImport: null, permissionEscalation: "ask", input, projectId: project.id, diff --git a/apps/server/vitest.config.ts b/apps/server/vitest.config.ts index 8638b2d567..5d635109eb 100644 --- a/apps/server/vitest.config.ts +++ b/apps/server/vitest.config.ts @@ -8,6 +8,13 @@ const isolationTests = findIsolationRequiringTests(__dirname, ["src", "test"]); export default defineWorkspaceTestConfig({ test: { silent: "passed-only", + // The suite mixes fast unit tests with real git clone / npm install / + // esbuild build fixtures (plugin install, bb-app artifact builds); under + // full-parallel sandbox load those fixtures can blow past vitest's + // default 5s budget even though nothing is hung. Sibling packages that + // shell out for similar work (plugin-registry, host-daemon, app) already + // raise this for the same reason. + testTimeout: 20_000, env: { BB_DATA_DIR: "/tmp/bb-server-test", BB_SERVER_PORT: "49161", diff --git a/packages/agent-providers/src/catalog.ts b/packages/agent-providers/src/catalog.ts index eb5e9ccdbd..63621c1927 100644 --- a/packages/agent-providers/src/catalog.ts +++ b/packages/agent-providers/src/catalog.ts @@ -93,6 +93,7 @@ const CODEX_CAPABILITIES: ProviderCapabilities = { supportsServiceTier: true, supportsUserQuestion: false, supportsFork: true, + supportsSessionImport: false, supportedPermissionModes: ["accept-edits", "auto", "full"], }; @@ -102,6 +103,7 @@ const CLAUDE_CAPABILITIES: ProviderCapabilities = { supportsServiceTier: false, supportsUserQuestion: true, supportsFork: true, + supportsSessionImport: false, supportedPermissionModes: ["accept-edits", "auto", "full"], }; @@ -111,6 +113,7 @@ const PI_CAPABILITIES: ProviderCapabilities = { supportsServiceTier: false, supportsUserQuestion: false, supportsFork: true, + supportsSessionImport: false, supportedPermissionModes: ["full"], }; @@ -159,6 +162,12 @@ const ACP_CAPABILITIES: ProviderCapabilities = { // ACP has no session-fork primitive; the adapter has no thread/fork handler, // so forks are blocked at the server boundary rather than failing at runtime. supportsFork: false, + // ACP `session/load` lets an existing external agent session be imported as + // a bb thread. Whether a specific agent binary really supports it is only + // knowable from its live `initialize` handshake (agentCapabilities.loadSession), + // so this flag advertises the protocol capability and the bridge refuses the + // import with a clear error when the agent does not declare loadSession. + supportsSessionImport: true, supportedPermissionModes: ["accept-edits", "full"], }; @@ -294,6 +303,7 @@ function cloneCapabilities( supportsServiceTier: capabilities.supportsServiceTier, supportsUserQuestion: capabilities.supportsUserQuestion, supportsFork: capabilities.supportsFork, + supportsSessionImport: capabilities.supportsSessionImport, supportedPermissionModes: [...capabilities.supportedPermissionModes], }; } @@ -393,6 +403,20 @@ export function supportsNativeFork(providerId: string): boolean { ); } +/** Whether an existing external session of this provider can be imported. */ +export function supportsProviderSessionImport(providerId: string): boolean { + const provider = isAgentProviderId(providerId) + ? getBuiltInAgentProviderInfo(providerId) + : isAcpProviderId(providerId) + ? buildAcpProviderInfo({ + id: providerId, + displayName: providerId, + logoUrl: null, + }) + : null; + return provider?.capabilities.supportsSessionImport ?? false; +} + export function listBuiltInAgentProviderInfos(): BuiltInAgentProviderInfo[] { return BUILT_IN_AGENT_PROVIDER_CATALOG.map((provider) => cloneBuiltInAgentProviderInfo(provider.info), diff --git a/packages/agent-providers/src/index.ts b/packages/agent-providers/src/index.ts index f15415d788..116cc075fd 100644 --- a/packages/agent-providers/src/index.ts +++ b/packages/agent-providers/src/index.ts @@ -20,6 +20,7 @@ export { PI_DEFAULT_MODEL_PER_PROVIDER, resolvePiDefaultModelId, supportsNativeFork, + supportsProviderSessionImport, } from "./catalog.js"; export type { AcpAgentProviderId, diff --git a/packages/agent-providers/test/catalog.test.ts b/packages/agent-providers/test/catalog.test.ts index 387e48c54f..1038865f3e 100644 --- a/packages/agent-providers/test/catalog.test.ts +++ b/packages/agent-providers/test/catalog.test.ts @@ -38,6 +38,7 @@ describe("agent provider catalog", () => { supportsServiceTier: true, supportsUserQuestion: false, supportsFork: false, + supportsSessionImport: true, supportedPermissionModes: ["accept-edits", "full"], }, composerActions: [{ kind: "skills", trigger: "/" }], diff --git a/packages/agent-runtime/src/acp/adapter.test.ts b/packages/agent-runtime/src/acp/adapter.test.ts index c820203a10..1743a2e823 100644 --- a/packages/agent-runtime/src/acp/adapter.test.ts +++ b/packages/agent-runtime/src/acp/adapter.test.ts @@ -1133,6 +1133,352 @@ describe("acp adapter event translation", () => { }); }); +describe("acp adapter historical replay translation", () => { + const HISTORICAL_CONTEXT = { threadId: "thread-1", historical: true }; + + function historicalUpdate(update: Record<string, unknown>) { + return { + jsonrpc: "2.0" as const, + method: "acp/update", + params: { threadId: "thread-1", update, historical: true }, + }; + } + + it("translates replayed history into a historical turn frame", () => { + const adapter = createAdapter(); + + const userEvents = adapter.translateEvent( + historicalUpdate({ + sessionUpdate: "user_message_chunk", + content: { type: "text", text: "replayed-user" }, + }), + HISTORICAL_CONTEXT, + ); + // The replay opens a synthetic turn marked historical so neither the + // runtime nor the server applies turn-lifecycle side effects. + expect(userEvents).toEqual([ + { + type: "turn/started", + threadId: "", + providerThreadId: "", + scope: turnScope("turn-1"), + historical: true, + }, + ]); + + const agentEvents = adapter.translateEvent( + historicalUpdate({ + sessionUpdate: "agent_message_chunk", + content: { type: "text", text: "replayed-agent" }, + }), + HISTORICAL_CONTEXT, + ); + // The agent chunk closes the accumulated user message first. + expect(agentEvents).toEqual([ + { + type: "item/completed", + threadId: "", + providerThreadId: "", + scope: turnScope("turn-1"), + item: { + type: "userMessage", + id: "acp-user-1", + content: [{ type: "text", text: "replayed-user" }], + }, + }, + { + type: "item/agentMessage/delta", + threadId: "", + providerThreadId: "", + scope: turnScope("turn-1"), + itemId: "acp-assistant-1", + delta: "replayed-agent", + }, + ]); + + const completedEvents = adapter.translateEvent( + { + jsonrpc: "2.0", + method: "acp/turn/completed", + params: { + threadId: "thread-1", + stopReason: "end_turn", + historical: true, + }, + }, + HISTORICAL_CONTEXT, + ); + expect(completedEvents).toEqual([ + { + type: "item/completed", + threadId: "", + providerThreadId: "", + scope: turnScope("turn-1"), + item: { + type: "agentMessage", + id: "acp-assistant-1", + text: "replayed-agent", + }, + }, + { + type: "turn/completed", + threadId: "", + providerThreadId: "", + scope: turnScope("turn-1"), + status: "completed", + historical: true, + }, + ]); + }); + + it("keeps replayed user messages separate when messageId changes", () => { + const adapter = createAdapter(); + + const firstEvents = adapter.translateEvent( + historicalUpdate({ + sessionUpdate: "user_message_chunk", + content: { type: "text", text: "Hello world" }, + messageId: "replay-msg-1", + }), + HISTORICAL_CONTEXT, + ); + expect(firstEvents).toEqual([ + { + type: "turn/started", + threadId: "", + providerThreadId: "", + scope: turnScope("turn-1"), + historical: true, + }, + ]); + + // A messageId change closes the first message instead of merging into it. + const secondEvents = adapter.translateEvent( + historicalUpdate({ + sessionUpdate: "user_message_chunk", + content: { type: "text", text: "Fix the bug" }, + messageId: "replay-msg-2", + }), + HISTORICAL_CONTEXT, + ); + expect(secondEvents).toEqual([ + { + type: "item/completed", + threadId: "", + providerThreadId: "", + scope: turnScope("turn-1"), + item: { + type: "userMessage", + id: "acp-user-1", + content: [{ type: "text", text: "Hello world" }], + }, + }, + ]); + + const completedEvents = adapter.translateEvent( + { + jsonrpc: "2.0", + method: "acp/turn/completed", + params: { + threadId: "thread-1", + stopReason: "end_turn", + historical: true, + }, + }, + HISTORICAL_CONTEXT, + ); + expect(completedEvents).toEqual([ + { + type: "item/completed", + threadId: "", + providerThreadId: "", + scope: turnScope("turn-1"), + item: { + type: "userMessage", + id: "acp-user-2", + content: [{ type: "text", text: "Fix the bug" }], + }, + }, + { + type: "turn/completed", + threadId: "", + providerThreadId: "", + scope: turnScope("turn-1"), + status: "completed", + historical: true, + }, + ]); + }); + + it("keeps concatenating replayed user chunks that carry no messageId", () => { + const adapter = createAdapter(); + + adapter.translateEvent( + historicalUpdate({ + sessionUpdate: "user_message_chunk", + content: { type: "text", text: "Hello " }, + }), + HISTORICAL_CONTEXT, + ); + adapter.translateEvent( + historicalUpdate({ + sessionUpdate: "user_message_chunk", + content: { type: "text", text: "world" }, + }), + HISTORICAL_CONTEXT, + ); + const completedEvents = adapter.translateEvent( + { + jsonrpc: "2.0", + method: "acp/turn/completed", + params: { + threadId: "thread-1", + stopReason: "end_turn", + historical: true, + }, + }, + HISTORICAL_CONTEXT, + ); + expect(completedEvents).toEqual([ + { + type: "item/completed", + threadId: "", + providerThreadId: "", + scope: turnScope("turn-1"), + item: { + type: "userMessage", + id: "acp-user-1", + content: [{ type: "text", text: "Hello world" }], + }, + }, + { + type: "turn/completed", + threadId: "", + providerThreadId: "", + scope: turnScope("turn-1"), + status: "completed", + historical: true, + }, + ]); + }); + + it("replaces a non-text replayed user message chunk with a placeholder instead of dropping it", () => { + const adapter = createAdapter(); + + adapter.translateEvent( + historicalUpdate({ + sessionUpdate: "user_message_chunk", + content: { type: "image", data: "base64-data", mimeType: "image/png" }, + }), + HISTORICAL_CONTEXT, + ); + const completedEvents = adapter.translateEvent( + { + jsonrpc: "2.0", + method: "acp/turn/completed", + params: { + threadId: "thread-1", + stopReason: "end_turn", + historical: true, + }, + }, + HISTORICAL_CONTEXT, + ); + expect(completedEvents).toEqual([ + { + type: "item/completed", + threadId: "", + providerThreadId: "", + scope: turnScope("turn-1"), + item: { + type: "userMessage", + id: "acp-user-1", + content: [{ type: "text", text: "[unsupported content: image]" }], + }, + }, + { + type: "turn/completed", + threadId: "", + providerThreadId: "", + scope: turnScope("turn-1"), + status: "completed", + historical: true, + }, + ]); + }); + + it("drops a stranded replayed user message instead of leaking it into a later live turn", () => { + const adapter = createAdapter(); + + // A replay opens a historical turn and accumulates an unflushed user + // message chunk (no messageId change or turn/completed has closed it + // yet). + adapter.translateEvent( + historicalUpdate({ + sessionUpdate: "user_message_chunk", + content: { type: "text", text: "replayed-user" }, + }), + HISTORICAL_CONTEXT, + ); + + // thread/stop tears the turn down mid-replay (e.g. another import raced + // ahead of the replay finishing), before the trailing turn/completed + // ever arrives. + adapter.buildCommandPlan({ + type: "thread/stop", + threadId: "thread-1", + providerThreadId: "sess-1", + activeTurnId: "turn-1", + }); + + // The trailing historical turn/completed still arrives but is a no-op: + // no turn is open anymore. + const trailingCompletedEvents = adapter.translateEvent( + { + jsonrpc: "2.0", + method: "acp/turn/completed", + params: { + threadId: "thread-1", + stopReason: "end_turn", + historical: true, + }, + }, + HISTORICAL_CONTEXT, + ); + expect(trailingCompletedEvents).toEqual([]); + + // A live turn then starts; the stranded replay text must not leak into + // it as a phantom userMessage item that was never actually sent. + const liveEvents = adapter.translateEvent( + updateNotification({ + sessionUpdate: "agent_message_chunk", + content: { type: "text", text: "live-agent" }, + }), + THREAD_CONTEXT, + ); + expect( + liveEvents.some( + (event) => + event.type === "item/completed" && event.item.type === "userMessage", + ), + ).toBe(false); + }); + + it("keeps live user_message_chunk updates as unhandled provider events", () => { + const adapter = createAdapter(); + startTurn(adapter); + const events = adapter.translateEvent( + updateNotification({ + sessionUpdate: "user_message_chunk", + content: { type: "text", text: "not-a-replay" }, + }), + THREAD_CONTEXT, + ); + expect(events.every((event) => event.type !== "item/completed")).toBe(true); + expect(events.some((event) => event.type === "turn/started")).toBe(false); + }); +}); + describe("acp adapter interactive requests", () => { it("decodes execute permission requests as command approvals", () => { const adapter = createAdapter(); diff --git a/packages/agent-runtime/src/acp/adapter.ts b/packages/agent-runtime/src/acp/adapter.ts index 9113968406..b5a1fe9d2c 100644 --- a/packages/agent-runtime/src/acp/adapter.ts +++ b/packages/agent-runtime/src/acp/adapter.ts @@ -104,6 +104,7 @@ import { acpVisibilityMetadata } from "./visibility.js"; import { acpAgentMessageChunkUpdateSchema, acpAgentThoughtChunkUpdateSchema, + acpUserMessageChunkUpdateSchema, acpPlanUpdateSchema, acpToolCallUpdateEventSchema, extractAcpContentText, @@ -143,6 +144,16 @@ interface AcpTurnState extends AcceptedUserMessageState { }; agentMessageTextsByItemId: Map<string, string>; fsWriteCounter: number; + /** Accumulated text of the open replayed user message (import history). */ + openUserMessageText: string | undefined; + /** + * Wire `messageId` of the open replayed user message, when the agent sends + * one. A chunk with a different messageId starts a new message instead of + * concatenating into the open one; agents that never send messageId keep + * the prior concatenation behavior. + */ + openUserMessageId: string | undefined; + userMessageCounter: number; openAssistantMessageIdsByScope: Map<string, string>; openReasoningItemIdsByScope: Map<string, string>; reasoningItemCounter: number; @@ -567,17 +578,20 @@ export function createAcpProviderAdapter( }; } - function buildModelDiscoveryAgentCommand(): - | { - command: string; - args: string[]; - cwd?: string; - envVars?: Record<string, string>; - } - | undefined { - if (buildModelListCommand() !== undefined) { - return undefined; - } + /** + * The agent's own launch command, sent alongside `model/list` regardless of + * whether `buildModelListCommand` also supplies a CLI list command. When + * there's no CLI list, the bridge uses this to discover models from a + * throwaway ACP session; when there is one, the bridge still uses it for a + * bare `initialize` handshake to learn the live `session/load` capability + * (agentCapabilities.loadSession) that the CLI list can't report. + */ + function buildModelDiscoveryAgentCommand(): { + command: string; + args: string[]; + cwd?: string; + envVars?: Record<string, string>; + } { return { command: profile.agentCommand.command, args: [...profile.agentCommand.args], @@ -618,6 +632,9 @@ export function createAcpProviderAdapter( }, agentMessageTextsByItemId: new Map(), fsWriteCounter: 0, + openUserMessageText: undefined, + openUserMessageId: undefined, + userMessageCounter: 0, openAssistantMessageIdsByScope: new Map(), openReasoningItemIdsByScope: new Map(), pendingAcceptedUserMessages: [], @@ -640,6 +657,8 @@ export function createAcpProviderAdapter( args.state.agentMessageTextsByItemId.clear(); args.state.thoughtTextsByItemId.clear(); args.state.toolCallEventsByCallId.clear(); + args.state.openUserMessageText = undefined; + args.state.openUserMessageId = undefined; drainAcceptedUserMessages({ events: args.events, providerThreadId: "", @@ -666,6 +685,37 @@ export function createAcpProviderAdapter( return `acp-reasoning-${state.reasoningItemCounter}`; } + /** + * Close the open replayed user message (if any) as a completed userMessage + * item. Only imported-history replay accumulates one; a no-op otherwise. + */ + function flushOpenUserMessageItem( + events: ThreadEvent[], + state: AcpTurnState, + ): void { + const text = state.openUserMessageText; + if (text === undefined || !state.currentTurnId) { + return; + } + state.openUserMessageText = undefined; + state.openUserMessageId = undefined; + if (text.trim().length === 0) { + return; + } + state.userMessageCounter += 1; + events.push({ + type: "item/completed", + threadId: UNSTAMPED_THREAD_ID, + providerThreadId: "", + scope: turnScope(state.currentTurnId), + item: { + type: "userMessage", + id: `acp-user-${state.userMessageCounter}`, + content: [{ type: "text", text }], + }, + }); + } + /** Close the open thought item (if any) with its accumulated content. */ function flushOpenThoughtItem( events: ThreadEvent[], @@ -811,6 +861,7 @@ export function createAcpProviderAdapter( state, threadId: UNSTAMPED_THREAD_ID, }); + flushOpenUserMessageItem(events, state); flushOpenThoughtItem(events, state, parentToolCallId); const itemId = turnState.getOrCreateAssistantMessageId({ assistantIdPrefix: "acp-assistant", @@ -846,6 +897,7 @@ export function createAcpProviderAdapter( state, threadId: UNSTAMPED_THREAD_ID, }); + flushOpenUserMessageItem(events, state); const itemId = getOrCreateScopedItemId({ createItemId: () => createReasoningItemId(state), openItemIdsByScope: state.openReasoningItemIdsByScope, @@ -878,6 +930,7 @@ export function createAcpProviderAdapter( state, threadId: UNSTAMPED_THREAD_ID, }); + flushOpenUserMessageItem(events, state); flushOpenThoughtItem(events, state, parentToolCallId); flushOpenAgentMessageItem(events, state, parentToolCallId); const item = translateAcpToolCallItem(parsed.data, parentToolCallId); @@ -964,6 +1017,62 @@ export function createAcpProviderAdapter( return events; } + case "user_message_chunk": { + // Agents replay user input only while loading a session; outside an + // import the chunk stays an unhandled provider event. + if (!context?.historical) { + return buildUnhandledProviderEvents({ + providerId: profile.providerId, + rawEvent: { + jsonrpc: "2.0", + method: ACP_UPDATE_METHOD, + params: { update }, + }, + visibilityMetadata: acpVisibilityMetadata, + ...(state.currentTurnId ? { turnId: state.currentTurnId } : {}), + ...(parentToolCallId ? { parentToolCallId } : {}), + }); + } + const parsed = acpUserMessageChunkUpdateSchema.safeParse(update); + if (!parsed.success) { + return []; + } + // `user_message_chunk` is classified as noise for visibility + // purposes (it's replay-only), so routing a non-text block through + // buildUnhandledProviderEvents like the live branch above would + // still resolve to a no-op here — falling back to a placeholder + // instead keeps the block from being silently and permanently lost + // (a later resume deliberately drops replay, so this is the only + // chance to persist it). + const text = + extractAcpContentText(parsed.data.content) ?? + `[unsupported content: ${parsed.data.content.type}]`; + ensureAcpTurnStarted({ + events, + state, + threadId: UNSTAMPED_THREAD_ID, + }); + flushOpenThoughtItem(events, state, parentToolCallId); + flushOpenAgentMessageItem(events, state, parentToolCallId); + // omp (and any agent that does the same) tags each replayed history + // entry with a fresh messageId, including distinct user messages, + // bashExecution/pythonExecution/compactionSummary entries replayed as + // user_message_chunk. A messageId change closes the open message + // instead of merging into it; agents that never send messageId keep + // the prior concatenation behavior. + const messageId = parsed.data.messageId; + if ( + messageId !== undefined && + state.openUserMessageId !== undefined && + messageId !== state.openUserMessageId + ) { + flushOpenUserMessageItem(events, state); + } + state.openUserMessageId = messageId ?? state.openUserMessageId; + state.openUserMessageText = (state.openUserMessageText ?? "") + text; + return events; + } + case "plan": { const parsed = acpPlanUpdateSchema.safeParse(update); if (!parsed.success) { @@ -1017,6 +1126,7 @@ export function createAcpProviderAdapter( return []; } const events: ThreadEvent[] = []; + flushOpenUserMessageItem(events, state); flushOpenThoughtItem(events, state, context?.parentToolCallId); flushOpenAgentMessageItem(events, state, context?.parentToolCallId); const openToolCallStatus: ThreadEventItemStatus = @@ -1066,6 +1176,24 @@ export function createAcpProviderAdapter( return events; } + /** + * Stamp turn-framing events of an imported-history replay as historical so + * neither the runtime nor the server applies turn-lifecycle side effects. + */ + function markHistoricalTurnFraming( + events: ThreadEvent[], + context: ProviderTranslationContext | undefined, + ): ThreadEvent[] { + if (!context?.historical) { + return events; + } + return events.map((event) => + event.type === "turn/started" || event.type === "turn/completed" + ? { ...event, historical: true } + : event, + ); + } + function translateAcpEvent( event: ProviderRuntimeEvent, context?: ProviderTranslationContext, @@ -1125,9 +1253,12 @@ export function createAcpProviderAdapter( if (!params.success) { return []; } - return translateTurnCompleted( - params.data.stopReason, - resolveState(context), + return markHistoricalTurnFraming( + translateTurnCompleted( + params.data.stopReason, + resolveState(context), + context, + ), context, ); } @@ -1139,9 +1270,12 @@ export function createAcpProviderAdapter( if (!params.success) { return []; } - return translateAcpUpdate( - params.data.update, - resolveState(context), + return markHistoricalTurnFraming( + translateAcpUpdate( + params.data.update, + resolveState(context), + context, + ), context, ); } @@ -1228,7 +1362,7 @@ export function createAcpProviderAdapter( function buildSessionParams( command: Extract< AdapterCommand, - { type: "thread/start" | "thread/resume" } + { type: "thread/start" | "thread/resume" | "thread/import" } >, ): Record<string, unknown> { const instructions = buildAcpSessionInstructions(command.options); @@ -1345,7 +1479,7 @@ export function createAcpProviderAdapter( method: "model/list", params: { ...(listCommand !== undefined ? { listCommand } : {}), - ...(agent !== undefined ? { agent } : {}), + agent, primaryModels: [...(profile.modelCli?.primaryModels ?? [])], ...buildReasoningCliParam(), ...buildNativeReasoningParam(), @@ -1381,6 +1515,20 @@ export function createAcpProviderAdapter( }, }; } + case "thread/import": { + finishOpenProviderTurn({ + registry: turnState, + threadId: command.threadId, + }); + return { + kind: "request", + method: "thread/import", + params: { + ...buildSessionParams(command), + providerThreadId: command.providerThreadId, + }, + }; + } case "turn/start": return { kind: "request", @@ -1448,6 +1596,7 @@ export function createAcpProviderAdapter( if ( command.type === "thread/start" || command.type === "thread/resume" || + command.type === "thread/import" || command.type === "thread/stop" ) { const state = turnState.getOrCreate({ threadId: command.threadId }); diff --git a/packages/agent-runtime/src/acp/bridge-protocol.ts b/packages/agent-runtime/src/acp/bridge-protocol.ts index da27404d19..b5f7d980f6 100644 --- a/packages/agent-runtime/src/acp/bridge-protocol.ts +++ b/packages/agent-runtime/src/acp/bridge-protocol.ts @@ -151,6 +151,17 @@ export type AcpBridgeThreadResumeParams = z.infer< typeof acpBridgeThreadResumeParamsSchema >; +/** + * Import an existing external agent session as this thread: requires + * session/load support (no fresh-session fallback) and forwards the replayed + * history as historical `acp/update` notifications instead of dropping it. + */ +export const acpBridgeThreadImportParamsSchema = + acpBridgeThreadResumeParamsSchema; +export type AcpBridgeThreadImportParams = z.infer< + typeof acpBridgeThreadImportParamsSchema +>; + export const acpBridgeTurnStartParamsSchema = z.object({ threadId: z.string().min(1), input: z.array(promptInputSchema), @@ -185,6 +196,10 @@ export const acpBridgeCommandSchema = z.discriminatedUnion("method", [ method: z.literal("thread/resume"), params: acpBridgeThreadResumeParamsSchema, }), + z.object({ + method: z.literal("thread/import"), + params: acpBridgeThreadImportParamsSchema, + }), z.object({ method: z.literal("turn/start"), params: acpBridgeTurnStartParamsSchema, @@ -220,6 +235,8 @@ export const acpTurnCompletedNotificationParamsSchema = z .object({ threadId: z.string().min(1), stopReason: acpStopReasonSchema, + /** True when closing the replayed-history frame of an imported session. */ + historical: z.boolean().optional(), }) .passthrough(); @@ -227,6 +244,8 @@ export const acpUpdateNotificationParamsSchema = z .object({ threadId: z.string().min(1), update: acpSessionUpdateSchema, + /** True when the update replays history from an imported session. */ + historical: z.boolean().optional(), }) .passthrough(); diff --git a/packages/agent-runtime/src/acp/bridge/bridge.test.ts b/packages/agent-runtime/src/acp/bridge/bridge.test.ts index 7728fb97d4..475100f282 100644 --- a/packages/agent-runtime/src/acp/bridge/bridge.test.ts +++ b/packages/agent-runtime/src/acp/bridge/bridge.test.ts @@ -407,6 +407,59 @@ describe("acp bridge", () => { }); }); + it("reports the live loadSession handshake capability on model/list", async () => { + const supportedId = sendRequest("model/list", { + agent: { + command: process.execPath, + args: [FAKE_AGENT_PATH], + envVars: { FAKE_ACP_MODEL_CONFIG: "1", FAKE_ACP_LOAD_SESSION: "1" }, + }, + primaryModels: [], + }); + expect((await waitForResponse(supportedId)).result).toMatchObject({ + supportsSessionImport: true, + }); + + const unsupportedId = sendRequest("model/list", { + agent: { + command: process.execPath, + args: [FAKE_AGENT_PATH], + // FAKE_ACP_LOAD_SESSION omitted (unsupported); FAKE_ACP_MODEL_COUNT + // set only to give this agent command a distinct discovery cache key + // from the "supported" case above. + envVars: { FAKE_ACP_MODEL_CONFIG: "1", FAKE_ACP_MODEL_COUNT: "2" }, + }, + primaryModels: [], + }); + expect((await waitForResponse(unsupportedId)).result).toMatchObject({ + supportsSessionImport: false, + }); + }); + + it("reports the live loadSession handshake capability for a CLI model-list agent too", async () => { + // An agent with a CLI model list (e.g. acp-grok) never runs the + // session-discovery path below (the catalog already satisfies the + // request), so the capability must be probed separately or it never gets + // learned for these agents. + const modelListId = sendRequest("model/list", { + listCommand: { + command: process.execPath, + args: ["-e", 'console.log("cli-model - CLI Model")'], + }, + agent: { + command: process.execPath, + args: [FAKE_AGENT_PATH], + envVars: { FAKE_ACP_LOAD_SESSION: "1" }, + }, + primaryModels: [], + }); + + expect((await waitForResponse(modelListId)).result).toMatchObject({ + models: [{ id: "cli-model", displayName: "CLI Model", isDefault: true }], + supportsSessionImport: true, + }); + }); + it("discovers ACP-native models from session models state", async () => { const modelListId = sendRequest("model/list", { agent: { @@ -1622,6 +1675,318 @@ describe("acp bridge", () => { }); }); + it("imports an external session and forwards its replayed history as historical updates", async () => { + const importId = sendRequest("thread/import", { + threadId: "thread-import-1", + providerThreadId: "external-sess-1", + cwd: workspaceDir, + agent: { command: process.execPath, args: [FAKE_AGENT_PATH] }, + permissionMode: "full", + permissionEscalation: null, + workspaceWriteRoots: [workspaceDir], + envVars: { FAKE_ACP_LOAD_SESSION: "1", FAKE_ACP_REPLAY_UPDATES: "1" }, + }); + const response = await waitForResponse(importId); + expect(response.result).toEqual({ providerThreadId: "external-sess-1" }); + startedProviderThreadIds.push("external-sess-1"); + + // The replay is forwarded (not dropped by the loading gate), each update + // marked historical for the adapter's replay translation. + const updates = notifications("acp/update").map( + (message) => message.params, + ); + expect(updates).toHaveLength(3); + for (const update of updates) { + expect(update).toMatchObject({ + threadId: "thread-import-1", + historical: true, + }); + } + expect(agentMessageTexts()).toContain("replayed-agent"); + // The historical frame closes once session/load settles. + const completed = notifications("acp/turn/completed").at(-1); + expect(completed?.params).toMatchObject({ + threadId: "thread-import-1", + stopReason: "end_turn", + historical: true, + }); + const identity = notifications("thread/identity").at(-1); + expect(identity?.params).toEqual({ + threadId: "thread-import-1", + providerThreadId: "external-sess-1", + }); + expect(notifications("acp/warning")).toHaveLength(0); + }); + + it("forwards distinct replayed user message ids on the wire", async () => { + const importId = sendRequest("thread/import", { + threadId: "thread-import-distinct-messages", + providerThreadId: "external-sess-distinct-messages", + cwd: workspaceDir, + agent: { command: process.execPath, args: [FAKE_AGENT_PATH] }, + permissionMode: "full", + permissionEscalation: null, + workspaceWriteRoots: [workspaceDir], + envVars: { + FAKE_ACP_LOAD_SESSION: "1", + FAKE_ACP_REPLAY_UPDATES: "1", + FAKE_ACP_REPLAY_DISTINCT_USER_MESSAGES: "1", + }, + }); + const response = await waitForResponse(importId); + expect(response.result).toEqual({ + providerThreadId: "external-sess-distinct-messages", + }); + startedProviderThreadIds.push("external-sess-distinct-messages"); + + const updates = notifications("acp/update").map( + (message) => message.params as Record<string, unknown>, + ); + const userChunkMessageIds = updates + .map((params) => params.update as Record<string, unknown>) + .filter((update) => update.sessionUpdate === "user_message_chunk") + .map((update) => update.messageId); + expect(userChunkMessageIds).toEqual([ + "replay-msg-1", + "replay-msg-1", + "replay-msg-2", + ]); + }); + + it("refuses to import when the agent does not support session/load", async () => { + const importId = sendRequest("thread/import", { + threadId: "thread-import-unsupported", + providerThreadId: "external-sess-2", + cwd: workspaceDir, + agent: { command: process.execPath, args: [FAKE_AGENT_PATH] }, + permissionMode: "full", + permissionEscalation: null, + workspaceWriteRoots: [workspaceDir], + }); + const response = await waitForResponse(importId); + expect(response.error?.message).toMatch( + /does not support session\/load, so it cannot import/, + ); + // No silent fresh-session fallback. + expect(notifications("thread/identity")).toHaveLength(0); + }); + + it("fails the import with a clear error when session/load fails", async () => { + const importId = sendRequest("thread/import", { + threadId: "thread-import-load-failure", + providerThreadId: "external-sess-3", + cwd: workspaceDir, + agent: { command: process.execPath, args: [FAKE_AGENT_PATH] }, + permissionMode: "full", + permissionEscalation: null, + workspaceWriteRoots: [workspaceDir], + envVars: { + FAKE_ACP_LOAD_SESSION: "1", + FAKE_ACP_LOAD_SESSION_ERROR: "1", + }, + }); + const response = await waitForResponse(importId); + expect(response.error?.message).toMatch( + /failed to load session "external-sess-3".*session storage corrupted/, + ); + // No silent fresh-session fallback: no session was established. + expect(notifications("thread/identity")).toHaveLength(0); + expect(notifications("acp/warning")).toHaveLength(0); + }); + + it("closes the historical turn before reporting a session/load failure that replayed part of the history", async () => { + const importId = sendRequest("thread/import", { + threadId: "thread-import-load-failure-partial-replay", + providerThreadId: "external-sess-4", + cwd: workspaceDir, + agent: { command: process.execPath, args: [FAKE_AGENT_PATH] }, + permissionMode: "full", + permissionEscalation: null, + workspaceWriteRoots: [workspaceDir], + envVars: { + FAKE_ACP_LOAD_SESSION: "1", + FAKE_ACP_LOAD_SESSION_ERROR: "1", + FAKE_ACP_REPLAY_UPDATES: "1", + }, + }); + const response = await waitForResponse(importId); + expect(response.error?.message).toMatch( + /failed to load session "external-sess-4".*session storage corrupted/, + ); + + // The partial replay was forwarded before the failure... + const updates = notifications("acp/update").map( + (message) => message.params, + ); + expect(updates.length).toBeGreaterThan(0); + for (const update of updates) { + expect(update).toMatchObject({ + threadId: "thread-import-load-failure-partial-replay", + historical: true, + }); + } + // ...and the synthetic historical turn it opened is closed before the + // error result, instead of staying open forever. + const completedIndex = output.messages.findIndex( + (message) => message.method === "acp/turn/completed", + ); + const responseIndex = output.messages.findIndex( + (message) => message.id === importId, + ); + expect(completedIndex).toBeGreaterThanOrEqual(0); + expect(completedIndex).toBeLessThan(responseIndex); + const completed = notifications("acp/turn/completed").at(-1); + expect(completed?.params).toMatchObject({ + threadId: "thread-import-load-failure-partial-replay", + stopReason: "cancelled", + historical: true, + }); + expect(notifications("thread/identity")).toHaveLength(0); + }); + + it("refuses to import the same provider session into a second bb thread", async () => { + const firstImportId = sendRequest("thread/import", { + threadId: "thread-import-dup-1", + providerThreadId: "external-sess-dup", + cwd: workspaceDir, + agent: { command: process.execPath, args: [FAKE_AGENT_PATH] }, + permissionMode: "full", + permissionEscalation: null, + workspaceWriteRoots: [workspaceDir], + envVars: { FAKE_ACP_LOAD_SESSION: "1" }, + }); + const firstResponse = await waitForResponse(firstImportId); + expect(firstResponse.result).toEqual({ + providerThreadId: "external-sess-dup", + }); + startedProviderThreadIds.push("external-sess-dup"); + + const secondImportId = sendRequest("thread/import", { + threadId: "thread-import-dup-2", + providerThreadId: "external-sess-dup", + cwd: workspaceDir, + agent: { command: process.execPath, args: [FAKE_AGENT_PATH] }, + permissionMode: "full", + permissionEscalation: null, + workspaceWriteRoots: [workspaceDir], + // A replaying agent must never get the chance to forward history for a + // provider session id this second import is rejected for: the dup + // check runs before session/load, not after. + envVars: { FAKE_ACP_LOAD_SESSION: "1", FAKE_ACP_REPLAY_UPDATES: "1" }, + }); + const secondResponse = await waitForResponse(secondImportId); + expect(secondResponse.error?.message).toMatch( + /already bound to bb thread "thread-import-dup-1"/, + ); + // No history was replayed and no historical turn was opened (let alone + // left open) for the rejected thread. + const rejectedUpdates = notifications("acp/update").filter( + (message) => + (message.params as { threadId?: string } | undefined)?.threadId === + "thread-import-dup-2", + ); + expect(rejectedUpdates).toHaveLength(0); + const rejectedCompletions = notifications("acp/turn/completed").filter( + (message) => + (message.params as { threadId?: string } | undefined)?.threadId === + "thread-import-dup-2", + ); + expect(rejectedCompletions).toHaveLength(0); + // The first thread's binding is untouched: a turn/start against the + // shared provider session id still routes to the first bb thread. + const turnId = sendRequest("turn/start", { + threadId: "external-sess-dup", + input: [{ type: "text", text: "hi", mentions: [] }], + }); + const turnResponse = await waitForResponse(turnId); + expect(turnResponse.error).toBeUndefined(); + const completed = await waitFor( + () => notifications("acp/turn/completed").at(-1), + "turn/completed", + ); + expect(completed.params).toMatchObject({ + threadId: "thread-import-dup-1", + }); + }); + + it("refuses a concurrent second import of the same provider session before either binds", async () => { + // Sent back-to-back, with neither awaited before the other is sent: both + // requests reach the pre-load unbound check (before session/load, before + // any binding exists) in the same race window this regresses. The first + // import's session/load is delayed and replays history: the pre-load + // reservation must be claimed right after its own pre-load check (well + // before session/load returns), so the second import is refused before + // it can dispatch session/load at all, and the first import's delayed + // session/load stays the sole path to any replay. + const firstImportId = sendRequest("thread/import", { + threadId: "thread-import-race-1", + providerThreadId: "external-sess-race", + cwd: workspaceDir, + agent: { command: process.execPath, args: [FAKE_AGENT_PATH] }, + permissionMode: "full", + permissionEscalation: null, + workspaceWriteRoots: [workspaceDir], + envVars: { + FAKE_ACP_LOAD_SESSION: "1", + FAKE_ACP_REPLAY_UPDATES: "1", + // Widens the in-flight window so the second import's spawn + + // initialize reliably lands before the first import's session/load + // resolves, in case the reservation regresses. + FAKE_ACP_LOAD_SESSION_DELAY_MS: "200", + }, + }); + const secondImportId = sendRequest("thread/import", { + threadId: "thread-import-race-2", + providerThreadId: "external-sess-race", + cwd: workspaceDir, + agent: { command: process.execPath, args: [FAKE_AGENT_PATH] }, + permissionMode: "full", + permissionEscalation: null, + workspaceWriteRoots: [workspaceDir], + envVars: { FAKE_ACP_LOAD_SESSION: "1" }, + }); + + const [firstResponse, secondResponse] = await Promise.all([ + waitForResponse(firstImportId), + waitForResponse(secondImportId), + ]); + + const candidates = [ + { threadId: "thread-import-race-1", response: firstResponse }, + { threadId: "thread-import-race-2", response: secondResponse }, + ]; + const winner = candidates.find( + ({ response }) => response.result !== undefined, + ); + const loser = candidates.find(({ response }) => response.error !== undefined); + // Exactly one request wins the binding; the reservation must stop the + // other before it ever forwards a session/load replay, instead of both + // racing session/load and one persisting a partial history copy. + expect(winner).toBeDefined(); + expect(loser).toBeDefined(); + expect(winner?.response.result).toEqual({ + providerThreadId: "external-sess-race", + }); + startedProviderThreadIds.push("external-sess-race"); + expect(loser?.response.error?.message).toMatch( + new RegExp( + `already (bound to|being loaded by) bb thread "${winner?.threadId}"`, + ), + ); + const loserUpdates = notifications("acp/update").filter( + (message) => + (message.params as { threadId?: string } | undefined)?.threadId === + loser?.threadId, + ); + expect(loserUpdates).toHaveLength(0); + const loserCompletions = notifications("acp/turn/completed").filter( + (message) => + (message.params as { threadId?: string } | undefined)?.threadId === + loser?.threadId, + ); + expect(loserCompletions).toHaveLength(0); + }); + it("reports unexpected agent exits as a single provider error", async () => { const { bbThreadId, providerThreadId } = await startThread(); const turnId = sendRequest("turn/start", { diff --git a/packages/agent-runtime/src/acp/bridge/bridge.ts b/packages/agent-runtime/src/acp/bridge/bridge.ts index 149571617a..972fa21ef8 100644 --- a/packages/agent-runtime/src/acp/bridge/bridge.ts +++ b/packages/agent-runtime/src/acp/bridge/bridge.ts @@ -55,6 +55,7 @@ import { type AcpBridgeNativeReasoning, type AcpBridgePermissionCli, type AcpBridgeReasoningCli, + type AcpBridgeThreadImportParams, type AcpBridgeThreadResumeParams, type AcpBridgeThreadStartParams, } from "../bridge-protocol.js"; @@ -126,6 +127,19 @@ interface AcpThreadSession { promptActive: boolean; queuedInputs: PromptInput[][]; loading: boolean; + /** + * True for sessions opened via thread/import: session/update notifications + * replayed while `loading` are forwarded (marked historical) instead of + * being dropped. + */ + importing: boolean; + /** + * Set once a replayed session/update has been forwarded during import. If + * session/load then fails, the adapter has already opened a synthetic + * historical turn from that update, so the import failure path must close + * it with a historical turn/completed before reporting the error. + */ + historicalReplayForwarded: boolean; stopping: boolean; /** Resolves when the in-flight bb turn loop fully settles. */ turnSettled: Promise<void> | undefined; @@ -134,6 +148,15 @@ interface AcpThreadSession { const sessionsByBbThreadId = new Map<string, AcpThreadSession>(); const bbThreadIdByProviderThreadId = new Map<string, string>(); +/** + * Reservation table for a reused provider session id between the pre-load + * unbound check and the permanent bbThreadIdByProviderThreadId binding. + * Without this, two concurrent thread/import (or thread/resume) requests for + * the same provider session both pass the pre-load check (neither is bound + * yet) and both forward the replay. Claimed right before session/load goes + * out and released on any failure path or once the binding is permanent. + */ +const pendingProviderThreadIds = new Map<string, string>(); const pendingRuntimeRequests = new Map< number, (response: BridgeJsonRpcResponse) => void @@ -377,6 +400,11 @@ const ACP_DEFAULT_MODEL: AvailableModel = { }; const MODEL_LIST_TIMEOUT_MS = 30_000; +// Bounded well below the server's COMMAND_TIMEOUT_MS (30s): this probe runs +// concurrently with the CLI catalog fetch on every model/list call for a +// CLI-list agent, so a slow/hanging agent initialize must not push an +// otherwise-fast catalog reply out to the server's timeout boundary. +const SESSION_IMPORT_CAPABILITY_PROBE_TIMEOUT_MS = 10_000; const ACP_NATIVE_REASONING_DISCOVERY_TIMEOUT_MS = 5_000; const AUTH_REQUIRED_MODEL_LIST_ERROR_MESSAGE = "ACP agent is not authenticated."; @@ -384,10 +412,7 @@ const AUTH_REQUIRED_MODEL_LIST_ERROR_MESSAGE = function reasoningSupportFromCli( reasoningCli: AcpBridgeReasoningCli | undefined, ): - | Pick< - AvailableModel, - "supportedReasoningEfforts" | "defaultReasoningEffort" - > + | Pick<AvailableModel, "supportedReasoningEfforts" | "defaultReasoningEffort"> | undefined { if (reasoningCli === undefined) { return undefined; @@ -409,10 +434,7 @@ function reasoningSupportFromCli( function reasoningSupportFromNativeHint( nativeReasoning: AcpBridgeNativeReasoning | undefined, ): - | Pick< - AvailableModel, - "supportedReasoningEfforts" | "defaultReasoningEffort" - > + | Pick<AvailableModel, "supportedReasoningEfforts" | "defaultReasoningEffort"> | undefined { if (nativeReasoning === undefined) { return undefined; @@ -505,8 +527,7 @@ function nativeReasoningLevelToValue(args: { nativeReasoning: AcpBridgeNativeReasoning; reasoningLevel: ReasoningLevel; }): string | undefined { - const override = - args.nativeReasoning.levelValues?.[args.reasoningLevel]; + const override = args.nativeReasoning.levelValues?.[args.reasoningLevel]; if (override !== undefined) { return override; } @@ -571,7 +592,10 @@ function applyPermissionCliArgs( permissionCli: AcpBridgePermissionCli | undefined, permissionMode: AcpSessionPolicy["permissionMode"], ): string[] { - const permissionArgs = permissionCliArgsForMode(permissionCli, permissionMode); + const permissionArgs = permissionCliArgsForMode( + permissionCli, + permissionMode, + ); if (permissionArgs.length === 0) { return [...agentArgs]; } @@ -613,6 +637,38 @@ let cachedSessionDiscoveredModels: { models: AvailableModel[]; fetchedAt: number; } | null = null; +// Populated alongside session model discovery from the same `initialize` +// handshake, so a model/list caller learns whether this agent binary really +// supports `session/load` (thread/import's actual gate) instead of trusting +// the static ACP-family capability constant. +let cachedAcpAgentSupportsSessionImport: { + key: string; + // undefined means the probe ran but couldn't learn the capability (agent + // failed to spawn, initialize errored, or the probe timed out). Still + // cached with a fetchedAt so a broken agent is retried at most once per + // TTL instead of on every model/list call. + supportsSessionImport: boolean | undefined; + fetchedAt: number; +} | null = null; + +/** + * Both caches are learned from the same `initialize`/`session/new` handshake + * and share the same TTL, so keep their freshness in lockstep: whenever the + * model cache is (re)written for `key`, re-stamp the capability cache entry + * for the same key so it doesn't expire first and silently degrade + * model/list's supportsSessionImport gate in the window between the two. + */ +function restampSessionImportCapabilityCache( + key: string, + fetchedAt: number, +): void { + if (cachedAcpAgentSupportsSessionImport?.key === key) { + cachedAcpAgentSupportsSessionImport = { + ...cachedAcpAgentSupportsSessionImport, + fetchedAt, + }; + } +} function resolveAcpAuthMethodId( authMethods: readonly { id: string }[] | undefined, @@ -719,6 +775,7 @@ async function loadSessionDiscoveredModels( Date.now() - cachedSessionDiscoveredModels.fetchedAt < SESSION_MODEL_DISCOVERY_TTL_MS ) { + restampSessionImportCapabilityCache(key, Date.now()); return cachedSessionDiscoveredModels.models; } @@ -765,6 +822,12 @@ async function loadSessionDiscoveredModels( }, resultSchema: acpInitializeResultSchema, }); + cachedAcpAgentSupportsSessionImport = { + key, + supportsSessionImport: + initializeResult.agentCapabilities?.loadSession ?? false, + fetchedAt: Date.now(), + }; await authenticateAcpAgent({ connection, env: childEnv, @@ -791,11 +854,9 @@ async function loadSessionDiscoveredModels( } if (configOptionModels.length === 0) { - cachedSessionDiscoveredModels = { - key, - models: sessionModels, - fetchedAt: Date.now(), - }; + const fetchedAt = Date.now(); + cachedSessionDiscoveredModels = { key, models: sessionModels, fetchedAt }; + restampSessionImportCapabilityCache(key, fetchedAt); return sessionModels; } @@ -808,11 +869,9 @@ async function loadSessionDiscoveredModels( reasoningByModel === null ? configOptionModels : buildModelCatalogFromConfigOptions(modelOption, reasoningByModel); - cachedSessionDiscoveredModels = { - key, - models, - fetchedAt: Date.now(), - }; + const fetchedAt = Date.now(); + cachedSessionDiscoveredModels = { key, models, fetchedAt }; + restampSessionImportCapabilityCache(key, fetchedAt); return models; } catch (error) { process.stderr.write( @@ -829,6 +888,117 @@ async function loadSessionDiscoveredModels( } } +/** + * Populate the session/load capability cache with a bare `initialize` + * handshake, no `session/new`. For agents whose model list comes from a CLI + * command (loadAgentModelCatalog), the full session-discovery flow in + * loadSessionDiscoveredModels is never run (the catalog already has the + * models), so without this the capability cache never gets populated for + * them and model/list silently omits supportsSessionImport forever. A no-op + * when the cache already has a fresh entry for this exact agent launch. + */ +async function probeAcpAgentSupportsSessionImportOnly( + agent: AcpBridgeAgentCommand, +): Promise<void> { + const key = JSON.stringify(agent); + if ( + cachedAcpAgentSupportsSessionImport?.key === key && + Date.now() - cachedAcpAgentSupportsSessionImport.fetchedAt < + SESSION_MODEL_DISCOVERY_TTL_MS + ) { + return; + } + const connection = createAcpAgentConnection({ + command: agent.command, + args: agent.args, + cwd: agent.cwd ?? process.cwd(), + env: { + ...withoutBridgeRuntimeEnv(process.env), + ...(agent.envVars ?? {}), + }, + onNotification: () => {}, + onRequest: (_method, _params, responder) => { + responder.error(-32601, "ACP model discovery does not support requests"); + }, + onExit: () => {}, + }); + let timeout: ReturnType<typeof setTimeout> | undefined; + const timeoutReached = new Promise<never>((_, reject) => { + timeout = setTimeout(() => { + connection.kill(); + reject( + new Error( + `ACP session/load capability probe timed out after ${SESSION_IMPORT_CAPABILITY_PROBE_TIMEOUT_MS}ms`, + ), + ); + }, SESSION_IMPORT_CAPABILITY_PROBE_TIMEOUT_MS); + }); + try { + await Promise.race([ + connection + .request({ + method: "initialize", + params: { + protocolVersion: ACP_PROTOCOL_VERSION, + clientInfo: { name: "bb", version: "1.0.0" }, + clientCapabilities: { + fs: { readTextFile: false, writeTextFile: false }, + terminal: false, + }, + }, + resultSchema: acpInitializeResultSchema, + }) + .then((initializeResult) => { + cachedAcpAgentSupportsSessionImport = { + key, + supportsSessionImport: + initializeResult.agentCapabilities?.loadSession ?? false, + fetchedAt: Date.now(), + }; + }), + timeoutReached, + ]); + } catch (error) { + process.stderr.write( + `acp bridge: session/load capability probe for "${agent.command}" failed: ${ + error instanceof Error ? error.message : String(error) + }\n`, + ); + // Cache the failure too (as "unknown"), so a broken or slow agent is + // probed at most once per TTL instead of respawned on every model/list. + cachedAcpAgentSupportsSessionImport = { + key, + supportsSessionImport: undefined, + fetchedAt: Date.now(), + }; + } finally { + if (timeout !== undefined) { + clearTimeout(timeout); + } + connection.kill(); + } +} + +/** + * The loadSession capability learned from the most recent `initialize` + * handshake for this exact agent launch, if it's still within the model + * discovery TTL. Undefined when no live handshake has happened yet (or it's + * gone stale) — callers must treat that as "unknown", not "false". + */ +function getCachedAcpAgentSupportsSessionImport( + agent: AcpBridgeAgentCommand, +): boolean | undefined { + const key = JSON.stringify(agent); + if ( + cachedAcpAgentSupportsSessionImport?.key === key && + Date.now() - cachedAcpAgentSupportsSessionImport.fetchedAt < + SESSION_MODEL_DISCOVERY_TTL_MS + ) { + return cachedAcpAgentSupportsSessionImport.supportsSessionImport; + } + return undefined; +} + async function discoverAcpNativeReasoningByModel(args: { connection: AcpAgentConnection; sessionId: string; @@ -1438,9 +1608,65 @@ function getSessionByProviderThreadId( return bbThreadId ? sessionsByBbThreadId.get(bbThreadId) : undefined; } +/** + * Defense in depth against two bb threads binding the same provider session: + * the server already refuses this at import time, but this process-local map + * is the actual turn-routing table (getSessionByProviderThreadId), so an + * overwrite here would silently steal routing from the other live session + * instead of failing loudly. Called as soon as a reused provider session id + * is known, before any notification is sent for it, so a rejected session + * never emits history/turn framing for a bb thread it will not end up bound + * to. + */ +function assertProviderSessionUnboundElsewhere( + bbThreadId: string, + providerThreadId: string, +): void { + const pendingOwnerThreadId = pendingProviderThreadIds.get(providerThreadId); + if (pendingOwnerThreadId !== undefined && pendingOwnerThreadId !== bbThreadId) { + throw new Error( + `ACP provider session "${providerThreadId}" is already being loaded by bb thread "${pendingOwnerThreadId}"`, + ); + } + const boundToOtherThreadId = + bbThreadIdByProviderThreadId.get(providerThreadId); + if ( + boundToOtherThreadId === undefined || + boundToOtherThreadId === bbThreadId + ) { + return; + } + const otherSession = sessionsByBbThreadId.get(boundToOtherThreadId); + if (otherSession && !otherSession.stopping) { + throw new Error( + `ACP provider session "${providerThreadId}" is already bound to bb thread "${boundToOtherThreadId}"`, + ); + } +} + type AcpSessionStartParams = | { kind: "start"; params: AcpBridgeThreadStartParams } - | { kind: "resume"; params: AcpBridgeThreadResumeParams }; + | { kind: "resume"; params: AcpBridgeThreadResumeParams } + | { kind: "import"; params: AcpBridgeThreadImportParams }; + +/** + * Release a pendingProviderThreadIds claim made before session/load went + * out. Safe to call unconditionally on every exit path (success or + * failure): a no-op for "start" sessions and for a claim this bb thread no + * longer owns. + */ +function releasePendingProviderThreadIdReservation( + request: AcpSessionStartParams, + bbThreadId: string, +): void { + if (request.kind === "start") { + return; + } + const { providerThreadId } = request.params; + if (pendingProviderThreadIds.get(providerThreadId) === bbThreadId) { + pendingProviderThreadIds.delete(providerThreadId); + } +} async function startAgentSession( request: AcpSessionStartParams, @@ -1509,6 +1735,8 @@ async function startAgentSession( promptActive: false, queuedInputs: [], loading: false, + importing: request.kind === "import", + historicalReplayForwarded: false, stopping: false, turnSettled: undefined, pendingPermissions: new Set(), @@ -1538,10 +1766,29 @@ async function startAgentSession( initializeResult.agentCapabilities?.loadSession ?? false; const mcpServers = await buildSessionMcpServers(params); + if (request.kind === "import" && !supportsLoadSession) { + // An import without session/load would silently degrade to a fresh + // history-less session, defeating the whole operation. Fail loudly. + throw new Error( + `ACP agent "${agentLabel}" does not support session/load, so it ` + + "cannot import an existing session.", + ); + } + let sessionId: string | undefined; let loadedConfigOptions: readonly AcpConfigOption[] | undefined; let loadedModels: AcpSessionModels | undefined; - if (request.kind === "resume" && supportsLoadSession) { + if (request.kind !== "start" && supportsLoadSession) { + // Checked before the session/load request goes out (the reused id is + // already known from params): a session this bb thread will not end + // up bound to must not emit history/turn framing for it first. The + // outer catch below closes any historical replay that still slips + // through a race on the re-check after session/load resolves. + assertProviderSessionUnboundElsewhere( + bbThreadId, + request.params.providerThreadId, + ); + pendingProviderThreadIds.set(request.params.providerThreadId, bbThreadId); session.loading = true; try { const configState = await connection.request({ @@ -1556,11 +1803,33 @@ async function startAgentSession( loadedConfigOptions = configState?.configOptions; loadedModels = configState?.models; sessionId = request.params.providerThreadId; - } catch { + } catch (error) { + if (request.kind === "import") { + throw new Error( + `ACP agent "${agentLabel}" failed to load session ` + + `"${request.params.providerThreadId}": ` + + `${error instanceof Error ? error.message : String(error)}`, + ); + } sessionId = undefined; } finally { session.loading = false; } + // Re-checked here for races: another import could have bound this + // provider session id while session/load was in flight. + if (sessionId !== undefined) { + assertProviderSessionUnboundElsewhere(bbThreadId, sessionId); + } + if (request.kind === "import" && sessionId !== undefined) { + // The agent replays the imported history as session/update + // notifications before answering session/load; close the historical + // frame so the adapter completes the synthetic replay turn. + sendNotification(ACP_TURN_COMPLETED_METHOD, { + threadId: bbThreadId, + stopReason: "end_turn", + historical: true, + }); + } } if (sessionId === undefined) { @@ -1595,15 +1864,31 @@ async function startAgentSession( }); } + // Re-checked here too: the branch above only covers a reused (session/load) + // id, and this covers the freshly created (session/new) id as well. + assertProviderSessionUnboundElsewhere(bbThreadId, sessionId); + session.providerThreadId = sessionId; sessionsByBbThreadId.set(bbThreadId, session); bbThreadIdByProviderThreadId.set(sessionId, bbThreadId); + releasePendingProviderThreadIdReservation(request, bbThreadId); sendNotification("thread/identity", { threadId: bbThreadId, providerThreadId: sessionId, }); return session; } catch (error) { + releasePendingProviderThreadIdReservation(request, bbThreadId); + if (session.historicalReplayForwarded) { + // A replay was already forwarded (and the adapter opened a synthetic + // historical turn from it) before this failure; close that turn here + // regardless of which throw triggered it, or it stays open forever. + sendNotification(ACP_TURN_COMPLETED_METHOD, { + threadId: bbThreadId, + stopReason: "cancelled", + historical: true, + }); + } session.stopping = true; connection.kill(); removeSession(session); @@ -1726,16 +2011,26 @@ function handleAgentNotification( if (method !== "session/update") { return; } - if (session.loading || session.stopping) { + if (session.stopping) { + return; + } + // While session/load is in flight the agent replays the session's history. + // A resume drops that replay (bb already has the events); an import must + // persist it, so the updates are forwarded marked historical. + if (session.loading && !session.importing) { return; } const parsed = acpSessionNotificationParamsSchema.safeParse(params); if (!parsed.success) { return; } + if (session.loading) { + session.historicalReplayForwarded = true; + } sendNotification(ACP_UPDATE_METHOD, { threadId: session.bbThreadId, update: parsed.data.update, + ...(session.loading ? { historical: true } : {}), }); } @@ -1769,26 +2064,48 @@ async function handleRequest( return; case "model/list": { - const catalog = request.params.listCommand - ? await loadAgentModelCatalog(request.params.listCommand) - : null; + // Run concurrently: the CLI list exec and the ACP capability probe are + // independent. Without the probe, an agent with a CLI model list would + // never reach the session-discovery code below (the catalog already + // satisfies the request) and so would never get its live + // supportsSessionImport learned. + const [catalog] = await Promise.all([ + request.params.listCommand + ? loadAgentModelCatalog(request.params.listCommand) + : Promise.resolve(null), + request.params.listCommand && request.params.agent + ? probeAcpAgentSupportsSessionImportOnly(request.params.agent) + : Promise.resolve(), + ]); if (catalog) { - sendResult( - request.id, - splitPrimaryModels( + const supportsSessionImport = request.params.agent + ? getCachedAcpAgentSupportsSessionImport(request.params.agent) + : undefined; + sendResult(request.id, { + ...splitPrimaryModels( applyConfiguredReasoningToModels(catalog.models, { reasoningCli: request.params.reasoningCli, nativeReasoning: request.params.nativeReasoning, }), request.params.primaryModels, ), - ); + ...(supportsSessionImport !== undefined + ? { supportsSessionImport } + : {}), + }); return; } const sessionDiscoveredModels = request.params.listCommand === undefined && request.params.agent ? await loadSessionDiscoveredModels(request.params.agent) : null; + // Populated as a side effect of the same discovery spawn above (or a + // prior one still within TTL); undefined when no live handshake with + // this agent has happened yet. + const supportsSessionImport = + request.params.listCommand === undefined && request.params.agent + ? getCachedAcpAgentSupportsSessionImport(request.params.agent) + : undefined; if (sessionDiscoveredModels) { sendResult(request.id, { models: applyConfiguredReasoningToModels(sessionDiscoveredModels, { @@ -1796,6 +2113,9 @@ async function handleRequest( nativeReasoning: request.params.nativeReasoning, }), selectedOnlyModels: [], + ...(supportsSessionImport !== undefined + ? { supportsSessionImport } + : {}), }); return; } @@ -1807,6 +2127,9 @@ async function handleRequest( }), ], selectedOnlyModels: [], + ...(supportsSessionImport !== undefined + ? { supportsSessionImport } + : {}), }); return; } @@ -1828,6 +2151,14 @@ async function handleRequest( sendResult(request.id, { providerThreadId: session.providerThreadId }); return; } + case "thread/import": { + const session = await startAgentSession({ + kind: "import", + params: request.params, + }); + sendResult(request.id, { providerThreadId: session.providerThreadId }); + return; + } case "turn/start": { const session = getSessionByProviderThreadId(request.params.threadId); diff --git a/packages/agent-runtime/src/acp/bridge/fake-acp-agent.mjs b/packages/agent-runtime/src/acp/bridge/fake-acp-agent.mjs index 6f8bc3374e..447cd1b2f1 100755 --- a/packages/agent-runtime/src/acp/bridge/fake-acp-agent.mjs +++ b/packages/agent-runtime/src/acp/bridge/fake-acp-agent.mjs @@ -9,6 +9,21 @@ * * Env knobs (passed by tests through thread/start envVars): * - FAKE_ACP_LOAD_SESSION=1 → advertise + accept session/load + * - FAKE_ACP_LOAD_SESSION_ERROR=1 + * → advertise session/load but fail the request; + * combined with FAKE_ACP_REPLAY_UPDATES, replays + * a partial history before failing (mimics an + * agent that streams some updates, then errors) + * - FAKE_ACP_REPLAY_UPDATES=1 + * → replay a small scripted history as + * session/update notifications during + * session/load (mimics omp's full replay) + * - FAKE_ACP_REPLAY_DISTINCT_USER_MESSAGES=1 + * → with FAKE_ACP_REPLAY_UPDATES, replay two + * separate user_message_chunk messages (each + * its own messageId, one split across chunks) + * instead of one, mimicking omp tagging every + * replayed history entry with a fresh messageId * - FAKE_ACP_MODEL_CONFIG=1 → advertise a model configOptions select * - FAKE_ACP_MODELS_FIELD=1 → advertise legacy ACP models state * - FAKE_ACP_THOUGHT_LEVEL_CONFIG=1 @@ -25,12 +40,20 @@ * - FAKE_ACP_WRITE_PATH → target path for the "write-file" prompt * - FAKE_ACP_LAUNCH_LOG → append one line per process launch (used to * count model-discovery spawns in cache/TTL tests) + * - FAKE_ACP_LOAD_SESSION_DELAY_MS=<n> + * → wait n ms before responding to session/load + * (widens the in-flight window for concurrent + * import race tests) */ import { createInterface } from "node:readline"; import { appendFileSync, writeFileSync } from "node:fs"; const loadSession = process.env.FAKE_ACP_LOAD_SESSION === "1"; +const loadSessionError = process.env.FAKE_ACP_LOAD_SESSION_ERROR === "1"; +const replayUpdates = process.env.FAKE_ACP_REPLAY_UPDATES === "1"; +const replayDistinctUserMessages = + process.env.FAKE_ACP_REPLAY_DISTINCT_USER_MESSAGES === "1"; const modelConfig = process.env.FAKE_ACP_MODEL_CONFIG === "1"; const modelsField = process.env.FAKE_ACP_MODELS_FIELD === "1"; const thoughtLevelConfig = process.env.FAKE_ACP_THOUGHT_LEVEL_CONFIG === "1"; @@ -38,6 +61,9 @@ const acceptNativeReasoning = process.env.FAKE_ACP_ACCEPT_NATIVE_REASONING === "1"; const setConfigModelError = process.env.FAKE_ACP_SET_CONFIG_MODEL_ERROR === "1"; const hangInitialize = process.env.FAKE_ACP_HANG_INITIALIZE === "1"; +const loadSessionDelayMs = Number( + process.env.FAKE_ACP_LOAD_SESSION_DELAY_MS ?? "0", +); const authMethods = (process.env.FAKE_ACP_AUTH_METHODS ?? "") .split(",") .map((method) => method.trim()) @@ -94,6 +120,31 @@ function notifyUpdate(update) { }); } +function notifyReplayedUserMessages() { + if (!replayDistinctUserMessages) { + notifyUpdate({ + sessionUpdate: "user_message_chunk", + content: { type: "text", text: "replayed-user" }, + }); + return; + } + notifyUpdate({ + sessionUpdate: "user_message_chunk", + content: { type: "text", text: "Hello " }, + messageId: "replay-msg-1", + }); + notifyUpdate({ + sessionUpdate: "user_message_chunk", + content: { type: "text", text: "world" }, + messageId: "replay-msg-1", + }); + notifyUpdate({ + sessionUpdate: "user_message_chunk", + content: { type: "text", text: "Fix the bug" }, + messageId: "replay-msg-2", + }); +} + function messageChunk(text) { return { sessionUpdate: "agent_message_chunk", @@ -356,8 +407,35 @@ async function handleMessage(message) { if (!requireAuthenticated(message)) { return; } - if (loadSession) { + if (loadSessionDelayMs > 0) { + await sleep(loadSessionDelayMs); + } + if (loadSession && loadSessionError) { + // A replay that then fails still needs to exercise the replayed + // updates: the agent may stream part of the history before hitting + // whatever made it fail. + if (replayUpdates) { + notifyReplayedUserMessages(); + notifyUpdate(messageChunk("replayed-agent")); + } + send({ + jsonrpc: "2.0", + id: message.id, + error: { code: -32603, message: "session storage corrupted" }, + }); + } else if (loadSession) { captureMcpServers(message); + if (replayUpdates) { + notifyReplayedUserMessages(); + notifyUpdate(messageChunk("replayed-agent")); + notifyUpdate({ + sessionUpdate: "tool_call", + toolCallId: "replay-tool-1", + title: "Replayed tool", + kind: "execute", + status: "completed", + }); + } send({ jsonrpc: "2.0", id: message.id, result: configState() }); } else { send({ diff --git a/packages/agent-runtime/src/acp/wire.ts b/packages/agent-runtime/src/acp/wire.ts index d7c5d985e5..c4348e19ee 100644 --- a/packages/agent-runtime/src/acp/wire.ts +++ b/packages/agent-runtime/src/acp/wire.ts @@ -119,6 +119,20 @@ export const acpAgentMessageChunkUpdateSchema = z }) .passthrough(); +/** + * Replayed user input; agents only send these while loading a session. + * `messageId` is an optional per-agent extension (e.g. omp) that tags each + * replayed history entry; a change in messageId across consecutive chunks + * means a new message started rather than a continuation. + */ +export const acpUserMessageChunkUpdateSchema = z + .object({ + sessionUpdate: z.literal("user_message_chunk"), + content: acpContentBlockSchema, + messageId: z.string().optional(), + }) + .passthrough(); + export const acpAgentThoughtChunkUpdateSchema = z .object({ sessionUpdate: z.literal("agent_thought_chunk"), diff --git a/packages/agent-runtime/src/claude-code/adapter.test.ts b/packages/agent-runtime/src/claude-code/adapter.test.ts index c8997d39d3..d99c89adc7 100644 --- a/packages/agent-runtime/src/claude-code/adapter.test.ts +++ b/packages/agent-runtime/src/claude-code/adapter.test.ts @@ -172,6 +172,7 @@ describe("claude-code provider adapter", () => { supportsServiceTier: false, supportsUserQuestion: true, supportsFork: true, + supportsSessionImport: false, supportedPermissionModes: ["accept-edits", "auto", "full"], }); }); diff --git a/packages/agent-runtime/src/claude-code/adapter.ts b/packages/agent-runtime/src/claude-code/adapter.ts index eaa131e77c..330cd265be 100644 --- a/packages/agent-runtime/src/claude-code/adapter.ts +++ b/packages/agent-runtime/src/claude-code/adapter.ts @@ -1237,6 +1237,12 @@ export function createClaudeCodeProviderAdapter( : {}), }, }; + case "thread/import": + // ACP-only operation; the server gates on supportsSessionImport, so + // this is unreachable unless that guard is bypassed. + throw new Error( + `Provider "${providerInfo.id}" does not support importing external sessions.`, + ); case "thread/fork": { finishOpenProviderTurn({ registry: turnState, diff --git a/packages/agent-runtime/src/codex/adapter.test.ts b/packages/agent-runtime/src/codex/adapter.test.ts index b491d1fce6..fda5497836 100644 --- a/packages/agent-runtime/src/codex/adapter.test.ts +++ b/packages/agent-runtime/src/codex/adapter.test.ts @@ -326,6 +326,7 @@ describe("codex provider adapter", () => { supportsServiceTier: true, supportsUserQuestion: false, supportsFork: true, + supportsSessionImport: false, supportedPermissionModes: ["accept-edits", "auto", "full"], }); }); diff --git a/packages/agent-runtime/src/codex/adapter.ts b/packages/agent-runtime/src/codex/adapter.ts index ea4d9a0999..72f6bf9525 100644 --- a/packages/agent-runtime/src/codex/adapter.ts +++ b/packages/agent-runtime/src/codex/adapter.ts @@ -1938,6 +1938,12 @@ export function createCodexProviderAdapter( params, }; } + case "thread/import": + // ACP-only operation; the server gates on supportsSessionImport, so + // this is unreachable unless that guard is bypassed. + throw new Error( + `Provider "${providerInfo.id}" does not support importing external sessions.`, + ); case "thread/fork": { const dynamicTools = toCodexDynamicTools(command.dynamicTools); const preparedGitRoots = prepareWorkspaceWriteGitRoots({ command }); diff --git a/packages/agent-runtime/src/pi/adapter.test.ts b/packages/agent-runtime/src/pi/adapter.test.ts index dc31932a70..1d9afad072 100644 --- a/packages/agent-runtime/src/pi/adapter.test.ts +++ b/packages/agent-runtime/src/pi/adapter.test.ts @@ -190,6 +190,7 @@ describe("pi provider adapter", () => { supportsServiceTier: false, supportsUserQuestion: false, supportsFork: true, + supportsSessionImport: false, supportedPermissionModes: ["full"], }); }); diff --git a/packages/agent-runtime/src/pi/adapter.ts b/packages/agent-runtime/src/pi/adapter.ts index ac2b4d974a..e4b88a5fc5 100644 --- a/packages/agent-runtime/src/pi/adapter.ts +++ b/packages/agent-runtime/src/pi/adapter.ts @@ -1389,6 +1389,12 @@ export function createPiProviderAdapter( ), }, }; + case "thread/import": + // ACP-only operation; the server gates on supportsSessionImport, so + // this is unreachable unless that guard is bypassed. + throw new Error( + "Provider \"pi\" does not support importing external sessions.", + ); case "thread/fork": { // Pi's provider identity == the bb threadId, so the source pi session // id is command.sourceProviderThreadId (the source bb thread id). The diff --git a/packages/agent-runtime/src/provider-adapter.ts b/packages/agent-runtime/src/provider-adapter.ts index d408a5c106..9db9e4eb45 100644 --- a/packages/agent-runtime/src/provider-adapter.ts +++ b/packages/agent-runtime/src/provider-adapter.ts @@ -23,6 +23,12 @@ import type { HostDaemonAcpLaunchSpec } from "@bb/host-daemon-contract"; export interface ProviderTranslationContext { threadId?: string; parentToolCallId?: string; + /** + * True when the event replays history from an imported provider session. + * Translated turn-framing events are marked historical so neither the + * runtime nor the server applies turn-lifecycle side effects to them. + */ + historical?: boolean; } export interface ProviderAcceptedCommandTranslationArgs { @@ -158,6 +164,17 @@ export type AdapterCommand = disallowedTools?: readonly string[]; instructionMode: InstructionMode; } + | { + type: "thread/import"; + threadId: string; + cwd: string; + /** External session id supplied by the caller, not minted by bb. */ + providerThreadId: string; + options: ProviderExecutionContext; + dynamicTools?: DynamicTool[]; + disallowedTools?: readonly string[]; + instructionMode: InstructionMode; + } | { type: "turn/start"; threadId: string; @@ -261,6 +278,11 @@ export interface ProviderAdapter { parseModelListResult(result: unknown): { models: AvailableModel[]; selectedOnlyModels: AvailableModel[]; + /** + * Live per-agent capability from the ACP `initialize` handshake + * (agentCapabilities.loadSession). Only ACP adapters ever set this. + */ + supportsSessionImport?: boolean; }; translateEvent( event: ProviderRuntimeEvent, diff --git a/packages/agent-runtime/src/runtime-json-rpc.test.ts b/packages/agent-runtime/src/runtime-json-rpc.test.ts index 2b3eabb434..9c1739cd99 100644 --- a/packages/agent-runtime/src/runtime-json-rpc.test.ts +++ b/packages/agent-runtime/src/runtime-json-rpc.test.ts @@ -1,7 +1,10 @@ import { spawn, type ChildProcess } from "node:child_process"; import { setTimeout as delay } from "node:timers/promises"; -import { describe, it } from "vitest"; -import { sendJsonRpcResult } from "./runtime-json-rpc.js"; +import { describe, expect, it } from "vitest"; +import { + formatJsonRpcErrorMessage, + sendJsonRpcResult, +} from "./runtime-json-rpc.js"; const EPIPE_PAYLOAD_SIZE = 1024 * 1024; @@ -28,6 +31,55 @@ function waitForChildExit(child: ChildProcess): Promise<void> { }); } +describe("formatJsonRpcErrorMessage", () => { + it("appends string details from error.data objects", () => { + expect( + formatJsonRpcErrorMessage({ + code: -32603, + message: "Internal error", + data: { details: "ACP session not found: 019fb4b0" }, + }), + ).toBe("Internal error: ACP session not found: 019fb4b0"); + }); + + it("appends plain-string error.data", () => { + expect( + formatJsonRpcErrorMessage({ + code: -32000, + message: "Load failed", + data: "missing rollout file", + }), + ).toBe("Load failed: missing rollout file"); + }); + + it("does not duplicate details already present in the message", () => { + expect( + formatJsonRpcErrorMessage({ + code: -32000, + message: "Load failed: missing rollout file", + data: { details: "missing rollout file" }, + }), + ).toBe("Load failed: missing rollout file"); + }); + + it("keeps the bare message when data carries no string details", () => { + expect( + formatJsonRpcErrorMessage({ + code: -32603, + message: "Internal error", + data: { retryable: false }, + }), + ).toBe("Internal error"); + expect( + formatJsonRpcErrorMessage({ code: -32603, message: "Internal error" }), + ).toBe("Internal error"); + }); + + it("stringifies non-object errors", () => { + expect(formatJsonRpcErrorMessage("boom")).toBe('"boom"'); + }); +}); + describe("runtime JSON-RPC transport", () => { it("does not surface closed provider stdin errors as unhandled process errors", async () => { const child = spawn( diff --git a/packages/agent-runtime/src/runtime-json-rpc.ts b/packages/agent-runtime/src/runtime-json-rpc.ts index dafc0349e7..eec96f3c89 100644 --- a/packages/agent-runtime/src/runtime-json-rpc.ts +++ b/packages/agent-runtime/src/runtime-json-rpc.ts @@ -143,13 +143,30 @@ function isJsonRpcId(value: unknown): value is string | number { return typeof value === "string" || typeof value === "number"; } -function formatJsonRpcErrorMessage(error: unknown): string { +export function formatJsonRpcErrorMessage(error: unknown): string { if (isJsonRpcObject(error) && typeof error.message === "string") { + const details = extractJsonRpcErrorDetails(error.data); + if (details !== undefined && !error.message.includes(details)) { + return `${error.message}: ${details}`; + } return error.message; } return JSON.stringify(error); } +// Agents often put the actionable diagnostic in error.data (omp acp reports +// session/load failures as {message: "Internal error", data: {details: ...}}); +// surfacing only the top-level message hides it from thread logs and the API. +function extractJsonRpcErrorDetails(data: unknown): string | undefined { + if (typeof data === "string" && data.length > 0) { + return data; + } + if (isJsonRpcObject(data) && typeof data.details === "string" && data.details.length > 0) { + return data.details; + } + return undefined; +} + function isClosedJsonRpcStdinError(error: Error): boolean { return ( "code" in error && @@ -242,6 +259,18 @@ export function getJsonRpcStringParam( return typeof value === "string" ? value : undefined; } +export function getJsonRpcBooleanParam( + message: JsonRpcObject, + key: string, +): boolean | undefined { + if (!isJsonRpcObject(message.params)) { + return undefined; + } + + const value = message.params[key]; + return typeof value === "boolean" ? value : undefined; +} + export function settleJsonRpcResponse(args: SettleJsonRpcResponseArgs): void { const pending = args.pending.get(args.id); if (!pending) { diff --git a/packages/agent-runtime/src/runtime.lifecycle.test.ts b/packages/agent-runtime/src/runtime.lifecycle.test.ts index 6b8d284a05..f6c519cc6c 100644 --- a/packages/agent-runtime/src/runtime.lifecycle.test.ts +++ b/packages/agent-runtime/src/runtime.lifecycle.test.ts @@ -1269,6 +1269,87 @@ rl.on("line", (line) => { }); }); + describe("session import historical replay bypass", () => { + it("persists historical replay without touching turn state, then runs a live turn normally", async () => { + const events: ThreadEvent[] = []; + const runtime = createAgentRuntimeWithAdapters({ + workspacePath: tmpDir, + onEvent: (e) => events.push(e), + onToolCall: async () => ({ + contentItems: [{ type: "inputText", text: "ok" }], + success: true, + }), + adapterFactory: () => createFakeAdapter(scriptPath), + }); + + const { providerThreadId } = await runtime.startThread({ + environmentId: "env-1", + threadId: "t-import", + projectId: "p1", + providerId: "fake", + options: fullRuntimeOptions, + sessionImport: { providerThreadId: "external-sess-1" }, + }); + expect(providerThreadId).toBe("external-sess-1"); + + await waitForThreadTurnStarted({ + events, + threadId: "t-import", + turnId: "historical-turn-1", + runtime, + }); + + // (a) the replayed turn/started reached onEvent, stamped historical. + const turnStartedEvents = events.filter( + (e) => e.type === "turn/started" && e.threadId === "t-import", + ); + expect(turnStartedEvents).toHaveLength(1); + expect(turnStartedEvents[0]).toMatchObject({ historical: true }); + + // (b) the replayed turn/started was never fed to turn state (no active + // turn), even though it was persisted for display above. A regression + // that lets historical events fall through to the live turn-observer + // path would report "historical-turn-1" as active here. + expect(runtime.getActiveTurnId("t-import")).toBeNull(); + + // (c) a subsequent live turn behaves normally: turn state, replay + // filtering, and completion all still work after the historical + // bypass, proving it didn't leave those state machines confused. + await runtime.runTurn({ + clientRequestId: "creq_333333334i", + threadId: "t-import", + input: [promptTextInput({ text: "delay:500" })], + options: fullRuntimeOptions, + }); + + await waitForThreadTurnStarted({ + events, + threadId: "t-import", + turnId: "turn-1", + runtime, + }); + expect(runtime.getActiveTurnId("t-import")).toBe("turn-1"); + + await waitForThreadTurnCompleted({ + events, + threadId: "t-import", + turnId: "turn-1", + runtime, + }); + expect(runtime.getActiveTurnId("t-import")).toBeNull(); + + const liveTurnStartedEvents = events.filter( + (e) => e.type === "turn/started" && e.threadId === "t-import", + ); + expect(liveTurnStartedEvents).toHaveLength(2); + expect(liveTurnStartedEvents[1]).not.toMatchObject({ + historical: true, + }); + + await runtime.shutdown(); + }); + }); + describe("models", () => { it("lists models", async () => { const runtime = createAgentRuntimeWithAdapters({ diff --git a/packages/agent-runtime/src/runtime.ts b/packages/agent-runtime/src/runtime.ts index 7b19008955..58e10c21c0 100644 --- a/packages/agent-runtime/src/runtime.ts +++ b/packages/agent-runtime/src/runtime.ts @@ -23,6 +23,7 @@ import { toProviderExecutionContext, } from "./execution-options.js"; import { + getJsonRpcBooleanParam, getJsonRpcStringParam, ignoredJsonRpcResultSchema, type JsonRpcObject, @@ -171,6 +172,12 @@ interface EmitTranslatedEventsArgs { events: ThreadEvent[]; proc: ProviderProcess; sourceThreadId?: string; + /** + * True when the events replay history from an imported provider session. + * Historical events are persisted (onEvent) but bypass all live turn/state + * observers — they describe turns that never ran under this runtime. + */ + historical?: boolean; } interface EmitAcceptedCommandEventsArgs { @@ -880,6 +887,14 @@ function createAgentRuntimeInternal( threadId: resolvedBbThreadId, }); + if (args.historical) { + // Imported-history replay: persist for display, but never feed the + // live turn/background/idle/goal state machines with turns that were + // executed outside this runtime. + options.onEvent(normalizeProviderThreadNameEvent(stampedEvent)); + continue; + } + const replayResult = turnReplayFilter.observe(stampedEvent); if (replayResult.kind === "drop-replayed-turn-start") { options.onStderr?.( @@ -923,10 +938,16 @@ function createAgentRuntimeInternal( function handleProviderNotification(args: RuntimeParsedMessageArgs): void { const sourceThreadId = getJsonRpcStringParam(args.parsed, "threadId"); + // Set by the ACP bridge on session/update notifications replayed while + // importing an existing external session. + const historical = + getJsonRpcBooleanParam(args.parsed, "historical") === true; emitTranslatedEvents({ events: args.proc.adapter.translateEvent(args.parsed, { threadId: sourceThreadId, + ...(historical ? { historical } : {}), }), + ...(historical ? { historical } : {}), proc: args.proc, sourceThreadId, }); @@ -1014,6 +1035,7 @@ function createAgentRuntimeInternal( instructionMode = "append", outputSchema, fork, + sessionImport, }) { return runThreadOperation({ threadId, @@ -1084,16 +1106,27 @@ function createAgentRuntimeInternal( disallowedTools, instructionMode, } - : { - type: "thread/start", - threadId, - cwd: options.workspacePath, - options: providerExecutionContext, - dynamicTools, - disallowedTools, - instructionMode, - ...(outputSchema !== undefined ? { outputSchema } : {}), - }; + : sessionImport + ? { + type: "thread/import", + threadId, + cwd: options.workspacePath, + providerThreadId: sessionImport.providerThreadId, + options: providerExecutionContext, + dynamicTools, + disallowedTools, + instructionMode, + } + : { + type: "thread/start", + threadId, + cwd: options.workspacePath, + options: providerExecutionContext, + dynamicTools, + disallowedTools, + instructionMode, + ...(outputSchema !== undefined ? { outputSchema } : {}), + }; const cmd = requireProviderRequestPlan({ commandType: adapterCommand.type, plan: proc.adapter.buildCommandPlan(adapterCommand), diff --git a/packages/agent-runtime/src/shared/available-models.ts b/packages/agent-runtime/src/shared/available-models.ts index a9221c3400..6dda9db5a2 100644 --- a/packages/agent-runtime/src/shared/available-models.ts +++ b/packages/agent-runtime/src/shared/available-models.ts @@ -4,11 +4,16 @@ import { z } from "zod"; const modelListResultSchema = z.object({ models: z.array(availableModelSchema), selectedOnlyModels: z.array(availableModelSchema), + // Live per-agent capability from the ACP `initialize` handshake + // (agentCapabilities.loadSession). Only ACP bridges set this; absent for + // every other provider. + supportsSessionImport: z.boolean().optional(), }); export interface ParsedModelListResult { models: AvailableModel[]; selectedOnlyModels: AvailableModel[]; + supportsSessionImport?: boolean; } export function parseAvailableModelList( diff --git a/packages/agent-runtime/src/test/fake-adapter.ts b/packages/agent-runtime/src/test/fake-adapter.ts index cc4fb0c07e..46a434df62 100644 --- a/packages/agent-runtime/src/test/fake-adapter.ts +++ b/packages/agent-runtime/src/test/fake-adapter.ts @@ -19,6 +19,7 @@ import type { ProviderAdapter, ProviderCommandPlan, ProviderInteractiveResponse, + ProviderTranslationContext, } from "../provider-adapter.js"; import { flattenPromptInputGroups, @@ -130,6 +131,18 @@ function buildCommandPlan(command: AdapterCommand): ProviderCommandPlan { threadId: command.threadId, }, }; + case "thread/import": + return { + kind: "request", + method: "thread/import", + params: { + cwd: command.cwd, + dynamicTools: command.dynamicTools, + options: command.options, + providerThreadId: command.providerThreadId, + threadId: command.threadId, + }, + }; case "turn/start": return { kind: "request", @@ -286,7 +299,10 @@ function toFakeEventMessage( }; } -function translateEventMessage(event: ProviderRuntimeEvent): ThreadEvent[] { +function translateEventMessage( + event: ProviderRuntimeEvent, + context?: ProviderTranslationContext, +): ThreadEvent[] { const message = toFakeEventMessage(event); if (!message) { return []; @@ -300,6 +316,10 @@ function translateEventMessage(event: ProviderRuntimeEvent): ThreadEvent[] { typeof message.params.providerThreadId === "string" ? message.params.providerThreadId : ""; + // Mirrors the ACP adapter's markHistoricalTurnFraming: replayed history + // from an imported session is stamped historical so neither the runtime + // nor the server applies turn-lifecycle side effects to it. + const historical = context?.historical === true; switch (message.method) { case "thread/identity": @@ -318,6 +338,7 @@ function translateEventMessage(event: ProviderRuntimeEvent): ThreadEvent[] { threadId, providerThreadId, scope: turnScope(turnId), + ...(historical ? { historical } : {}), }, ]; case "turn/completed": { @@ -332,6 +353,7 @@ function translateEventMessage(event: ProviderRuntimeEvent): ThreadEvent[] { status === "failed" || status === "interrupted" ? status : "completed", + ...(historical ? { historical } : {}), }, ]; } @@ -469,6 +491,7 @@ export function createFakeAdapter( supportsServiceTier: false, supportsUserQuestion, supportsFork: true, + supportsSessionImport: false, supportedPermissionModes: ["accept-edits", "auto", "full"], }, decodeToolCallRequest, @@ -483,8 +506,8 @@ export function createFakeAdapter( args: buildNodeScriptArgs(options.scriptPath ?? fakeProviderScriptPath), command: "node", }, - translateEvent(event) { - return translateEventMessage(event); + translateEvent(event, context) { + return translateEventMessage(event, context); }, translateAcceptedCommand() { return []; diff --git a/packages/agent-runtime/src/test/fake-provider-script.ts b/packages/agent-runtime/src/test/fake-provider-script.ts index 6ed41cb3d0..43214487e8 100644 --- a/packages/agent-runtime/src/test/fake-provider-script.ts +++ b/packages/agent-runtime/src/test/fake-provider-script.ts @@ -421,6 +421,44 @@ function startOrResumeThread( } } +function importThread(message: JsonRecord): void { + const params = getParams(message); + const threadId = getString(params.threadId, "unknown"); + // Unlike thread/start or thread/resume, the caller already owns the + // provider session id being imported, so it's an input, not a fresh id. + const providerThreadId = + getString(params.providerThreadId) || `imported-${nextProviderThreadId++}`; + + threads.set(threadId, { + activeTurn: null, + providerThreadId, + turnCount: 0, + userMessageCount: 0, + }); + + send({ + jsonrpc: "2.0", + id: getJsonRpcId(message.id) ?? 0, + result: { providerThreadId }, + }); + + // Replay a bit of imported history as a historical turn/started, mirroring + // real ACP agents (e.g. omp) that replay session/update notifications + // before session/load answers. Deliberately left open (no matching + // turn/completed) so tests can assert the runtime's historical bypass + // never lets a replayed turn register as active. + send({ + jsonrpc: "2.0", + method: "turn/started", + params: { + threadId, + turnId: "historical-turn-1", + providerThreadId, + historical: true, + }, + }); +} + function handleToolResult(message: JsonRecord): boolean { const messageId = getJsonRpcId(message.id); if (messageId === undefined || typeof message.method === "string") { @@ -533,6 +571,11 @@ function handleMessage(message: JsonRecord): void { return; } + if (method === "thread/import") { + importThread(message); + return; + } + if (method === "turn/start") { startTurn(message); return; diff --git a/packages/agent-runtime/src/test/runtime-test-harness.ts b/packages/agent-runtime/src/test/runtime-test-harness.ts index b0b59be074..f34c2c93f2 100644 --- a/packages/agent-runtime/src/test/runtime-test-harness.ts +++ b/packages/agent-runtime/src/test/runtime-test-harness.ts @@ -211,6 +211,7 @@ export function createWarningEventAdapter(scriptPath: string): ProviderAdapter { supportsServiceTier: false, supportsUserQuestion: false, supportsFork: false, + supportsSessionImport: false, supportedPermissionModes: ["accept-edits", "auto", "full"], }, process: { @@ -248,6 +249,7 @@ export function createWarningEventAdapter(scriptPath: string): ProviderAdapter { }; case "thread/resume": case "thread/fork": + case "thread/import": case "skills/configure": case "turn/steer": case "thread/stop": @@ -323,6 +325,7 @@ export function createStartedEventAdapter(scriptPath: string): ProviderAdapter { supportsServiceTier: false, supportsUserQuestion: false, supportsFork: false, + supportsSessionImport: false, supportedPermissionModes: ["accept-edits", "auto", "full"], }, process: { @@ -352,6 +355,7 @@ export function createStartedEventAdapter(scriptPath: string): ProviderAdapter { }; case "thread/resume": case "thread/fork": + case "thread/import": case "skills/configure": case "turn/start": case "turn/steer": diff --git a/packages/agent-runtime/src/types.ts b/packages/agent-runtime/src/types.ts index c03b82de3c..916e45a165 100644 --- a/packages/agent-runtime/src/types.ts +++ b/packages/agent-runtime/src/types.ts @@ -166,6 +166,12 @@ export interface StartThreadArgs { * instead of starting fresh; absent means a normal start. */ fork?: { sourceProviderThreadId: string }; + /** + * Present means bind the new thread to this existing external provider + * session (ACP session import): the provider loads the session and replays + * its history as historical events. Absent means a normal start. + */ + sessionImport?: { providerThreadId: string }; } export interface StartThreadResult { @@ -306,6 +312,11 @@ export interface AgentRuntime { listModels(args: ListModelsArgs): Promise<{ models: AvailableModel[]; selectedOnlyModels: AvailableModel[]; + /** + * Live per-agent capability from the ACP `initialize` handshake + * (agentCapabilities.loadSession). Only set for ACP providers. + */ + supportsSessionImport?: boolean; }>; listRunningProviders(): string[]; diff --git a/packages/db/drizzle/0088_acp_session_import_lookup.sql b/packages/db/drizzle/0088_acp_session_import_lookup.sql new file mode 100644 index 0000000000..8b3f84593a --- /dev/null +++ b/packages/db/drizzle/0088_acp_session_import_lookup.sql @@ -0,0 +1 @@ +CREATE INDEX IF NOT EXISTS `events_provider_thread_idx` ON `events` (`provider_thread_id`,`created_at`) WHERE "events"."provider_thread_id" IS NOT NULL; \ No newline at end of file diff --git a/packages/db/drizzle/meta/0088_snapshot.json b/packages/db/drizzle/meta/0088_snapshot.json new file mode 100644 index 0000000000..0ed5d58e1e --- /dev/null +++ b/packages/db/drizzle/meta/0088_snapshot.json @@ -0,0 +1,3437 @@ +{ + "version": "6", + "dialect": "sqlite", + "id": "fb8e555f-1e13-466f-a868-ee32b0118075", + "prevId": "3a348e16-0592-4d7b-8f90-b6afcafffe48", + "tables": { + "app_settings": { + "name": "app_settings", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "caffeinate": { + "name": "caffeinate", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "show_keyboard_hints": { + "name": "show_keyboard_hints", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": true + }, + "steer_active_thread_on_enter": { + "name": "steer_active_thread_on_enter", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "show_unhandled_provider_events": { + "name": "show_unhandled_provider_events", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "codex_memory_enabled": { + "name": "codex_memory_enabled", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": true + }, + "claude_code_memory_enabled": { + "name": "claude_code_memory_enabled", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": true + }, + "codex_subagents_disabled": { + "name": "codex_subagents_disabled", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "claude_code_subagents_disabled": { + "name": "claude_code_subagents_disabled", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "claude_code_workflows_disabled": { + "name": "claude_code_workflows_disabled", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "keybinding_overrides": { + "name": "keybinding_overrides", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'[]'" + }, + "onboarding_completed_at": { + "name": "onboarding_completed_at", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "app_theme": { + "name": "app_theme", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "theme_id": { + "name": "theme_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "favicon_color": { + "name": "favicon_color", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'default'" + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "apikey": { + "name": "apikey", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "start": { + "name": "start", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "prefix": { + "name": "prefix", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "referenceId": { + "name": "referenceId", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "refillInterval": { + "name": "refillInterval", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "refillAmount": { + "name": "refillAmount", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "lastRefillAt": { + "name": "lastRefillAt", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "enabled": { + "name": "enabled", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "rateLimitEnabled": { + "name": "rateLimitEnabled", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "rateLimitTimeWindow": { + "name": "rateLimitTimeWindow", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "rateLimitMax": { + "name": "rateLimitMax", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "requestCount": { + "name": "requestCount", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "remaining": { + "name": "remaining", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "lastRequest": { + "name": "lastRequest", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "expiresAt": { + "name": "expiresAt", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "updatedAt": { + "name": "updatedAt", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "permissions": { + "name": "permissions", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "metadata": { + "name": "metadata", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "configId": { + "name": "configId", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "apikey_key_unique": { + "name": "apikey_key_unique", + "columns": [ + "key" + ], + "isUnique": true + }, + "apikey_reference_id_idx": { + "name": "apikey_reference_id_idx", + "columns": [ + "referenceId" + ], + "isUnique": false + }, + "apikey_config_id_idx": { + "name": "apikey_config_id_idx", + "columns": [ + "configId" + ], + "isUnique": false + } + }, + "foreignKeys": { + "apikey_referenceId_user_id_fk": { + "name": "apikey_referenceId_user_id_fk", + "tableFrom": "apikey", + "tableTo": "user", + "columnsFrom": [ + "referenceId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "user": { + "name": "user", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "emailVerified": { + "name": "emailVerified", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "image": { + "name": "image", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "updatedAt": { + "name": "updatedAt", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "user_email_unique": { + "name": "user_email_unique", + "columns": [ + "email" + ], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "environments": { + "name": "environments", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "project_id": { + "name": "project_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "host_id": { + "name": "host_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "path": { + "name": "path", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "managed": { + "name": "managed", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "is_git_repo": { + "name": "is_git_repo", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "is_worktree": { + "name": "is_worktree", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "branch_name": { + "name": "branch_name", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "base_branch": { + "name": "base_branch", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "default_branch": { + "name": "default_branch", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "merge_base_branch": { + "name": "merge_base_branch", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "destroy_attempt_id": { + "name": "destroy_attempt_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "workspace_provision_type": { + "name": "workspace_provision_type", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'provisioning'" + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "environments_project_host_path_idx": { + "name": "environments_project_host_path_idx", + "columns": [ + "project_id", + "host_id", + "path" + ], + "isUnique": true + }, + "environments_host_path_lookup_idx": { + "name": "environments_host_path_lookup_idx", + "columns": [ + "host_id", + "path" + ], + "isUnique": false + }, + "environments_project_idx": { + "name": "environments_project_idx", + "columns": [ + "project_id" + ], + "isUnique": false + }, + "environments_status_idx": { + "name": "environments_status_idx", + "columns": [ + "status" + ], + "isUnique": false + } + }, + "foreignKeys": { + "environments_project_id_projects_id_fk": { + "name": "environments_project_id_projects_id_fk", + "tableFrom": "environments", + "tableTo": "projects", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "environments_host_id_hosts_id_fk": { + "name": "environments_host_id_hosts_id_fk", + "tableFrom": "environments", + "tableTo": "hosts", + "columnsFrom": [ + "host_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "events": { + "name": "events", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "thread_id": { + "name": "thread_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "environment_id": { + "name": "environment_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "scope_kind": { + "name": "scope_kind", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "turn_id": { + "name": "turn_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "provider_thread_id": { + "name": "provider_thread_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sequence": { + "name": "sequence", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "item_id": { + "name": "item_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "item_kind": { + "name": "item_kind", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "data": { + "name": "data", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'{}'" + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "events_thread_sequence_idx": { + "name": "events_thread_sequence_idx", + "columns": [ + "thread_id", + "sequence" + ], + "isUnique": true + }, + "events_thread_type_item_kind_sequence_idx": { + "name": "events_thread_type_item_kind_sequence_idx", + "columns": [ + "thread_id", + "type", + "item_kind", + "sequence" + ], + "isUnique": false + }, + "events_thread_type_sequence_idx": { + "name": "events_thread_type_sequence_idx", + "columns": [ + "thread_id", + "type", + "sequence" + ], + "isUnique": false + }, + "events_thread_turn_type_item_sequence_idx": { + "name": "events_thread_turn_type_item_sequence_idx", + "columns": [ + "thread_id", + "turn_id", + "type", + "item_id", + "sequence" + ], + "isUnique": false + }, + "events_environment_idx": { + "name": "events_environment_idx", + "columns": [ + "environment_id" + ], + "isUnique": false + }, + "events_completed_item_truncation_idx": { + "name": "events_completed_item_truncation_idx", + "columns": [ + "item_kind", + "created_at", + "id" + ], + "isUnique": false, + "where": "\"events\".\"type\" = 'item/completed'" + }, + "events_provider_thread_idx": { + "name": "events_provider_thread_idx", + "columns": [ + "provider_thread_id", + "created_at" + ], + "isUnique": false, + "where": "\"events\".\"provider_thread_id\" IS NOT NULL" + } + }, + "foreignKeys": { + "events_thread_id_threads_id_fk": { + "name": "events_thread_id_threads_id_fk", + "tableFrom": "events", + "tableTo": "threads", + "columnsFrom": [ + "thread_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "events_environment_id_environments_id_fk": { + "name": "events_environment_id_environments_id_fk", + "tableFrom": "events", + "tableTo": "environments", + "columnsFrom": [ + "environment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": { + "events_scope_shape_check": { + "name": "events_scope_shape_check", + "value": "(\n (\"events\".\"scope_kind\" = 'turn' AND \"events\".\"turn_id\" IS NOT NULL)\n OR\n (\"events\".\"scope_kind\" = 'thread' AND \"events\".\"turn_id\" IS NULL)\n )" + } + } + }, + "host_daemon_sessions": { + "name": "host_daemon_sessions", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "host_id": { + "name": "host_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "instance_id": { + "name": "instance_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "host_name": { + "name": "host_name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "host_type": { + "name": "host_type", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "data_dir": { + "name": "data_dir", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "protocol_version": { + "name": "protocol_version", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "heartbeat_interval_ms": { + "name": "heartbeat_interval_ms", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "lease_timeout_ms": { + "name": "lease_timeout_ms", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "lease_expires_at": { + "name": "lease_expires_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "closed_at": { + "name": "closed_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "close_reason": { + "name": "close_reason", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "host_daemon_sessions_host_status_idx": { + "name": "host_daemon_sessions_host_status_idx", + "columns": [ + "host_id", + "status" + ], + "isUnique": false + }, + "host_daemon_sessions_host_latest_idx": { + "name": "host_daemon_sessions_host_latest_idx", + "columns": [ + "host_id", + "updated_at", + "created_at", + "id" + ], + "isUnique": false + }, + "host_daemon_sessions_closed_prune_idx": { + "name": "host_daemon_sessions_closed_prune_idx", + "columns": [ + "status", + "closed_at", + "id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "host_daemon_sessions_host_id_hosts_id_fk": { + "name": "host_daemon_sessions_host_id_hosts_id_fk", + "tableFrom": "host_daemon_sessions", + "tableTo": "hosts", + "columnsFrom": [ + "host_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "hosts": { + "name": "hosts", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "connect_machine_id": { + "name": "connect_machine_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "max_permission_mode": { + "name": "max_permission_mode", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'full'" + }, + "destroyed_at": { + "name": "destroyed_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "last_seen_at": { + "name": "last_seen_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "last_rejected_protocol_version": { + "name": "last_rejected_protocol_version", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "hosts_last_seen_idx": { + "name": "hosts_last_seen_idx", + "columns": [ + "last_seen_at" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "plugins": { + "name": "plugins", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "source": { + "name": "source", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "provenance": { + "name": "provenance", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'direct'" + }, + "catalog_entry_id": { + "name": "catalog_entry_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_kind": { + "name": "source_kind", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'path'" + }, + "source_path": { + "name": "source_path", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_builtin_name": { + "name": "source_builtin_name", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_npm_package": { + "name": "source_npm_package", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_npm_registry": { + "name": "source_npm_registry", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_npm_requested_spec": { + "name": "source_npm_requested_spec", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_npm_spec_kind": { + "name": "source_npm_spec_kind", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_git_url": { + "name": "source_git_url", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_git_subdirectory": { + "name": "source_git_subdirectory", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_git_requested_ref": { + "name": "source_git_requested_ref", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_git_ref_kind": { + "name": "source_git_ref_kind", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "npm_resolved_version": { + "name": "npm_resolved_version", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "npm_integrity": { + "name": "npm_integrity", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "git_resolved_commit": { + "name": "git_resolved_commit", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "last_update_check_at": { + "name": "last_update_check_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "available_compatible_version": { + "name": "available_compatible_version", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "newest_incompatible_version": { + "name": "newest_incompatible_version", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "update_status_detail": { + "name": "update_status_detail", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "last_failure_version": { + "name": "last_failure_version", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "last_failure_at": { + "name": "last_failure_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "last_failure_detail": { + "name": "last_failure_detail", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "active_artifact_id": { + "name": "active_artifact_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "normalization_version": { + "name": "normalization_version", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "root_dir": { + "name": "root_dir", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "version": { + "name": "version", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "enabled": { + "name": "enabled", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": true + }, + "removed_at": { + "name": "removed_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "installed_at": { + "name": "installed_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": { + "plugins_active_artifact_id_plugin_artifacts_id_fk": { + "name": "plugins_active_artifact_id_plugin_artifacts_id_fk", + "tableFrom": "plugins", + "tableTo": "plugin_artifacts", + "columnsFrom": [ + "active_artifact_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "maintenance_scan_cursors": { + "name": "maintenance_scan_cursors", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "policy": { + "name": "policy", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "version": { + "name": "version", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "item_kind": { + "name": "item_kind", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "output_path": { + "name": "output_path", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "last_created_at": { + "name": "last_created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "last_event_id": { + "name": "last_event_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "''" + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "maintenance_scan_cursors_path_idx": { + "name": "maintenance_scan_cursors_path_idx", + "columns": [ + "policy", + "version", + "item_kind", + "output_path" + ], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "pending_interactions": { + "name": "pending_interactions", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "thread_id": { + "name": "thread_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "origin_kind": { + "name": "origin_kind", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'provider'" + }, + "turn_id": { + "name": "turn_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "provider_id": { + "name": "provider_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "provider_thread_id": { + "name": "provider_thread_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "provider_request_id": { + "name": "provider_request_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "plugin_id": { + "name": "plugin_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "renderer_id": { + "name": "renderer_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "payload": { + "name": "payload", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "resolution": { + "name": "resolution", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "status_reason": { + "name": "status_reason", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "expires_at": { + "name": "expires_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "resolved_at": { + "name": "resolved_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "pending_interactions_provider_request_idx": { + "name": "pending_interactions_provider_request_idx", + "columns": [ + "provider_id", + "provider_thread_id", + "provider_request_id" + ], + "isUnique": true + }, + "pending_interactions_thread_created_idx": { + "name": "pending_interactions_thread_created_idx", + "columns": [ + "thread_id", + "created_at" + ], + "isUnique": false + }, + "pending_interactions_thread_status_created_idx": { + "name": "pending_interactions_thread_status_created_idx", + "columns": [ + "thread_id", + "status", + "created_at" + ], + "isUnique": false + }, + "pending_interactions_status_created_idx": { + "name": "pending_interactions_status_created_idx", + "columns": [ + "status", + "created_at" + ], + "isUnique": false + }, + "pending_interactions_plugin_status_created_idx": { + "name": "pending_interactions_plugin_status_created_idx", + "columns": [ + "plugin_id", + "status", + "created_at" + ], + "isUnique": false + } + }, + "foreignKeys": { + "pending_interactions_thread_id_threads_id_fk": { + "name": "pending_interactions_thread_id_threads_id_fk", + "tableFrom": "pending_interactions", + "tableTo": "threads", + "columnsFrom": [ + "thread_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "plugin_artifacts": { + "name": "plugin_artifacts", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "plugin_id": { + "name": "plugin_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "source_kind": { + "name": "source_kind", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "npm_resolved_version": { + "name": "npm_resolved_version", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "git_resolved_commit": { + "name": "git_resolved_commit", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "path": { + "name": "path", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "integrity": { + "name": "integrity", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "content_hash": { + "name": "content_hash", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "validation_result": { + "name": "validation_result", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "validated_at": { + "name": "validated_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "plugin_artifacts_plugin_idx": { + "name": "plugin_artifacts_plugin_idx", + "columns": [ + "plugin_id" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "plugin_kv": { + "name": "plugin_kv", + "columns": { + "plugin_id": { + "name": "plugin_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "value": { + "name": "value", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "plugin_kv_plugin_id_key_pk": { + "columns": [ + "plugin_id", + "key" + ], + "name": "plugin_kv_plugin_id_key_pk" + } + }, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "plugin_schedules": { + "name": "plugin_schedules", + "columns": { + "plugin_id": { + "name": "plugin_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "cron": { + "name": "cron", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "next_run_at": { + "name": "next_run_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "last_run_at": { + "name": "last_run_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "last_status": { + "name": "last_status", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "last_error": { + "name": "last_error", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "plugin_schedules_plugin_id_name_pk": { + "columns": [ + "plugin_id", + "name" + ], + "name": "plugin_schedules_plugin_id_name_pk" + } + }, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "plugin_settings": { + "name": "plugin_settings", + "columns": { + "plugin_id": { + "name": "plugin_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "value": { + "name": "value", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "plugin_settings_plugin_id_key_pk": { + "columns": [ + "plugin_id", + "key" + ], + "name": "plugin_settings_plugin_id_key_pk" + } + }, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "plugin_state_snapshots": { + "name": "plugin_state_snapshots", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "plugin_id": { + "name": "plugin_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "from_artifact_id": { + "name": "from_artifact_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "to_artifact_id": { + "name": "to_artifact_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "snapshot_path": { + "name": "snapshot_path", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "database_path": { + "name": "database_path", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "state_path": { + "name": "state_path", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "secrets_path": { + "name": "secrets_path", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "registration_path": { + "name": "registration_path", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "rollback_candidate_version": { + "name": "rollback_candidate_version", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "rollback_source_fingerprint": { + "name": "rollback_source_fingerprint", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "rollback_bb_version": { + "name": "rollback_bb_version", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "rollback_sdk_version": { + "name": "rollback_sdk_version", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "rollback_detail": { + "name": "rollback_detail", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "retained_until": { + "name": "retained_until", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "plugin_state_snapshots_plugin_idx": { + "name": "plugin_state_snapshots_plugin_idx", + "columns": [ + "plugin_id" + ], + "isUnique": false + }, + "plugin_state_snapshots_retention_idx": { + "name": "plugin_state_snapshots_retention_idx", + "columns": [ + "retained_until" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "project_execution_defaults": { + "name": "project_execution_defaults", + "columns": { + "project_id": { + "name": "project_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "provider_id": { + "name": "provider_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "service_tier": { + "name": "service_tier", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "reasoning_level": { + "name": "reasoning_level", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "permission_mode": { + "name": "permission_mode", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "project_execution_defaults_project_idx": { + "name": "project_execution_defaults_project_idx", + "columns": [ + "project_id" + ], + "isUnique": true + } + }, + "foreignKeys": { + "project_execution_defaults_project_id_projects_id_fk": { + "name": "project_execution_defaults_project_id_projects_id_fk", + "tableFrom": "project_execution_defaults", + "tableTo": "projects", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "project_sources": { + "name": "project_sources", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "project_id": { + "name": "project_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "host_id": { + "name": "host_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "path": { + "name": "path", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "is_default": { + "name": "is_default", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "project_sources_project_idx": { + "name": "project_sources_project_idx", + "columns": [ + "project_id" + ], + "isUnique": false + }, + "project_sources_host_idx": { + "name": "project_sources_host_idx", + "columns": [ + "host_id" + ], + "isUnique": false + }, + "project_sources_project_host_idx": { + "name": "project_sources_project_host_idx", + "columns": [ + "project_id", + "host_id" + ], + "isUnique": true + } + }, + "foreignKeys": { + "project_sources_project_id_projects_id_fk": { + "name": "project_sources_project_id_projects_id_fk", + "tableFrom": "project_sources", + "tableTo": "projects", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "project_sources_host_id_hosts_id_fk": { + "name": "project_sources_host_id_hosts_id_fk", + "tableFrom": "project_sources", + "tableTo": "hosts", + "columnsFrom": [ + "host_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": { + "project_sources_shape_check": { + "name": "project_sources_shape_check", + "value": "(\n \"project_sources\".\"type\" = 'local_path' AND \"project_sources\".\"host_id\" IS NOT NULL AND \"project_sources\".\"path\" IS NOT NULL\n )" + } + } + }, + "projects": { + "name": "projects", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'standard'" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "git_remote_url": { + "name": "git_remote_url", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sort_key": { + "name": "sort_key", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'V'" + }, + "deleted_at": { + "name": "deleted_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "projects_updated_idx": { + "name": "projects_updated_idx", + "columns": [ + "updated_at" + ], + "isUnique": false + }, + "projects_deleted_idx": { + "name": "projects_deleted_idx", + "columns": [ + "deleted_at" + ], + "isUnique": false + }, + "projects_sort_idx": { + "name": "projects_sort_idx", + "columns": [ + "sort_key", + "id" + ], + "isUnique": false + }, + "projects_personal_singleton_idx": { + "name": "projects_personal_singleton_idx", + "columns": [ + "kind" + ], + "isUnique": true, + "where": "\"projects\".\"kind\" = 'personal'" + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "prompt_history_entries": { + "name": "prompt_history_entries", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "project_id": { + "name": "project_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "thread_id": { + "name": "thread_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "scope": { + "name": "scope", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "request_sequence": { + "name": "request_sequence", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "input": { + "name": "input", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "prompt_history_entries_thread_request_idx": { + "name": "prompt_history_entries_thread_request_idx", + "columns": [ + "thread_id", + "request_sequence" + ], + "isUnique": true + }, + "prompt_history_entries_project_scope_created_idx": { + "name": "prompt_history_entries_project_scope_created_idx", + "columns": [ + "project_id", + "scope", + "created_at", + "request_sequence", + "id" + ], + "isUnique": false + }, + "prompt_history_entries_thread_scope_created_idx": { + "name": "prompt_history_entries_thread_scope_created_idx", + "columns": [ + "thread_id", + "scope", + "created_at", + "request_sequence", + "id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "prompt_history_entries_project_id_projects_id_fk": { + "name": "prompt_history_entries_project_id_projects_id_fk", + "tableFrom": "prompt_history_entries", + "tableTo": "projects", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "prompt_history_entries_thread_id_threads_id_fk": { + "name": "prompt_history_entries_thread_id_threads_id_fk", + "tableFrom": "prompt_history_entries", + "tableTo": "threads", + "columnsFrom": [ + "thread_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "queued_thread_messages": { + "name": "queued_thread_messages", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "thread_id": { + "name": "thread_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "sender_thread_id": { + "name": "sender_thread_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "reasoning_level": { + "name": "reasoning_level", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "permission_mode": { + "name": "permission_mode", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "service_tier": { + "name": "service_tier", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "group_with_next": { + "name": "group_with_next", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "claimed_at": { + "name": "claimed_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "claim_token": { + "name": "claim_token", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sort_key": { + "name": "sort_key", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "queued_thread_messages_thread_created_idx": { + "name": "queued_thread_messages_thread_created_idx", + "columns": [ + "thread_id", + "created_at", + "id" + ], + "isUnique": false + }, + "queued_thread_messages_thread_sort_idx": { + "name": "queued_thread_messages_thread_sort_idx", + "columns": [ + "thread_id", + "sort_key", + "id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "queued_thread_messages_thread_id_threads_id_fk": { + "name": "queued_thread_messages_thread_id_threads_id_fk", + "tableFrom": "queued_thread_messages", + "tableTo": "threads", + "columnsFrom": [ + "thread_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "system_experiments": { + "name": "system_experiments", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "claude_code_mock_cli_traffic": { + "name": "claude_code_mock_cli_traffic", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "new_onboarding": { + "name": "new_onboarding", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "tools_hub": { + "name": "tools_hub", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "terminal_sessions": { + "name": "terminal_sessions", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "thread_id": { + "name": "thread_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "environment_id": { + "name": "environment_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "host_id": { + "name": "host_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "daemon_session_id": { + "name": "daemon_session_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "initial_cwd": { + "name": "initial_cwd", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "cols": { + "name": "cols", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "rows": { + "name": "rows", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "exit_code": { + "name": "exit_code", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "close_reason": { + "name": "close_reason", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "last_user_input_at": { + "name": "last_user_input_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "terminal_sessions_thread_status_updated_idx": { + "name": "terminal_sessions_thread_status_updated_idx", + "columns": [ + "thread_id", + "status", + "updated_at" + ], + "isUnique": false + }, + "terminal_sessions_environment_status_idx": { + "name": "terminal_sessions_environment_status_idx", + "columns": [ + "environment_id", + "status" + ], + "isUnique": false + }, + "terminal_sessions_host_status_idx": { + "name": "terminal_sessions_host_status_idx", + "columns": [ + "host_id", + "status" + ], + "isUnique": false + }, + "terminal_sessions_daemon_session_idx": { + "name": "terminal_sessions_daemon_session_idx", + "columns": [ + "daemon_session_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "terminal_sessions_thread_id_threads_id_fk": { + "name": "terminal_sessions_thread_id_threads_id_fk", + "tableFrom": "terminal_sessions", + "tableTo": "threads", + "columnsFrom": [ + "thread_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "terminal_sessions_environment_id_environments_id_fk": { + "name": "terminal_sessions_environment_id_environments_id_fk", + "tableFrom": "terminal_sessions", + "tableTo": "environments", + "columnsFrom": [ + "environment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "terminal_sessions_host_id_hosts_id_fk": { + "name": "terminal_sessions_host_id_hosts_id_fk", + "tableFrom": "terminal_sessions", + "tableTo": "hosts", + "columnsFrom": [ + "host_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "terminal_sessions_daemon_session_id_host_daemon_sessions_id_fk": { + "name": "terminal_sessions_daemon_session_id_host_daemon_sessions_id_fk", + "tableFrom": "terminal_sessions", + "tableTo": "host_daemon_sessions", + "columnsFrom": [ + "daemon_session_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "thread_dynamic_context_file_states": { + "name": "thread_dynamic_context_file_states", + "columns": { + "thread_id": { + "name": "thread_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "file_key": { + "name": "file_key", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "content_status": { + "name": "content_status", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "content_hash": { + "name": "content_hash", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "shown_at": { + "name": "shown_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "thread_dynamic_context_file_states_thread_file_idx": { + "name": "thread_dynamic_context_file_states_thread_file_idx", + "columns": [ + "thread_id", + "file_key" + ], + "isUnique": true + } + }, + "foreignKeys": { + "thread_dynamic_context_file_states_thread_id_threads_id_fk": { + "name": "thread_dynamic_context_file_states_thread_id_threads_id_fk", + "tableFrom": "thread_dynamic_context_file_states", + "tableTo": "threads", + "columnsFrom": [ + "thread_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "thread_search_segments": { + "name": "thread_search_segments", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "thread_id": { + "name": "thread_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "source_kind": { + "name": "source_kind", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "source_key": { + "name": "source_key", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "source_seq": { + "name": "source_seq", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "text": { + "name": "text", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "thread_search_segments_source_idx": { + "name": "thread_search_segments_source_idx", + "columns": [ + "thread_id", + "source_kind", + "source_key" + ], + "isUnique": true + }, + "thread_search_segments_thread_idx": { + "name": "thread_search_segments_thread_idx", + "columns": [ + "thread_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "thread_search_segments_thread_id_threads_id_fk": { + "name": "thread_search_segments_thread_id_threads_id_fk", + "tableFrom": "thread_search_segments", + "tableTo": "threads", + "columnsFrom": [ + "thread_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "thread_sections": { + "name": "thread_sections", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "thread_sections_name_idx": { + "name": "thread_sections_name_idx", + "columns": [ + "name" + ], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "thread_tabs": { + "name": "thread_tabs", + "columns": { + "thread_id": { + "name": "thread_id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tabs_json": { + "name": "tabs_json", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "revision": { + "name": "revision", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": { + "thread_tabs_thread_id_threads_id_fk": { + "name": "thread_tabs_thread_id_threads_id_fk", + "tableFrom": "thread_tabs", + "tableTo": "threads", + "columnsFrom": [ + "thread_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "threads": { + "name": "threads", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "project_id": { + "name": "project_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "environment_id": { + "name": "environment_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "provider_id": { + "name": "provider_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "model_override": { + "name": "model_override", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reasoning_level_override": { + "name": "reasoning_level_override", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "title_fallback": { + "name": "title_fallback", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "section_id": { + "name": "section_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'starting'" + }, + "parent_thread_id": { + "name": "parent_thread_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_thread_id": { + "name": "source_thread_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "origin_kind": { + "name": "origin_kind", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "child_origin": { + "name": "child_origin", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "origin_plugin_id": { + "name": "origin_plugin_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "visibility": { + "name": "visibility", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'visible'" + }, + "archived_at": { + "name": "archived_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "pinned_at": { + "name": "pinned_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "pin_sort_key": { + "name": "pin_sort_key", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "last_read_at": { + "name": "last_read_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "latest_attention_at": { + "name": "latest_attention_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "threads_project_updated_idx": { + "name": "threads_project_updated_idx", + "columns": [ + "project_id", + "updated_at" + ], + "isUnique": false + }, + "threads_project_archived_deleted_idx": { + "name": "threads_project_archived_deleted_idx", + "columns": [ + "project_id", + "archived_at", + "deleted_at", + "id" + ], + "isUnique": false + }, + "threads_pin_sort_idx": { + "name": "threads_pin_sort_idx", + "columns": [ + "archived_at", + "deleted_at", + "pin_sort_key", + "id" + ], + "isUnique": false, + "where": "\"threads\".\"pinned_at\" IS NOT NULL" + }, + "threads_environment_idx": { + "name": "threads_environment_idx", + "columns": [ + "environment_id" + ], + "isUnique": false + }, + "threads_parent_idx": { + "name": "threads_parent_idx", + "columns": [ + "parent_thread_id" + ], + "isUnique": false + }, + "threads_source_origin_idx": { + "name": "threads_source_origin_idx", + "columns": [ + "source_thread_id", + "origin_kind" + ], + "isUnique": false + }, + "threads_origin_plugin_archived_idx": { + "name": "threads_origin_plugin_archived_idx", + "columns": [ + "origin_plugin_id", + "archived_at" + ], + "isUnique": false + }, + "threads_section_archived_deleted_idx": { + "name": "threads_section_archived_deleted_idx", + "columns": [ + "section_id", + "archived_at", + "deleted_at", + "id" + ], + "isUnique": false + }, + "threads_archived_status_idx": { + "name": "threads_archived_status_idx", + "columns": [ + "archived_at", + "status" + ], + "isUnique": false + }, + "threads_environment_archived_deleted_idx": { + "name": "threads_environment_archived_deleted_idx", + "columns": [ + "environment_id", + "archived_at", + "deleted_at" + ], + "isUnique": false + }, + "threads_active_maintenance_idx": { + "name": "threads_active_maintenance_idx", + "columns": [ + "status" + ], + "isUnique": false, + "where": "\"threads\".\"deleted_at\" IS NULL" + } + }, + "foreignKeys": { + "threads_project_id_projects_id_fk": { + "name": "threads_project_id_projects_id_fk", + "tableFrom": "threads", + "tableTo": "projects", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "threads_environment_id_environments_id_fk": { + "name": "threads_environment_id_environments_id_fk", + "tableFrom": "threads", + "tableTo": "environments", + "columnsFrom": [ + "environment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "threads_section_id_thread_sections_id_fk": { + "name": "threads_section_id_thread_sections_id_fk", + "tableFrom": "threads", + "tableTo": "thread_sections", + "columnsFrom": [ + "section_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "threads_parent_thread_id_threads_id_fk": { + "name": "threads_parent_thread_id_threads_id_fk", + "tableFrom": "threads", + "tableTo": "threads", + "columnsFrom": [ + "parent_thread_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "threads_source_thread_id_threads_id_fk": { + "name": "threads_source_thread_id_threads_id_fk", + "tableFrom": "threads", + "tableTo": "threads", + "columnsFrom": [ + "source_thread_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + } + }, + "views": {}, + "enums": {}, + "_meta": { + "schemas": {}, + "tables": {}, + "columns": {} + }, + "internal": { + "indexes": {} + } +} \ No newline at end of file diff --git a/packages/db/drizzle/meta/_journal.json b/packages/db/drizzle/meta/_journal.json index fb688482de..bb4095c99c 100644 --- a/packages/db/drizzle/meta/_journal.json +++ b/packages/db/drizzle/meta/_journal.json @@ -617,6 +617,13 @@ "when": 1786043536668, "tag": "0087_brief_khan", "breakpoints": true + }, + { + "idx": 88, + "version": "6", + "when": 1786120423495, + "tag": "0088_acp_session_import_lookup", + "breakpoints": true } ] } \ No newline at end of file diff --git a/packages/db/src/data/events.ts b/packages/db/src/data/events.ts index 3a9ac0fd1a..5e972e8b43 100644 --- a/packages/db/src/data/events.ts +++ b/packages/db/src/data/events.ts @@ -6,6 +6,7 @@ import { gte, inArray, isNotNull, + isNull, lt, lte, max, @@ -2516,6 +2517,42 @@ export function getStoredProviderThreadIdAtOrBeforeSequence( return row?.providerThreadId ?? null; } +/** + * Reverse lookup for provider-session uniqueness: the most recently touched + * non-deleted thread on this host whose event log has ever recorded this + * providerThreadId (via thread/identity or any provider-scoped event). Used + * to refuse importing an external ACP session that another live bb thread + * already binds, since the ACP bridge routes by provider session id and a + * second binding would misroute turns between the two threads. + */ +export function findLiveThreadIdByProviderThreadId( + db: DbQueryConnection, + args: { hostId: string; providerThreadId: string }, +): string | null { + const row = db + .select({ threadId: events.threadId }) + .from(events) + .innerJoin(threads, eq(threads.id, events.threadId)) + .innerJoin(environments, eq(environments.id, threads.environmentId)) + .where( + and( + eq(events.providerThreadId, args.providerThreadId), + eq(environments.hostId, args.hostId), + isNull(threads.deletedAt), + ), + ) + // events.sequence is a per-thread counter (events_thread_sequence_idx is + // unique on (threadId, sequence)), so ordering by it across threads picks + // whichever matching thread has logged the most events, not the one most + // recently touched. Order by wall-clock recency instead; events.id (a + // random suffix, not time-sortable) only breaks exact-timestamp ties + // deterministically. + .orderBy(desc(events.createdAt), desc(events.id)) + .limit(1) + .get(); + return row?.threadId ?? null; +} + export function listThreadTurnInterruptionEventStates( db: DbQueryConnection, args: ListThreadTurnInterruptionEventStatesArgs, diff --git a/packages/db/src/data/index.ts b/packages/db/src/data/index.ts index 6ae3e5cd1a..8df383d3a3 100644 --- a/packages/db/src/data/index.ts +++ b/packages/db/src/data/index.ts @@ -294,6 +294,7 @@ export { appendStoredThreadEvent, appendStoredThreadEventInTransaction, appendStoredThreadEventsInTransaction, + findLiveThreadIdByProviderThreadId, findStoredClientTurnRequestSequenceByRequestId, findStoredEventRow, getActiveStoredTurnId, diff --git a/packages/db/src/schema.ts b/packages/db/src/schema.ts index 6f066ccff3..22c49853ce 100644 --- a/packages/db/src/schema.ts +++ b/packages/db/src/schema.ts @@ -687,6 +687,13 @@ export const events = sqliteTable( index("events_completed_item_truncation_idx") .on(table.itemKind, table.createdAt, table.id) .where(sql`${table.type} = 'item/completed'`), + // Serves findLiveThreadIdByProviderThreadId's reverse lookup (thread + // import's duplicate-binding check): most events have a null + // providerThreadId, so a partial index keeps it small; createdAt is + // included to serve the recency ordering without a separate sort. + index("events_provider_thread_idx") + .on(table.providerThreadId, table.createdAt) + .where(sql`${table.providerThreadId} IS NOT NULL`), check( "events_scope_shape_check", sql`( diff --git a/packages/db/test/data/events.test.ts b/packages/db/test/data/events.test.ts index 3fe4d9dd25..7910671e93 100644 --- a/packages/db/test/data/events.test.ts +++ b/packages/db/test/data/events.test.ts @@ -17,6 +17,7 @@ import { appendStoredThreadEvent, appendStoredThreadEventInTransaction, appendStoredThreadEventsInTransaction, + findLiveThreadIdByProviderThreadId, findStoredEventRow, getActiveStoredTurnId, getHighWaterMarks, @@ -4044,6 +4045,103 @@ describe("findUnfinishedTurnCoveringSequence", () => { }); }); +describe("findLiveThreadIdByProviderThreadId", () => { + it("returns the thread with the most recently created event, not the one with the most events", () => { + const db = createConnection(":memory:"); + migrate(db); + const host = upsertHost(db, noopNotifier, { + name: "import-host", + type: "persistent", + }); + const { project } = createProject(db, noopNotifier, { + name: "import-project", + source: { type: "local_path", hostId: host.id, path: "/tmp/test" }, + }); + const environment = createEnvironment(db, noopNotifier, { + projectId: project.id, + hostId: host.id, + workspaceProvisionType: "unmanaged", + }); + const busyThread = createThread(db, noopNotifier, { + projectId: project.id, + environmentId: environment.id, + providerId: "codex", + }); + const recentThread = createThread(db, noopNotifier, { + projectId: project.id, + environmentId: environment.id, + providerId: "codex", + }); + + insertEvents(db, noopNotifier, [ + // busyThread logged three events for the shared provider session, all + // older than recentThread's single event. + { + threadId: busyThread.id, + environmentId: environment.id, + sequence: 1, + ...threadEventFields, + type: "thread/identity", + providerThreadId: "shared-provider-session", + data: "{}", + createdAt: 1_000, + }, + { + threadId: busyThread.id, + environmentId: environment.id, + sequence: 2, + ...threadEventFields, + type: "thread/identity", + providerThreadId: "shared-provider-session", + data: "{}", + createdAt: 2_000, + }, + { + threadId: busyThread.id, + environmentId: environment.id, + sequence: 3, + ...threadEventFields, + type: "thread/identity", + providerThreadId: "shared-provider-session", + data: "{}", + createdAt: 3_000, + }, + { + threadId: recentThread.id, + environmentId: environment.id, + sequence: 1, + ...threadEventFields, + type: "thread/identity", + providerThreadId: "shared-provider-session", + data: "{}", + createdAt: 4_000, + }, + ]); + + // events.sequence is a per-thread counter: busyThread's highest sequence + // (3) is larger than recentThread's (1), so ordering by sequence across + // threads would wrongly pick busyThread even though recentThread's event + // is the newest by wall-clock time. + expect( + findLiveThreadIdByProviderThreadId(db, { + hostId: host.id, + providerThreadId: "shared-provider-session", + }), + ).toBe(recentThread.id); + }); + + it("returns null when no live thread has recorded the provider session", () => { + const { db } = setup(); + + expect( + findLiveThreadIdByProviderThreadId(db, { + hostId: "nonexistent-host", + providerThreadId: "unbound-provider-session", + }), + ).toBeNull(); + }); +}); + describe("hasParentedEventCrossingSequence", () => { it("finds a child event whose tool-call parent began below the cut", () => { const { db, thread } = setup(); diff --git a/packages/db/test/migrate.test.ts b/packages/db/test/migrate.test.ts index b615bbe667..f7dec2e484 100644 --- a/packages/db/test/migrate.test.ts +++ b/packages/db/test/migrate.test.ts @@ -3536,6 +3536,7 @@ describe("migrate", () => { expect(eventIndexNames).toEqual([ "events_completed_item_truncation_idx", "events_environment_idx", + "events_provider_thread_idx", "events_thread_sequence_idx", "events_thread_turn_type_item_sequence_idx", "events_thread_type_item_kind_sequence_idx", diff --git a/packages/domain/src/provider-event.ts b/packages/domain/src/provider-event.ts index 97d2974563..983c0a5a33 100644 --- a/packages/domain/src/provider-event.ts +++ b/packages/domain/src/provider-event.ts @@ -364,6 +364,10 @@ const unscopedProviderEventSchema = z.discriminatedUnion("type", [ threadId: z.string(), providerThreadId: z.string(), parentToolCallId: z.string().optional(), + // True when the turn frames replayed history from an imported provider + // session: the events are persisted for display but drive no thread + // lifecycle transitions (the turn never ran under this thread). + historical: z.boolean().optional(), }), z.object({ type: z.literal("turn/completed"), @@ -373,6 +377,9 @@ const unscopedProviderEventSchema = z.discriminatedUnion("type", [ providerThreadId: z.string().nullable(), status: threadEventTurnStatusSchema, error: z.object({ message: z.string() }).optional(), + // See turn/started.historical: closes a replayed-history frame without + // turn-completion side effects. + historical: z.boolean().optional(), }), z .object({ diff --git a/packages/domain/src/provider-types.ts b/packages/domain/src/provider-types.ts index e62aea551d..eb8e54cbf8 100644 --- a/packages/domain/src/provider-types.ts +++ b/packages/domain/src/provider-types.ts @@ -28,6 +28,8 @@ export const providerCapabilitiesSchema = z.object({ supportsServiceTier: z.boolean(), supportsUserQuestion: z.boolean(), supportsFork: z.boolean(), + /** Whether an existing external provider session can be imported as a thread. */ + supportsSessionImport: z.boolean(), supportedPermissionModes: z.array(permissionModeSchema).min(1), }); export type ProviderCapabilities = z.infer<typeof providerCapabilitiesSchema>; diff --git a/packages/domain/test/provider-types.test.ts b/packages/domain/test/provider-types.test.ts index dfa7de73a0..c86e194de7 100644 --- a/packages/domain/test/provider-types.test.ts +++ b/packages/domain/test/provider-types.test.ts @@ -12,6 +12,7 @@ describe("provider info schema", () => { supportsServiceTier: true, supportsUserQuestion: false, supportsFork: true, + supportsSessionImport: false, supportedPermissionModes: ["accept-edits", "auto", "full"], }, available: true, diff --git a/packages/host-daemon-contract/src/commands.ts b/packages/host-daemon-contract/src/commands.ts index e226e983b6..0c2902da90 100644 --- a/packages/host-daemon-contract/src/commands.ts +++ b/packages/host-daemon-contract/src/commands.ts @@ -35,7 +35,7 @@ import { providerCliStatusResponseSchema, } from "./local.js"; -export const HOST_DAEMON_PROTOCOL_VERSION = 77 as const; +export const HOST_DAEMON_PROTOCOL_VERSION = 78 as const; export { BRANCH_LIST_LIMIT_MAX, @@ -300,16 +300,32 @@ export const threadStartCommandSchema = hostDaemonThreadTargetSchema /** Present means fork the new thread from this source provider session * instead of starting fresh; absent means a normal start. */ fork: z.object({ sourceProviderThreadId: z.string().min(1) }).optional(), + /** Present means bind the new thread to this existing external provider + * session (ACP session import): the runtime loads the session and + * replays its history as historical events instead of starting fresh. + * An import start runs no first turn, so it carries no input. */ + sessionImport: z.object({ providerThreadId: z.string().min(1) }).optional(), }) .strict() .superRefine((value, ctx) => { - if (value.fork === undefined && value.input.length === 0) { + if ( + value.fork === undefined && + value.sessionImport === undefined && + value.input.length === 0 + ) { ctx.addIssue({ code: "custom", message: "input must contain at least one entry", path: ["input"], }); } + if (value.fork !== undefined && value.sessionImport !== undefined) { + ctx.addIssue({ + code: "custom", + message: "fork and sessionImport are mutually exclusive", + path: ["sessionImport"], + }); + } refineGroupedInputMatchesFlatInput(value, ctx); }); @@ -1308,6 +1324,11 @@ const writeSkillResultSchema = z.discriminatedUnion("outcome", [ const providerListModelsResultSchema = z.object({ models: z.array(availableModelSchema), selectedOnlyModels: z.array(availableModelSchema), + // Live, per-agent capability from the ACP `initialize` handshake + // (agentCapabilities.loadSession). Undefined when the provider isn't ACP or + // the live handshake result isn't available (e.g. a CLI-based model list + // that never spawned a session); callers must not treat that as `false`. + supportsSessionImport: z.boolean().optional(), }); const knownAcpAgentExecutableStatusSchema = z diff --git a/packages/host-daemon-contract/test/contract.test.ts b/packages/host-daemon-contract/test/contract.test.ts index 1731aceb61..7771b3cf82 100644 --- a/packages/host-daemon-contract/test/contract.test.ts +++ b/packages/host-daemon-contract/test/contract.test.ts @@ -758,6 +758,8 @@ const INTENTIONAL_OPTIONAL_HOST_DAEMON_FIELDS: Record<string, string> = { "thread.start may include a storage path so the daemon creates the directory before the agent starts.", "hostDaemonCommandSchema.fork": "thread.start omits fork unless the new thread should clone an existing provider session; absent means a normal start.", + "hostDaemonCommandSchema.sessionImport": + "thread.start omits sessionImport unless the new thread binds to an imported external provider session; absent means a normal start.", "hostDaemonCommandSchema.inputGroups": "thread.start and turn.submit omit inputGroups for ordinary single user-message turns; presence preserves grouped user messages within one turn.", "hostDaemonCommandSchema.disallowedTools": @@ -1038,11 +1040,17 @@ describe("host-daemon local schemas", () => { }); describe("host-daemon command schemas", () => { - // Version 76 lets the daemon report live workspace metadata. Pi model - // discovery now also carries the requested workspace path. The bump moves - // an enrolled machine onto the new wire contract. - it("uses protocol version 77 for workspace-aware Pi model discovery", () => { - expect(HOST_DAEMON_PROTOCOL_VERSION).toBe(77); + // thread.start gained the sessionImport descriptor in version 78 (ACP + // session import). Older daemons would silently drop the field and start a + // fresh history-less session, so the bump forces an update first. + // + // The same version also carries the optional provider.list_models + // supportsSessionImport result field: the server-side import gate uses it + // to derive the live per-agent loadSession capability instead of trusting + // the static ACP-family constant. An older daemon simply omits the field, + // which the server treats as "unknown" and falls back to the static check. + it("uses protocol version 78 for ACP session import", () => { + expect(HOST_DAEMON_PROTOCOL_VERSION).toBe(78); }); it("binds Plan cancellation to a required turn id and typed result", () => { 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 5f273bcbba..8d27c18b5d 100644 --- a/packages/plugin-sdk/bundled-types/bb-plugin-sdk.d.ts +++ b/packages/plugin-sdk/bundled-types/bb-plugin-sdk.d.ts @@ -662,6 +662,7 @@ declare const threadEventSchema: z$1.ZodPipe<z$1.ZodUnknown, z$1.ZodUnion<readon threadId: z$1.ZodString; providerThreadId: z$1.ZodString; parentToolCallId: z$1.ZodOptional<z$1.ZodString>; + historical: z$1.ZodOptional<z$1.ZodBoolean>; }, z$1.core.$strip>, z$1.ZodObject<{ type: z$1.ZodLiteral<"turn/completed">; threadId: z$1.ZodString; @@ -674,6 +675,7 @@ declare const threadEventSchema: z$1.ZodPipe<z$1.ZodUnknown, z$1.ZodUnion<readon error: z$1.ZodOptional<z$1.ZodObject<{ message: z$1.ZodString; }, z$1.core.$strip>>; + historical: z$1.ZodOptional<z$1.ZodBoolean>; }, z$1.core.$strip>, z$1.ZodObject<{ type: z$1.ZodLiteral<"turn/input/accepted">; threadId: z$1.ZodString; @@ -1961,6 +1963,7 @@ declare const providerInfoSchema: z$1.ZodObject<{ supportsServiceTier: z$1.ZodBoolean; supportsUserQuestion: z$1.ZodBoolean; supportsFork: z$1.ZodBoolean; + supportsSessionImport: z$1.ZodBoolean; supportedPermissionModes: z$1.ZodArray<z$1.ZodEnum<{ full: "full"; auto: "auto"; @@ -3688,6 +3691,9 @@ declare const hostDaemonCommandRegistry: { fork: z$1.ZodOptional<z$1.ZodObject<{ sourceProviderThreadId: z$1.ZodString; }, z$1.core.$strip>>; + sessionImport: z$1.ZodOptional<z$1.ZodObject<{ + providerThreadId: z$1.ZodString; + }, z$1.core.$strip>>; }, z$1.core.$strict>, z$1.ZodObject<{ providerThreadId: z$1.ZodString; }, z$1.core.$strip>, "settled", false>; @@ -5185,6 +5191,7 @@ declare const hostDaemonCommandRegistry: { }>; isDefault: z$1.ZodBoolean; }, z$1.core.$strip>>; + supportsSessionImport: z$1.ZodOptional<z$1.ZodBoolean>; }, z$1.core.$strip>, "onlineRpc", true>; "known_acp_agents.status": HostDaemonCommandDescriptor<"known_acp_agents.status", z$1.ZodObject<{ type: z$1.ZodLiteral<"known_acp_agents.status">; @@ -6357,6 +6364,7 @@ declare const systemExecutionOptionsResponseSchema: z$1.ZodObject<{ supportsServiceTier: z$1.ZodBoolean; supportsUserQuestion: z$1.ZodBoolean; supportsFork: z$1.ZodBoolean; + supportsSessionImport: z$1.ZodBoolean; supportedPermissionModes: z$1.ZodArray<z$1.ZodEnum<{ auto: "auto"; "accept-edits": "accept-edits"; @@ -8087,6 +8095,31 @@ declare const forkThreadRequestSchema: z$1.ZodObject<{ originPluginId: z$1.ZodOptional<z$1.ZodString>; }, z$1.core.$strip>; type ForkThreadRequest = z$1.infer<typeof forkThreadRequestSchema>; +declare const importThreadRequestSchema: z$1.ZodObject<{ + projectId: z$1.ZodString; + providerId: z$1.ZodString; + providerSessionId: z$1.ZodString; + hostId: z$1.ZodOptional<z$1.ZodString>; + cwd: z$1.ZodString; + title: z$1.ZodOptional<z$1.ZodString>; + permissionMode: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodUnion<readonly [z$1.ZodEnum<{ + auto: "auto"; + "accept-edits": "accept-edits"; + full: "full"; + }>, z$1.ZodLiteral<"workspace-write">]>, z$1.ZodTransform<"auto" | "accept-edits" | "full", "auto" | "accept-edits" | "full" | "workspace-write">>>; + visibility: z$1.ZodDefault<z$1.ZodEnum<{ + visible: "visible"; + hidden: "hidden"; + }>>; + origin: z$1.ZodDefault<z$1.ZodEnum<{ + plugin: "plugin"; + app: "app"; + cli: "cli"; + sdk: "sdk"; + }>>; + originPluginId: z$1.ZodOptional<z$1.ZodString>; +}, z$1.core.$strip>; +type ImportThreadRequest = z$1.infer<typeof importThreadRequestSchema>; declare const sendMessageRequestSchema: z$1.ZodObject<{ input: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{ visibility: z$1.ZodOptional<z$1.ZodEnum<{ @@ -11989,6 +12022,7 @@ interface ThreadOutputResponse { type ThreadMutationResult = ThreadResponse; type ThreadSpawnResult = ThreadResponse; type ThreadForkResult = ThreadResponse; +type ThreadImportResult = ThreadResponse; type ThreadInteractionGetResult = PendingInteraction; type ThreadInteractionListResult = ThreadPendingInteractionsResponse; type ThreadInteractionResolveResult = PendingInteraction; @@ -12054,6 +12088,10 @@ interface ThreadForkArgs extends Omit<ForkThreadRequest, "origin" | "visibility" visibility?: ForkThreadRequest["visibility"]; workspace?: ForkThreadRequest["workspace"]; } +interface ThreadImportArgs extends Omit<ImportThreadRequest, "origin" | "visibility"> { + origin?: ImportThreadRequest["origin"]; + visibility?: ImportThreadRequest["visibility"]; +} interface ThreadUpdateArgs extends UpdateThreadRequest { threadId: string; } @@ -12224,6 +12262,7 @@ interface ThreadsArea { events: ThreadEventsArea; fork(args: ThreadForkArgs): Promise<ThreadForkResult>; get(args: ThreadGetArgs): Promise<ThreadGetResult>; + import(args: ThreadImportArgs): Promise<ThreadImportResult>; interactions: ThreadInteractionsArea; list(args?: ThreadListArgs): Promise<ThreadListResult>; markRead(args: ThreadActionArgs): Promise<ThreadReadStateResult>; diff --git a/packages/sdk/src/areas/threads.ts b/packages/sdk/src/areas/threads.ts index 0eabbb7da1..64ea28ff16 100644 --- a/packages/sdk/src/areas/threads.ts +++ b/packages/sdk/src/areas/threads.ts @@ -14,6 +14,7 @@ import type { CreateQueuedMessageRequest, CreateThreadRequest, ForkThreadRequest, + ImportThreadRequest, DeleteThreadRequest, PromptHistoryResponse, SendQueuedMessageResponse, @@ -95,6 +96,7 @@ export interface ThreadOutputResponse { export type ThreadMutationResult = ThreadResponse; export type ThreadSpawnResult = ThreadResponse; export type ThreadForkResult = ThreadResponse; +export type ThreadImportResult = ThreadResponse; export type ThreadInteractionGetResult = PendingInteraction; export type ThreadInteractionListResult = ThreadPendingInteractionsResponse; export type ThreadInteractionResolveResult = PendingInteraction; @@ -165,6 +167,14 @@ export interface ThreadForkArgs extends Omit< workspace?: ForkThreadRequest["workspace"]; } +export interface ThreadImportArgs extends Omit< + ImportThreadRequest, + "origin" | "visibility" +> { + origin?: ImportThreadRequest["origin"]; + visibility?: ImportThreadRequest["visibility"]; +} + export interface ThreadUpdateArgs extends UpdateThreadRequest { threadId: string; } @@ -420,6 +430,7 @@ export interface ThreadsArea { events: ThreadEventsArea; fork(args: ThreadForkArgs): Promise<ThreadForkResult>; get(args: ThreadGetArgs): Promise<ThreadGetResult>; + import(args: ThreadImportArgs): Promise<ThreadImportResult>; interactions: ThreadInteractionsArea; list(args?: ThreadListArgs): Promise<ThreadListResult>; markRead(args: ThreadActionArgs): Promise<ThreadReadStateResult>; @@ -538,6 +549,14 @@ function forkJson(args: ThreadForkArgs): ForkThreadRequest { }; } +function importJson(args: ThreadImportArgs): ImportThreadRequest { + return { + ...args, + origin: args.origin ?? "sdk", + visibility: args.visibility ?? "visible", + }; +} + function eventsListQuery(args: ThreadEventsListArgs): ThreadEventsQuery { return { ...(args.afterSeq !== undefined ? { afterSeq: args.afterSeq } : {}), @@ -914,6 +933,13 @@ export function createThreadsArea(args: CreateSdkAreaArgs): ThreadsArea { ); }, get: getThread, + async import(input) { + return transport.readJson( + transport.api.v1.threads.import.$post({ + json: importJson(input), + }), + ); + }, interactions, async list(input) { return transport.readJson( diff --git a/packages/sdk/test/public-types.test.ts b/packages/sdk/test/public-types.test.ts index 54c1e96d17..4bb2082cce 100644 --- a/packages/sdk/test/public-types.test.ts +++ b/packages/sdk/test/public-types.test.ts @@ -357,6 +357,7 @@ type ExpectedThreadsKey = | "events" | "fork" | "get" + | "import" | "interactions" | "list" | "markRead" diff --git a/packages/server-contract/src/api/threads.ts b/packages/server-contract/src/api/threads.ts index 2111529dac..9e8ec40040 100644 --- a/packages/server-contract/src/api/threads.ts +++ b/packages/server-contract/src/api/threads.ts @@ -204,6 +204,48 @@ export const forkThreadRequestSchema = z }); export type ForkThreadRequest = z.infer<typeof forkThreadRequestSchema>; +export const importThreadRequestSchema = z + .object({ + projectId: z.string().min(1), + /** ACP provider that owns the external session (e.g. "acp-omp"). */ + providerId: z.string().min(1), + /** External provider session id the new thread binds to and replays. */ + providerSessionId: z.string().min(1), + /** Host the imported session lives on; defaults to the primary host. */ + hostId: z.string().min(1).optional(), + /** + * Working directory the caller asserts the external session ran in. ACP + * has no way for bb to read this back from the session itself, so it is + * not independently verified — only checked against the project source + * path or the path of an existing workspace already attached to the + * project; anything else is refused. Required so an import can never + * silently bind to the wrong directory by omission. + */ + cwd: z.string().min(1), + title: z.string().min(1).optional(), + permissionMode: permissionModeInputSchema.optional(), + visibility: threadVisibilitySchema.default("visible"), + origin: threadCreateOriginSchema.default("sdk"), + originPluginId: z.string().min(1).optional(), + }) + .superRefine((value, ctx) => { + if (value.origin === "plugin" && value.originPluginId === undefined) { + ctx.addIssue({ + code: "custom", + message: 'originPluginId is required when origin is "plugin"', + path: ["originPluginId"], + }); + } + if (value.origin !== "plugin" && value.originPluginId !== undefined) { + ctx.addIssue({ + code: "custom", + message: 'originPluginId requires origin "plugin"', + path: ["originPluginId"], + }); + } + }); +export type ImportThreadRequest = z.infer<typeof importThreadRequestSchema>; + export const sendMessageRequestSchema = z.object({ input: z.array(promptInputSchema).min(1), model: z.string().optional(), diff --git a/packages/server-contract/src/public-api.ts b/packages/server-contract/src/public-api.ts index 5ccf11632e..f59c8faaaf 100644 --- a/packages/server-contract/src/public-api.ts +++ b/packages/server-contract/src/public-api.ts @@ -59,6 +59,7 @@ import type { CreateThreadSectionRequest, CreateThreadRequest, ForkThreadRequest, + ImportThreadRequest, DeleteThreadSectionRequest, DeleteThreadRequest, EnvironmentActionApiError, @@ -229,6 +230,7 @@ import { updateQueuedMessageRequestSchema, createThreadRequestSchema, forkThreadRequestSchema, + importThreadRequestSchema, deleteThreadRequestSchema, environmentActionRequestSchema, environmentDiffBranchesQuerySchema, @@ -919,6 +921,14 @@ export const publicApiRoutes = { ), response: jsonResponse<ThreadResponse>({ status: 201 }), }), + import: defineRoute({ + path: "/threads/import", + method: "post", + request: jsonRequest<EmptyInput, ImportThreadRequest>( + importThreadRequestSchema, + ), + response: jsonResponse<ThreadResponse>({ status: 201 }), + }), get: defineRoute({ path: "/threads/:id", method: "get", diff --git a/packages/server-contract/test/contract.test.ts b/packages/server-contract/test/contract.test.ts index 26054d919f..bc7503a3b5 100644 --- a/packages/server-contract/test/contract.test.ts +++ b/packages/server-contract/test/contract.test.ts @@ -85,6 +85,16 @@ const OPTIONAL_SERVER_FIELD_GROUPS: readonly OptionalServerFieldGroup[] = [ "forkThreadRequestSchema.title", ], }, + { + reason: + "Import requires project/provider/session and an asserted cwd; hostId defaults to the primary connected host and the remaining fields select optional behaviors.", + fields: [ + "importThreadRequestSchema.hostId", + "importThreadRequestSchema.originPluginId", + "importThreadRequestSchema.permissionMode", + "importThreadRequestSchema.title", + ], + }, { reason: "Thread creation may omit root-thread presentation and execution fields so the server can resolve project/provider defaults.", @@ -1703,6 +1713,7 @@ describe("server-contract clients", () => { contract.createQueuedMessageRequestSchema, createThreadRequestSchema: contract.createThreadRequestSchema, forkThreadRequestSchema: contract.forkThreadRequestSchema, + importThreadRequestSchema: contract.importThreadRequestSchema, environmentActionApiErrorSchema: contract.environmentActionApiErrorSchema, environmentStatusResponseSchema: contract.environmentStatusResponseSchema, threadStorageFilesQuerySchema: contract.threadStorageFilesQuerySchema, diff --git a/packages/templates/src/generated/plugin-sdk-dts.generated.ts b/packages/templates/src/generated/plugin-sdk-dts.generated.ts index 93b0884a52..8e992a0cc6 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/get-bb/bb\n\nimport * as react from 'react';\nimport { ComponentType, ReactNode } from 'react';\nimport * as z from 'zod';\nimport { z as z$1 } from 'zod';\nimport Database from 'better-sqlite3';\nimport { Context } from 'hono';\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 steerActiveThreadOnEnter: 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 onboardingCompletedAt: z$1.ZodNullable<z$1.ZodString>;\n}, z$1.core.$strict>;\ntype AppSettings = z$1.infer<typeof appSettingsSchema>;\n\ndeclare const appKeybindingOverridesSchema: z$1.ZodArray<z$1.ZodObject<{\n command: z$1.ZodEnum<{\n \"thread.jump.1\": \"thread.jump.1\";\n \"thread.jump.2\": \"thread.jump.2\";\n \"thread.jump.3\": \"thread.jump.3\";\n \"thread.jump.4\": \"thread.jump.4\";\n \"thread.jump.5\": \"thread.jump.5\";\n \"thread.jump.6\": \"thread.jump.6\";\n \"thread.jump.7\": \"thread.jump.7\";\n \"thread.jump.8\": \"thread.jump.8\";\n \"thread.jump.9\": \"thread.jump.9\";\n \"question.select.1\": \"question.select.1\";\n \"question.select.2\": \"question.select.2\";\n \"question.select.3\": \"question.select.3\";\n \"question.select.4\": \"question.select.4\";\n \"question.select.5\": \"question.select.5\";\n \"question.select.6\": \"question.select.6\";\n \"question.select.7\": \"question.select.7\";\n \"question.select.8\": \"question.select.8\";\n \"question.select.9\": \"question.select.9\";\n \"pane.focus.1\": \"pane.focus.1\";\n \"pane.focus.2\": \"pane.focus.2\";\n \"pane.focus.3\": \"pane.focus.3\";\n \"pane.focus.4\": \"pane.focus.4\";\n \"pane.focus.5\": \"pane.focus.5\";\n \"pane.focus.6\": \"pane.focus.6\";\n \"pane.focus.7\": \"pane.focus.7\";\n \"pane.focus.8\": \"pane.focus.8\";\n \"thread.new\": \"thread.new\";\n \"thread.search\": \"thread.search\";\n \"thread.previous\": \"thread.previous\";\n \"thread.next\": \"thread.next\";\n \"pane.focus.previous\": \"pane.focus.previous\";\n \"pane.focus.next\": \"pane.focus.next\";\n \"pane.maximize.toggle\": \"pane.maximize.toggle\";\n \"pane.close\": \"pane.close\";\n \"window.new\": \"window.new\";\n \"settings.open\": \"settings.open\";\n \"settings.openServers\": \"settings.openServers\";\n \"sidebar.toggle\": \"sidebar.toggle\";\n \"panel.newTab\": \"panel.newTab\";\n \"panel.close\": \"panel.close\";\n \"panel.toggle\": \"panel.toggle\";\n \"file.quickOpen\": \"file.quickOpen\";\n \"diff.toggle\": \"diff.toggle\";\n \"terminal.open\": \"terminal.open\";\n \"composer.focus\": \"composer.focus\";\n \"modelPicker.toggle\": \"modelPicker.toggle\";\n \"modelPicker.cycleModel\": \"modelPicker.cycleModel\";\n \"modelPicker.cycleReasoning\": \"modelPicker.cycleReasoning\";\n \"browser.focusLocation\": \"browser.focusLocation\";\n \"browser.reload\": \"browser.reload\";\n \"workspace.openPreferred\": \"workspace.openPreferred\";\n }>;\n shortcut: z$1.ZodNullable<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}, z$1.core.$strict>>;\ntype AppKeybindingOverrides = z$1.infer<typeof appKeybindingOverridesSchema>;\n\ndeclare const appThemeSchema: z$1.ZodObject<{\n themeId: z$1.ZodString;\n customCss: z$1.ZodNullable<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 AppTheme = z$1.infer<typeof appThemeSchema>;\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<typeof appThemeSelectionSchema>;\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<z$1.ZodString>;\n metadata: z$1.ZodOptional<z$1.ZodObject<{\n backgroundActivityChanged: z$1.ZodOptional<z$1.ZodBoolean>;\n eventTypes: z$1.ZodOptional<z$1.ZodReadonly<z$1.ZodArray<z$1.ZodString & z$1.ZodType<\"thread/started\" | \"thread/identity\" | \"turn/started\" | \"turn/completed\" | \"turn/input/accepted\" | \"thread/name/updated\" | \"thread/compacted\" | \"thread/goal/updated\" | \"thread/goal/cleared\" | \"item/started\" | \"item/completed\" | \"item/agentMessage/delta\" | \"item/commandExecution/outputDelta\" | \"item/fileChange/outputDelta\" | \"item/reasoning/summaryTextDelta\" | \"item/reasoning/textDelta\" | \"item/plan/delta\" | \"item/mcpToolCall/progress\" | \"item/toolCall/progress\" | \"item/backgroundTask/progress\" | \"item/backgroundTask/completed\" | \"thread/tokenUsage/updated\" | \"thread/contextWindowUsage/updated\" | \"turn/plan/updated\" | \"turn/diff/updated\" | \"provider/error\" | \"provider/warning\" | \"provider/modelFallback\" | \"provider/unhandled\" | \"client/thread/start\" | \"client/turn/requested\" | \"client/turn/start\" | \"system/error\" | \"system/manager/user_message\" | \"system/thread/interrupted\" | \"system/operation\" | \"system/permissionGrant/lifecycle\" | \"system/userQuestion/lifecycle\" | \"system/thread-provisioning\" | \"system/provider-turn-watchdog\", string, z$1.core.$ZodTypeInternals<\"thread/started\" | \"thread/identity\" | \"turn/started\" | \"turn/completed\" | \"turn/input/accepted\" | \"thread/name/updated\" | \"thread/compacted\" | \"thread/goal/updated\" | \"thread/goal/cleared\" | \"item/started\" | \"item/completed\" | \"item/agentMessage/delta\" | \"item/commandExecution/outputDelta\" | \"item/fileChange/outputDelta\" | \"item/reasoning/summaryTextDelta\" | \"item/reasoning/textDelta\" | \"item/plan/delta\" | \"item/mcpToolCall/progress\" | \"item/toolCall/progress\" | \"item/backgroundTask/progress\" | \"item/backgroundTask/completed\" | \"thread/tokenUsage/updated\" | \"thread/contextWindowUsage/updated\" | \"turn/plan/updated\" | \"turn/diff/updated\" | \"provider/error\" | \"provider/warning\" | \"provider/modelFallback\" | \"provider/unhandled\" | \"client/thread/start\" | \"client/turn/requested\" | \"client/turn/start\" | \"system/error\" | \"system/manager/user_message\" | \"system/thread/interrupted\" | \"system/operation\" | \"system/permissionGrant/lifecycle\" | \"system/userQuestion/lifecycle\" | \"system/thread-provisioning\" | \"system/provider-turn-watchdog\", string>>>>>;\n hasPendingInteraction: z$1.ZodOptional<z$1.ZodBoolean>;\n projectId: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strict>>;\n changes: z$1.ZodReadonly<z$1.ZodArray<z$1.ZodEnum<{\n \"thread-created\": \"thread-created\";\n \"thread-deleted\": \"thread-deleted\";\n \"events-appended\": \"events-appended\";\n \"interactions-changed\": \"interactions-changed\";\n \"status-changed\": \"status-changed\";\n \"title-changed\": \"title-changed\";\n \"queue-changed\": \"queue-changed\";\n \"archived-changed\": \"archived-changed\";\n \"pin-state-changed\": \"pin-state-changed\";\n \"parent-changed\": \"parent-changed\";\n \"environment-changed\": \"environment-changed\";\n \"read-state-changed\": \"read-state-changed\";\n \"order-changed\": \"order-changed\";\n \"tabs-changed\": \"tabs-changed\";\n \"terminals-changed\": \"terminals-changed\";\n }>>>;\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<z$1.ZodString>;\n changes: z$1.ZodReadonly<z$1.ZodArray<z$1.ZodEnum<{\n \"project-created\": \"project-created\";\n \"project-updated\": \"project-updated\";\n \"project-deleted\": \"project-deleted\";\n \"project-sources-changed\": \"project-sources-changed\";\n \"threads-changed\": \"threads-changed\";\n \"project-order-changed\": \"project-order-changed\";\n }>>>;\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<z$1.ZodString>;\n changes: z$1.ZodReadonly<z$1.ZodArray<z$1.ZodEnum<{\n \"status-changed\": \"status-changed\";\n \"environment-created\": \"environment-created\";\n \"environment-deleted\": \"environment-deleted\";\n \"metadata-changed\": \"metadata-changed\";\n \"work-status-changed\": \"work-status-changed\";\n \"git-refs-changed\": \"git-refs-changed\";\n \"thread-storage-changed\": \"thread-storage-changed\";\n }>>>;\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<z$1.ZodString>;\n changes: z$1.ZodReadonly<z$1.ZodArray<z$1.ZodEnum<{\n \"host-connected\": \"host-connected\";\n \"host-disconnected\": \"host-disconnected\";\n }>>>;\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<z$1.ZodArray<z$1.ZodEnum<{\n \"config-changed\": \"config-changed\";\n \"plugins-changed\": \"plugins-changed\";\n }>>>;\n}, z$1.core.$strict>], \"entity\">;\ntype ChangedMessage = z$1.infer<typeof changedMessageSchema>;\n\ndeclare const environmentSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n name: z$1.ZodNullable<z$1.ZodString>;\n projectId: z$1.ZodString;\n hostId: z$1.ZodString;\n path: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n baseBranch: z$1.ZodNullable<z$1.ZodString>;\n defaultBranch: z$1.ZodNullable<z$1.ZodString>;\n mergeBaseBranch: z$1.ZodNullable<z$1.ZodString>;\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<typeof environmentSchema>;\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 newOnboarding: z$1.ZodBoolean;\n toolsHub: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype Experiments = z$1.infer<typeof experimentsSchema>;\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 maxPermissionMode: z$1.ZodEnum<{\n full: \"full\";\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n }>;\n lastSeenAt: z$1.ZodNullable<z$1.ZodNumber>;\n lastRejectedProtocolVersion: z$1.ZodNullable<z$1.ZodNumber>;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype Host = z$1.infer<typeof hostSchema>;\n\ninterface JsonObject {\n [key: string]: JsonValue$1;\n}\ntype JsonValue$1 = string | number | boolean | null | JsonValue$1[] | JsonObject;\n\ndeclare const pendingInteractionResolutionSchema: z$1.ZodUnion<readonly [z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"allow_once\">;\n grantedPermissions: z$1.ZodNullable<z$1.ZodObject<{\n network: z$1.ZodNullable<z$1.ZodObject<{\n enabled: z$1.ZodNullable<z$1.ZodBoolean>;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable<z$1.ZodObject<{\n read: z$1.ZodArray<z$1.ZodString>;\n write: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodObject<{\n network: z$1.ZodNullable<z$1.ZodObject<{\n enabled: z$1.ZodNullable<z$1.ZodBoolean>;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable<z$1.ZodObject<{\n read: z$1.ZodArray<z$1.ZodString>;\n write: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodString, z$1.ZodObject<{\n selected: z$1.ZodArray<z$1.ZodString>;\n freeText: z$1.ZodOptional<z$1.ZodString>;\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<typeof pendingInteractionResolutionSchema>;\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<z$1.ZodString>;\n createdAt: z$1.ZodNumber;\n expiresAt: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;\n resolvedAt: z$1.ZodNullable<z$1.ZodNumber>;\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<z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"provider\">;\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<readonly [z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"approval\">;\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<z$1.ZodString>;\n actions: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"read\">;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"search\">;\n command: z$1.ZodString;\n query: z$1.ZodNullable<z$1.ZodString>;\n path: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodObject<{\n network: z$1.ZodNullable<z$1.ZodObject<{\n enabled: z$1.ZodNullable<z$1.ZodBoolean>;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable<z$1.ZodObject<{\n read: z$1.ZodArray<z$1.ZodString>;\n write: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodString>;\n sessionGrant: z$1.ZodNullable<z$1.ZodObject<{\n network: z$1.ZodNullable<z$1.ZodObject<{\n enabled: z$1.ZodNullable<z$1.ZodBoolean>;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable<z$1.ZodObject<{\n read: z$1.ZodArray<z$1.ZodString>;\n write: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodString>;\n permissions: z$1.ZodObject<{\n network: z$1.ZodNullable<z$1.ZodObject<{\n enabled: z$1.ZodNullable<z$1.ZodBoolean>;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable<z$1.ZodObject<{\n read: z$1.ZodArray<z$1.ZodString>;\n write: z$1.ZodArray<z$1.ZodString>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>;\n }, z$1.core.$strip>], \"kind\">;\n reason: z$1.ZodNullable<z$1.ZodString>;\n availableDecisions: z$1.ZodArray<z$1.ZodEnum<{\n allow_once: \"allow_once\";\n allow_for_session: \"allow_for_session\";\n deny: \"deny\";\n }>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"user_question\">;\n questions: z$1.ZodArray<z$1.ZodObject<{\n id: z$1.ZodString;\n prompt: z$1.ZodString;\n shortLabel: z$1.ZodOptional<z$1.ZodString>;\n multiSelect: z$1.ZodBoolean;\n options: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{\n value: z$1.ZodString;\n label: z$1.ZodString;\n description: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodUnion<readonly [z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"allow_once\">;\n grantedPermissions: z$1.ZodNullable<z$1.ZodObject<{\n network: z$1.ZodNullable<z$1.ZodObject<{\n enabled: z$1.ZodNullable<z$1.ZodBoolean>;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable<z$1.ZodObject<{\n read: z$1.ZodArray<z$1.ZodString>;\n write: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodObject<{\n network: z$1.ZodNullable<z$1.ZodObject<{\n enabled: z$1.ZodNullable<z$1.ZodBoolean>;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable<z$1.ZodObject<{\n read: z$1.ZodArray<z$1.ZodString>;\n write: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodString, z$1.ZodObject<{\n selected: z$1.ZodArray<z$1.ZodString>;\n freeText: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>]>>;\n}, z$1.core.$strip>;\ntype ProviderPendingInteraction = z$1.infer<typeof providerPendingInteractionSchema>;\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<z$1.ZodString>;\n createdAt: z$1.ZodNumber;\n expiresAt: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;\n resolvedAt: z$1.ZodNullable<z$1.ZodNumber>;\n turnId: z$1.ZodNullable<z$1.ZodString>;\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<JsonValue$1, unknown, z$1.core.$ZodTypeInternals<JsonValue$1, unknown>>;\n }, z$1.core.$strip>;\n resolution: z$1.ZodNullable<z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin_submitted\">;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype PluginPendingInteraction = z$1.infer<typeof pluginPendingInteractionSchema>;\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<typeof projectSourceSchema>;\n\ndeclare const reasoningLevelSchema: 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}>;\ntype ReasoningLevel = z$1.infer<typeof reasoningLevelSchema>;\ndeclare const serviceTierSchema: z$1.ZodEnum<{\n default: \"default\";\n fast: \"fast\";\n}>;\ntype ServiceTier = z$1.infer<typeof serviceTierSchema>;\ndeclare const permissionModeSchema: z$1.ZodEnum<{\n full: \"full\";\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n}>;\ntype PermissionMode = z$1.infer<typeof permissionModeSchema>;\ndeclare const promptInputSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{\n start: z$1.ZodNumber;\n end: z$1.ZodNumber;\n resource: z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\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<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n}, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n}, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional<z$1.ZodString>;\n sizeBytes: z$1.ZodOptional<z$1.ZodNumber>;\n mimeType: z$1.ZodOptional<z$1.ZodString>;\n}, z$1.core.$strip>], \"type\">;\ntype PromptInput = z$1.infer<typeof promptInputSchema>;\ndeclare const resolvedThreadExecutionOptionsSchema: z$1.ZodObject<{\n seq: z$1.ZodOptional<z$1.ZodNumber>;\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<typeof resolvedThreadExecutionOptionsSchema>;\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<typeof projectExecutionDefaultsSchema>;\n\n/** All thread events — provider-originated or system-originated. */\ndeclare const threadEventSchema: z$1.ZodPipe<z$1.ZodUnknown, z$1.ZodUnion<readonly [z$1.ZodIntersection<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"thread/started\">;\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<z$1.ZodString>;\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<z$1.ZodString>;\n status: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n }>;\n error: z$1.ZodOptional<z$1.ZodObject<{\n message: z$1.ZodString;\n }, z$1.core.$strip>>;\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<z$1.ZodNumber>;\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<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"text\">;\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<z$1.ZodString>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodEnum<{\n waiting_for_approval: \"waiting_for_approval\";\n denied: \"denied\";\n }>>;\n aggregatedOutput: z$1.ZodOptional<z$1.ZodString>;\n exitCode: z$1.ZodOptional<z$1.ZodNumber>;\n durationMs: z$1.ZodOptional<z$1.ZodNumber>;\n truncation: z$1.ZodOptional<z$1.ZodObject<{\n aggregatedOutput: z$1.ZodOptional<z$1.ZodObject<{\n originalLength: z$1.ZodNumber;\n retainedHeadLength: z$1.ZodNumber;\n retainedTailLength: z$1.ZodNumber;\n truncatedAt: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n result: z$1.ZodOptional<z$1.ZodObject<{\n originalLength: z$1.ZodNumber;\n retainedHeadLength: z$1.ZodNumber;\n retainedTailLength: z$1.ZodNumber;\n truncatedAt: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n resultText: z$1.ZodOptional<z$1.ZodObject<{\n originalLength: z$1.ZodNumber;\n retainedHeadLength: z$1.ZodNumber;\n retainedTailLength: z$1.ZodNumber;\n truncatedAt: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"fileChange\">;\n id: z$1.ZodString;\n changes: z$1.ZodArray<z$1.ZodObject<{\n path: z$1.ZodString;\n kind: z$1.ZodEnum<{\n add: \"add\";\n delete: \"delete\";\n update: \"update\";\n }>;\n movePath: z$1.ZodOptional<z$1.ZodString>;\n diff: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodEnum<{\n waiting_for_approval: \"waiting_for_approval\";\n denied: \"denied\";\n }>>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"webSearch\">;\n id: z$1.ZodString;\n queries: z$1.ZodArray<z$1.ZodString>;\n resultText: z$1.ZodNullable<z$1.ZodString>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n pattern: z$1.ZodNullable<z$1.ZodString>;\n resultText: z$1.ZodNullable<z$1.ZodString>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"toolCall\">;\n id: z$1.ZodString;\n server: z$1.ZodOptional<z$1.ZodString>;\n tool: z$1.ZodString;\n arguments: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;\n statusLabels: z$1.ZodOptional<z$1.ZodObject<{\n pending: z$1.ZodString;\n completed: z$1.ZodString;\n }, z$1.core.$strip>>;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n }>;\n result: z$1.ZodOptional<z$1.ZodUnknown>;\n error: z$1.ZodOptional<z$1.ZodString>;\n durationMs: z$1.ZodOptional<z$1.ZodNumber>;\n truncation: z$1.ZodOptional<z$1.ZodObject<{\n aggregatedOutput: z$1.ZodOptional<z$1.ZodObject<{\n originalLength: z$1.ZodNumber;\n retainedHeadLength: z$1.ZodNumber;\n retainedTailLength: z$1.ZodNumber;\n truncatedAt: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n result: z$1.ZodOptional<z$1.ZodObject<{\n originalLength: z$1.ZodNumber;\n retainedHeadLength: z$1.ZodNumber;\n retainedTailLength: z$1.ZodNumber;\n truncatedAt: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n resultText: z$1.ZodOptional<z$1.ZodObject<{\n originalLength: z$1.ZodNumber;\n retainedHeadLength: z$1.ZodNumber;\n retainedTailLength: z$1.ZodNumber;\n truncatedAt: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"reasoning\">;\n id: z$1.ZodString;\n summary: z$1.ZodArray<z$1.ZodString>;\n content: z$1.ZodArray<z$1.ZodString>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"contextCompaction\">;\n id: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n workflow: z$1.ZodOptional<z$1.ZodObject<{\n phases: z$1.ZodArray<z$1.ZodObject<{\n index: z$1.ZodNumber;\n title: z$1.ZodString;\n kind: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>>;\n agents: z$1.ZodArray<z$1.ZodObject<{\n index: z$1.ZodNumber;\n label: z$1.ZodString;\n state: z$1.ZodEnum<{\n running: \"running\";\n failed: \"failed\";\n queued: \"queued\";\n done: \"done\";\n skipped: \"skipped\";\n }>;\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<z$1.ZodNumber>;\n phaseTitle: z$1.ZodOptional<z$1.ZodString>;\n agentType: z$1.ZodOptional<z$1.ZodString>;\n isolation: z$1.ZodOptional<z$1.ZodString>;\n queuedAt: z$1.ZodOptional<z$1.ZodNumber>;\n startedAt: z$1.ZodOptional<z$1.ZodNumber>;\n lastToolName: z$1.ZodOptional<z$1.ZodString>;\n lastToolSummary: z$1.ZodOptional<z$1.ZodString>;\n promptPreview: z$1.ZodOptional<z$1.ZodString>;\n resultPreview: z$1.ZodOptional<z$1.ZodString>;\n error: z$1.ZodOptional<z$1.ZodString>;\n tokens: z$1.ZodOptional<z$1.ZodNumber>;\n toolCalls: z$1.ZodOptional<z$1.ZodNumber>;\n durationMs: z$1.ZodOptional<z$1.ZodNumber>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n usage: z$1.ZodOptional<z$1.ZodObject<{\n totalTokens: z$1.ZodNumber;\n toolUses: z$1.ZodNumber;\n durationMs: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n summary: z$1.ZodOptional<z$1.ZodString>;\n error: z$1.ZodOptional<z$1.ZodString>;\n outputFile: z$1.ZodOptional<z$1.ZodString>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"text\">;\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<z$1.ZodString>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodEnum<{\n waiting_for_approval: \"waiting_for_approval\";\n denied: \"denied\";\n }>>;\n aggregatedOutput: z$1.ZodOptional<z$1.ZodString>;\n exitCode: z$1.ZodOptional<z$1.ZodNumber>;\n durationMs: z$1.ZodOptional<z$1.ZodNumber>;\n truncation: z$1.ZodOptional<z$1.ZodObject<{\n aggregatedOutput: z$1.ZodOptional<z$1.ZodObject<{\n originalLength: z$1.ZodNumber;\n retainedHeadLength: z$1.ZodNumber;\n retainedTailLength: z$1.ZodNumber;\n truncatedAt: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n result: z$1.ZodOptional<z$1.ZodObject<{\n originalLength: z$1.ZodNumber;\n retainedHeadLength: z$1.ZodNumber;\n retainedTailLength: z$1.ZodNumber;\n truncatedAt: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n resultText: z$1.ZodOptional<z$1.ZodObject<{\n originalLength: z$1.ZodNumber;\n retainedHeadLength: z$1.ZodNumber;\n retainedTailLength: z$1.ZodNumber;\n truncatedAt: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"fileChange\">;\n id: z$1.ZodString;\n changes: z$1.ZodArray<z$1.ZodObject<{\n path: z$1.ZodString;\n kind: z$1.ZodEnum<{\n add: \"add\";\n delete: \"delete\";\n update: \"update\";\n }>;\n movePath: z$1.ZodOptional<z$1.ZodString>;\n diff: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodEnum<{\n waiting_for_approval: \"waiting_for_approval\";\n denied: \"denied\";\n }>>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"webSearch\">;\n id: z$1.ZodString;\n queries: z$1.ZodArray<z$1.ZodString>;\n resultText: z$1.ZodNullable<z$1.ZodString>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n pattern: z$1.ZodNullable<z$1.ZodString>;\n resultText: z$1.ZodNullable<z$1.ZodString>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"toolCall\">;\n id: z$1.ZodString;\n server: z$1.ZodOptional<z$1.ZodString>;\n tool: z$1.ZodString;\n arguments: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;\n statusLabels: z$1.ZodOptional<z$1.ZodObject<{\n pending: z$1.ZodString;\n completed: z$1.ZodString;\n }, z$1.core.$strip>>;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n }>;\n result: z$1.ZodOptional<z$1.ZodUnknown>;\n error: z$1.ZodOptional<z$1.ZodString>;\n durationMs: z$1.ZodOptional<z$1.ZodNumber>;\n truncation: z$1.ZodOptional<z$1.ZodObject<{\n aggregatedOutput: z$1.ZodOptional<z$1.ZodObject<{\n originalLength: z$1.ZodNumber;\n retainedHeadLength: z$1.ZodNumber;\n retainedTailLength: z$1.ZodNumber;\n truncatedAt: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n result: z$1.ZodOptional<z$1.ZodObject<{\n originalLength: z$1.ZodNumber;\n retainedHeadLength: z$1.ZodNumber;\n retainedTailLength: z$1.ZodNumber;\n truncatedAt: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n resultText: z$1.ZodOptional<z$1.ZodObject<{\n originalLength: z$1.ZodNumber;\n retainedHeadLength: z$1.ZodNumber;\n retainedTailLength: z$1.ZodNumber;\n truncatedAt: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"reasoning\">;\n id: z$1.ZodString;\n summary: z$1.ZodArray<z$1.ZodString>;\n content: z$1.ZodArray<z$1.ZodString>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"contextCompaction\">;\n id: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n workflow: z$1.ZodOptional<z$1.ZodObject<{\n phases: z$1.ZodArray<z$1.ZodObject<{\n index: z$1.ZodNumber;\n title: z$1.ZodString;\n kind: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>>;\n agents: z$1.ZodArray<z$1.ZodObject<{\n index: z$1.ZodNumber;\n label: z$1.ZodString;\n state: z$1.ZodEnum<{\n running: \"running\";\n failed: \"failed\";\n queued: \"queued\";\n done: \"done\";\n skipped: \"skipped\";\n }>;\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<z$1.ZodNumber>;\n phaseTitle: z$1.ZodOptional<z$1.ZodString>;\n agentType: z$1.ZodOptional<z$1.ZodString>;\n isolation: z$1.ZodOptional<z$1.ZodString>;\n queuedAt: z$1.ZodOptional<z$1.ZodNumber>;\n startedAt: z$1.ZodOptional<z$1.ZodNumber>;\n lastToolName: z$1.ZodOptional<z$1.ZodString>;\n lastToolSummary: z$1.ZodOptional<z$1.ZodString>;\n promptPreview: z$1.ZodOptional<z$1.ZodString>;\n resultPreview: z$1.ZodOptional<z$1.ZodString>;\n error: z$1.ZodOptional<z$1.ZodString>;\n tokens: z$1.ZodOptional<z$1.ZodNumber>;\n toolCalls: z$1.ZodOptional<z$1.ZodNumber>;\n durationMs: z$1.ZodOptional<z$1.ZodNumber>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n usage: z$1.ZodOptional<z$1.ZodObject<{\n totalTokens: z$1.ZodNumber;\n toolUses: z$1.ZodNumber;\n durationMs: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n summary: z$1.ZodOptional<z$1.ZodString>;\n error: z$1.ZodOptional<z$1.ZodString>;\n outputFile: z$1.ZodOptional<z$1.ZodString>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodBoolean>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodString>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n workflow: z$1.ZodOptional<z$1.ZodObject<{\n phases: z$1.ZodArray<z$1.ZodObject<{\n index: z$1.ZodNumber;\n title: z$1.ZodString;\n kind: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>>;\n agents: z$1.ZodArray<z$1.ZodObject<{\n index: z$1.ZodNumber;\n label: z$1.ZodString;\n state: z$1.ZodEnum<{\n running: \"running\";\n failed: \"failed\";\n queued: \"queued\";\n done: \"done\";\n skipped: \"skipped\";\n }>;\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<z$1.ZodNumber>;\n phaseTitle: z$1.ZodOptional<z$1.ZodString>;\n agentType: z$1.ZodOptional<z$1.ZodString>;\n isolation: z$1.ZodOptional<z$1.ZodString>;\n queuedAt: z$1.ZodOptional<z$1.ZodNumber>;\n startedAt: z$1.ZodOptional<z$1.ZodNumber>;\n lastToolName: z$1.ZodOptional<z$1.ZodString>;\n lastToolSummary: z$1.ZodOptional<z$1.ZodString>;\n promptPreview: z$1.ZodOptional<z$1.ZodString>;\n resultPreview: z$1.ZodOptional<z$1.ZodString>;\n error: z$1.ZodOptional<z$1.ZodString>;\n tokens: z$1.ZodOptional<z$1.ZodNumber>;\n toolCalls: z$1.ZodOptional<z$1.ZodNumber>;\n durationMs: z$1.ZodOptional<z$1.ZodNumber>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n usage: z$1.ZodOptional<z$1.ZodObject<{\n totalTokens: z$1.ZodNumber;\n toolUses: z$1.ZodNumber;\n durationMs: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n summary: z$1.ZodOptional<z$1.ZodString>;\n error: z$1.ZodOptional<z$1.ZodString>;\n outputFile: z$1.ZodOptional<z$1.ZodString>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n workflow: z$1.ZodOptional<z$1.ZodObject<{\n phases: z$1.ZodArray<z$1.ZodObject<{\n index: z$1.ZodNumber;\n title: z$1.ZodString;\n kind: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>>;\n agents: z$1.ZodArray<z$1.ZodObject<{\n index: z$1.ZodNumber;\n label: z$1.ZodString;\n state: z$1.ZodEnum<{\n running: \"running\";\n failed: \"failed\";\n queued: \"queued\";\n done: \"done\";\n skipped: \"skipped\";\n }>;\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<z$1.ZodNumber>;\n phaseTitle: z$1.ZodOptional<z$1.ZodString>;\n agentType: z$1.ZodOptional<z$1.ZodString>;\n isolation: z$1.ZodOptional<z$1.ZodString>;\n queuedAt: z$1.ZodOptional<z$1.ZodNumber>;\n startedAt: z$1.ZodOptional<z$1.ZodNumber>;\n lastToolName: z$1.ZodOptional<z$1.ZodString>;\n lastToolSummary: z$1.ZodOptional<z$1.ZodString>;\n promptPreview: z$1.ZodOptional<z$1.ZodString>;\n resultPreview: z$1.ZodOptional<z$1.ZodString>;\n error: z$1.ZodOptional<z$1.ZodString>;\n tokens: z$1.ZodOptional<z$1.ZodNumber>;\n toolCalls: z$1.ZodOptional<z$1.ZodNumber>;\n durationMs: z$1.ZodOptional<z$1.ZodNumber>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n usage: z$1.ZodOptional<z$1.ZodObject<{\n totalTokens: z$1.ZodNumber;\n toolUses: z$1.ZodNumber;\n durationMs: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n summary: z$1.ZodOptional<z$1.ZodString>;\n error: z$1.ZodOptional<z$1.ZodString>;\n outputFile: z$1.ZodOptional<z$1.ZodString>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodNumber>;\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<z$1.ZodNumber>;\n modelContextWindow: z$1.ZodNullable<z$1.ZodNumber>;\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<z$1.ZodObject<{\n step: z$1.ZodString;\n status: z$1.ZodOptional<z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n failed: \"failed\";\n active: \"active\";\n }>>;\n }, z$1.core.$strip>>;\n explanation: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodString>;\n willRetry: z$1.ZodOptional<z$1.ZodBoolean>;\n errorInfo: z$1.ZodOptional<z$1.ZodObject<{\n category: z$1.ZodEnum<{\n unknown: \"unknown\";\n \"active-turn-not-steerable\": \"active-turn-not-steerable\";\n \"bad-request\": \"bad-request\";\n \"connection-failed\": \"connection-failed\";\n \"context-window-exceeded\": \"context-window-exceeded\";\n billing: \"billing\";\n \"budget-exceeded\": \"budget-exceeded\";\n internal: \"internal\";\n \"max-output-tokens\": \"max-output-tokens\";\n \"max-turns\": \"max-turns\";\n overloaded: \"overloaded\";\n policy: \"policy\";\n \"rate-limit\": \"rate-limit\";\n sandbox: \"sandbox\";\n \"stream-disconnected\": \"stream-disconnected\";\n \"structured-output-retries\": \"structured-output-retries\";\n \"thread-rollback-failed\": \"thread-rollback-failed\";\n \"too-many-failed-attempts\": \"too-many-failed-attempts\";\n unauthorized: \"unauthorized\";\n }>;\n providerCode: z$1.ZodNullable<z$1.ZodString>;\n httpStatusCode: z$1.ZodNullable<z$1.ZodNumber>;\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<z$1.ZodString>;\n details: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodNumber]>>;\n method: z$1.ZodString;\n params: z$1.ZodOptional<z$1.ZodType<JsonValue$1, unknown, z$1.core.$ZodTypeInternals<JsonValue$1, unknown>>>;\n }, z$1.core.$strip>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodUnion<readonly [z$1.ZodObject<{\n type: z$1.ZodLiteral<\"client/thread/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<z$1.ZodString, z$1.ZodUnknown>;\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<z$1.ZodString>;\n systemMessageKind: z$1.ZodOptional<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.ZodOptional<z$1.ZodNullable<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\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<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{\n start: z$1.ZodNumber;\n end: z$1.ZodNumber;\n resource: z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\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<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional<z$1.ZodString>;\n sizeBytes: z$1.ZodOptional<z$1.ZodNumber>;\n mimeType: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>], \"type\">>;\n inputGroups: z$1.ZodOptional<z$1.ZodArray<z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{\n start: z$1.ZodNumber;\n end: z$1.ZodNumber;\n resource: z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\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<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional<z$1.ZodString>;\n sizeBytes: z$1.ZodOptional<z$1.ZodNumber>;\n mimeType: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"steer\">;\n expectedTurnId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString, z$1.ZodUnknown>;\n }, z$1.core.$strip>;\n execution: z$1.ZodObject<{\n seq: z$1.ZodOptional<z$1.ZodNumber>;\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<z$1.ZodString, z$1.ZodUnknown>;\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<z$1.ZodString>;\n message: z$1.ZodString;\n detail: z$1.ZodOptional<z$1.ZodString>;\n reconnectAttempt: z$1.ZodOptional<z$1.ZodNumber>;\n reconnectTotal: z$1.ZodOptional<z$1.ZodNumber>;\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<z$1.ZodString>;\n turnId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodRecord<z$1.ZodString, z$1.ZodType<JsonValue$1, unknown, z$1.core.$ZodTypeInternals<JsonValue$1, unknown>>>>;\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<z$1.ZodNullable<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"allow_once\">;\n grantedPermissions: z$1.ZodNullable<z$1.ZodObject<{\n network: z$1.ZodNullable<z$1.ZodObject<{\n enabled: z$1.ZodNullable<z$1.ZodBoolean>;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable<z$1.ZodObject<{\n read: z$1.ZodArray<z$1.ZodString>;\n write: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodObject<{\n network: z$1.ZodNullable<z$1.ZodObject<{\n enabled: z$1.ZodNullable<z$1.ZodBoolean>;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable<z$1.ZodObject<{\n read: z$1.ZodArray<z$1.ZodString>;\n write: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodNullable<z$1.ZodString>>;\n subject: z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"permission_grant\">;\n itemId: z$1.ZodString;\n toolName: z$1.ZodNullable<z$1.ZodString>;\n permissions: z$1.ZodObject<{\n network: z$1.ZodNullable<z$1.ZodObject<{\n enabled: z$1.ZodNullable<z$1.ZodBoolean>;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable<z$1.ZodObject<{\n read: z$1.ZodArray<z$1.ZodString>;\n write: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodNullable<z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"user_answer\">;\n answers: z$1.ZodRecord<z$1.ZodString, z$1.ZodObject<{\n selected: z$1.ZodArray<z$1.ZodString>;\n freeText: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>>;\n statusReason: z$1.ZodDefault<z$1.ZodNullable<z$1.ZodString>>;\n payload: z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"user_question\">;\n questions: z$1.ZodArray<z$1.ZodObject<{\n id: z$1.ZodString;\n prompt: z$1.ZodString;\n shortLabel: z$1.ZodOptional<z$1.ZodString>;\n multiSelect: z$1.ZodBoolean;\n options: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{\n value: z$1.ZodString;\n label: z$1.ZodString;\n description: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodObject<{\n type: z$1.ZodEnum<{\n output: \"output\";\n step: \"step\";\n }>;\n key: z$1.ZodString;\n text: z$1.ZodString;\n startedAt: z$1.ZodOptional<z$1.ZodNumber>;\n status: z$1.ZodOptional<z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n started: \"started\";\n }>>;\n metadata: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;\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<z$1.ZodString>;\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<typeof threadEventSchema>;\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<z$1.ZodString>;\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<z$1.ZodEnum<{\n full: \"full\";\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n }>>;\n }, z$1.core.$strip>;\n composerActions: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"skills\">;\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<typeof providerInfoSchema>;\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<typeof threadEventScopeSchema>;\n\ntype ThreadEventByType = {\n [TType in ThreadEventType]: Extract<ThreadEvent, {\n type: TType;\n }>;\n};\ntype ThreadEventForType<TType extends ThreadEventType> = ThreadEventByType[TType];\ntype StoredThreadEventDataFromEvent<TEvent extends ThreadEvent> = Omit<TEvent, \"threadId\" | \"type\" | \"scope\">;\ninterface ThreadEventRowBase {\n id: string;\n scope: ThreadEventScope;\n threadId: string;\n seq: number;\n createdAt: number;\n}\ntype ThreadEventRowFromEvent<TEvent extends ThreadEvent> = ThreadEventRowBase & {\n type: TEvent[\"type\"];\n data: StoredThreadEventDataFromEvent<TEvent>;\n};\ntype ThreadEventRowOfType<TType extends ThreadEventType> = ThreadEventRowFromEvent<ThreadEventForType<TType>>;\ntype ThreadEventRow = {\n [TType in ThreadEventType]: ThreadEventRowOfType<TType>;\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<typeof threadStatusSchema>;\n\ndeclare const threadTimelinePendingTodosSchema: z$1.ZodObject<{\n sourceSeq: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n items: z$1.ZodArray<z$1.ZodObject<{\n id: z$1.ZodString;\n text: z$1.ZodString;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n in_progress: \"in_progress\";\n }>;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype ThreadTimelinePendingTodos = z$1.infer<typeof threadTimelinePendingTodosSchema>;\n\ndeclare const threadQueuedMessageSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n content: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{\n start: z$1.ZodNumber;\n end: z$1.ZodNumber;\n resource: z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\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<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional<z$1.ZodString>;\n sizeBytes: z$1.ZodOptional<z$1.ZodNumber>;\n mimeType: z$1.ZodOptional<z$1.ZodString>;\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<typeof threadQueuedMessageSchema>;\n\ndeclare const createThreadEnvironmentArgsSchema: 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<z$1.ZodString>;\n workspace: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"unmanaged\">;\n path: z$1.ZodNullable<z$1.ZodString>;\n branch: z$1.ZodOptional<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"existing\">;\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\">;\ntype CreateThreadEnvironmentArgs = z$1.infer<typeof createThreadEnvironmentArgsSchema>;\ndeclare const workspaceFileListResponseSchema: z$1.ZodObject<{\n files: z$1.ZodArray<z$1.ZodObject<{\n path: z$1.ZodString;\n name: z$1.ZodString;\n }, z$1.core.$strip>>;\n truncated: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype WorkspaceFileListResponse = z$1.infer<typeof workspaceFileListResponseSchema>;\ndeclare const workspacePathListResponseSchema: z$1.ZodObject<{\n paths: z$1.ZodArray<z$1.ZodObject<{\n kind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n name: z$1.ZodString;\n score: z$1.ZodNumber;\n positions: z$1.ZodArray<z$1.ZodNumber>;\n }, z$1.core.$strip>>;\n truncated: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype WorkspacePathListResponse = z$1.infer<typeof workspacePathListResponseSchema>;\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<z$1.ZodString, z$1.ZodTransform<string, string>>;\n}, z$1.core.$strict>, z$1.ZodObject<{\n hostId: z$1.ZodString;\n type: z$1.ZodLiteral<\"clone\">;\n targetPath: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<string, string>>>;\n remoteUrl: z$1.ZodOptional<z$1.ZodString>;\n}, z$1.core.$strict>], \"type\">;\ntype CreateProjectSourceRequest = z$1.infer<typeof createProjectSourceRequestSchema>;\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<z$1.ZodString, z$1.ZodTransform<string, string>>;\n }, z$1.core.$strict>;\n}, z$1.core.$strip>;\ntype CreateProjectRequest = z$1.infer<typeof createProjectRequestSchema>;\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<typeof threadSectionSchema>;\ndeclare const createThreadSectionRequestSchema: z$1.ZodObject<{\n name: z$1.ZodString;\n}, z$1.core.$strict>;\ntype CreateThreadSectionRequest = z$1.infer<typeof createThreadSectionRequestSchema>;\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<typeof updateThreadSectionRequestSchema>;\ndeclare const deleteThreadSectionRequestSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n}, z$1.core.$strict>;\ntype DeleteThreadSectionRequest = z$1.infer<typeof deleteThreadSectionRequestSchema>;\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<typeof threadSectionMutationResponseSchema>;\ndeclare const reorderProjectRequestSchema: z$1.ZodObject<{\n previousProjectId: z$1.ZodNullable<z$1.ZodString>;\n nextProjectId: z$1.ZodNullable<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype ReorderProjectRequest = z$1.infer<typeof reorderProjectRequestSchema>;\ndeclare const projectListQuerySchema: z$1.ZodObject<{\n include: z$1.ZodOptional<z$1.ZodString>;\n includePersonal: z$1.ZodOptional<z$1.ZodEnum<{\n true: \"true\";\n false: \"false\";\n }>>;\n}, z$1.core.$strip>;\ntype ProjectListQuery = z$1.infer<typeof projectListQuerySchema>;\ndeclare const projectFilesQuerySchema: z$1.ZodObject<{\n query: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;\n limit: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;\n hostId: z$1.ZodOptional<z$1.ZodString>;\n environmentId: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodOptional<z$1.ZodString>>>;\n}, z$1.core.$strip>;\ntype ProjectFilesQuery = z$1.infer<typeof projectFilesQuerySchema>;\ndeclare const projectPathsQuerySchema: z$1.ZodObject<{\n query: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;\n limit: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;\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<z$1.ZodString>;\n environmentId: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodOptional<z$1.ZodString>>>;\n}, z$1.core.$strip>;\ntype ProjectPathsQuery = z$1.infer<typeof projectPathsQuerySchema>;\ndeclare const projectFileContentQuerySchema: z$1.ZodObject<{\n path: z$1.ZodString;\n hostId: z$1.ZodOptional<z$1.ZodString>;\n environmentId: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodOptional<z$1.ZodString>>>;\n}, z$1.core.$strip>;\ntype ProjectFileContentQuery = z$1.infer<typeof projectFileContentQuerySchema>;\ndeclare const projectBranchesQuerySchema: z$1.ZodObject<{\n query: z$1.ZodOptional<z$1.ZodString>;\n limit: z$1.ZodOptional<z$1.ZodString>;\n hostId: z$1.ZodString;\n selectedBranch: z$1.ZodOptional<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype ProjectBranchesQuery = z$1.infer<typeof projectBranchesQuerySchema>;\ndeclare const projectBranchesResponseSchema: z$1.ZodObject<{\n branches: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"detached\">;\n headSha: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unborn\">;\n branchName: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n defaultBranchRelation: z$1.ZodNullable<z$1.ZodEnum<{\n unknown: \"unknown\";\n equal: \"equal\";\n \"local-behind\": \"local-behind\";\n \"local-ahead\": \"local-ahead\";\n diverged: \"diverged\";\n }>>;\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<z$1.ZodString>;\n remoteBranches: z$1.ZodArray<z$1.ZodString>;\n remoteBranchesTruncated: z$1.ZodBoolean;\n selectedBranch: z$1.ZodNullable<z$1.ZodObject<{\n name: z$1.ZodString;\n kind: z$1.ZodEnum<{\n local: \"local\";\n remote: \"remote\";\n missing: \"missing\";\n }>;\n }, z$1.core.$strip>>;\n defaultWorktreeBaseBranch: z$1.ZodNullable<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype ProjectBranchesResponse = z$1.infer<typeof projectBranchesResponseSchema>;\ndeclare const promptHistoryQuerySchema: z$1.ZodObject<{\n limit: z$1.ZodOptional<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype PromptHistoryQuery = z$1.infer<typeof promptHistoryQuerySchema>;\ndeclare const promptHistoryResponseSchema: z$1.ZodArray<z$1.ZodObject<{\n id: z$1.ZodString;\n createdAt: z$1.ZodNumber;\n input: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{\n start: z$1.ZodNumber;\n end: z$1.ZodNumber;\n resource: z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\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<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional<z$1.ZodString>;\n sizeBytes: z$1.ZodOptional<z$1.ZodNumber>;\n mimeType: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>], \"type\">>;\n}, z$1.core.$strip>>;\ntype PromptHistoryResponse = z$1.infer<typeof promptHistoryResponseSchema>;\ndeclare const updateProjectRequestSchema: z$1.ZodObject<{\n name: z$1.ZodOptional<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype UpdateProjectRequest = z$1.infer<typeof updateProjectRequestSchema>;\ndeclare const updateProjectSourceRequestSchema: z$1.ZodObject<{\n type: z$1.ZodLiteral<\"local_path\">;\n path: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<string, string>>>;\n isDefault: z$1.ZodOptional<z$1.ZodLiteral<true>>;\n}, z$1.core.$strict>;\ntype UpdateProjectSourceRequest = z$1.infer<typeof updateProjectSourceRequestSchema>;\ndeclare const commandListResponseSchema: z$1.ZodObject<{\n commands: z$1.ZodArray<z$1.ZodObject<{\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 description: z$1.ZodNullable<z$1.ZodString>;\n argumentHint: z$1.ZodNullable<z$1.ZodString>;\n pluginId: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype CommandListResponse = z$1.infer<typeof commandListResponseSchema>;\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<z$1.ZodString>;\n environmentId: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodOptional<z$1.ZodString>>>;\n}, z$1.core.$strict>;\ntype ProjectCommandsQuery = z$1.infer<typeof projectCommandsQuerySchema>;\ndeclare const skillListResponseSchema: z$1.ZodObject<{\n skills: z$1.ZodArray<z$1.ZodObject<{\n id: z$1.ZodString;\n name: z$1.ZodString;\n description: z$1.ZodNullable<z$1.ZodString>;\n provider: z$1.ZodNullable<z$1.ZodEnum<{\n \"claude-code\": \"claude-code\";\n codex: \"codex\";\n }>>;\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<z$1.ZodString>;\n filePath: z$1.ZodString;\n manageable: z$1.ZodBoolean;\n registrySkillId: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype SkillListResponse = z$1.infer<typeof skillListResponseSchema>;\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<typeof skillContentResponseSchema>;\ndeclare const skillFilesResponseSchema: z$1.ZodObject<{\n files: z$1.ZodArray<z$1.ZodString>;\n truncated: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype SkillFilesResponse = z$1.infer<typeof skillFilesResponseSchema>;\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<z$1.ZodString>;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n sources: z$1.ZodArray<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>>;\n}, z$1.core.$strip>;\ntype ProjectResponse = z$1.infer<typeof projectResponseSchema>;\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<z$1.ZodString>;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n sources: z$1.ZodArray<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>>;\n threads: z$1.ZodArray<z$1.ZodObject<{\n id: z$1.ZodString;\n projectId: z$1.ZodString;\n environmentId: z$1.ZodNullable<z$1.ZodString>;\n providerId: z$1.ZodString;\n title: z$1.ZodNullable<z$1.ZodString>;\n titleFallback: z$1.ZodNullable<z$1.ZodString>;\n sectionId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n sourceThreadId: z$1.ZodNullable<z$1.ZodString>;\n originKind: z$1.ZodNullable<z$1.ZodEnum<{\n fork: \"fork\";\n }>>;\n childOrigin: z$1.ZodNullable<z$1.ZodEnum<{\n fork: \"fork\";\n }>>;\n originPluginId: z$1.ZodNullable<z$1.ZodString>;\n visibility: z$1.ZodEnum<{\n visible: \"visible\";\n hidden: \"hidden\";\n }>;\n archivedAt: z$1.ZodNullable<z$1.ZodNumber>;\n pinnedAt: z$1.ZodNullable<z$1.ZodNumber>;\n deletedAt: z$1.ZodNullable<z$1.ZodNumber>;\n lastReadAt: z$1.ZodNullable<z$1.ZodNumber>;\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<z$1.ZodNumber>;\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<z$1.ZodString>;\n hasPendingInteraction: z$1.ZodBoolean;\n environmentHostId: z$1.ZodNullable<z$1.ZodString>;\n environmentName: z$1.ZodNullable<z$1.ZodString>;\n environmentBranchName: z$1.ZodNullable<z$1.ZodString>;\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<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 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<typeof projectWithThreadsResponseSchema>;\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<z$1.ZodString>;\n sizeBytes: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype UploadedPromptAttachment = z$1.infer<typeof uploadedPromptAttachmentSchema>;\ndeclare const copyProjectAttachmentsRequestSchema: z$1.ZodObject<{\n sourceProjectId: z$1.ZodString;\n paths: z$1.ZodArray<z$1.ZodString>;\n}, z$1.core.$strict>;\ntype CopyProjectAttachmentsRequest = z$1.infer<typeof copyProjectAttachmentsRequestSchema>;\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<z$1.ZodNumber>;\n installUrl: z$1.ZodNullable<z$1.ZodString>;\n url: z$1.ZodString;\n topic: z$1.ZodNullable<z$1.ZodString>;\n summary: z$1.ZodNullable<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype RegistrySkill = z$1.infer<typeof registrySkillSchema>;\ndeclare const registrySkillsPageSchema: z$1.ZodObject<{\n skills: z$1.ZodArray<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<z$1.ZodNumber>;\n installUrl: z$1.ZodNullable<z$1.ZodString>;\n url: z$1.ZodString;\n topic: z$1.ZodNullable<z$1.ZodString>;\n summary: z$1.ZodNullable<z$1.ZodString>;\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<typeof registrySkillsPageSchema>;\ndeclare const registryRepositoryStarsSchema: z$1.ZodObject<{\n stars: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype RegistryRepositoryStars = z$1.infer<typeof registryRepositoryStarsSchema>;\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<z$1.ZodString>;\n files: z$1.ZodNullable<z$1.ZodArray<z$1.ZodObject<{\n path: z$1.ZodString;\n contents: z$1.ZodString;\n }, z$1.core.$strip>>>;\n}, z$1.core.$strip>;\ntype RegistrySkillDetail = z$1.infer<typeof registrySkillDetailSchema>;\ndeclare const registrySkillInstallResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral<true>;\n filePath: z$1.ZodString;\n}, z$1.core.$strip>;\ntype RegistrySkillInstallResponse = z$1.infer<typeof registrySkillInstallResponseSchema>;\n\ndeclare const updateEnvironmentRequestSchema: z$1.ZodObject<{\n mergeBaseBranch: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\n name: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\n}, z$1.core.$strip>;\ntype UpdateEnvironmentRequest = z$1.infer<typeof updateEnvironmentRequestSchema>;\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<z$1.ZodString>;\n limit: z$1.ZodOptional<z$1.ZodString>;\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<typeof environmentPathsQuerySchema>;\ndeclare const environmentDiffBranchesQuerySchema: z$1.ZodObject<{\n query: z$1.ZodOptional<z$1.ZodString>;\n limit: z$1.ZodOptional<z$1.ZodString>;\n selectedBranch: z$1.ZodOptional<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype EnvironmentDiffBranchesQuery = z$1.infer<typeof environmentDiffBranchesQuerySchema>;\ndeclare const environmentDiffBranchesResponseSchema: z$1.ZodObject<{\n branches: z$1.ZodArray<z$1.ZodString>;\n branchesTruncated: z$1.ZodBoolean;\n remoteBranches: z$1.ZodArray<z$1.ZodString>;\n remoteBranchesTruncated: z$1.ZodBoolean;\n selectedBranch: z$1.ZodNullable<z$1.ZodObject<{\n name: z$1.ZodString;\n kind: z$1.ZodEnum<{\n local: \"local\";\n remote: \"remote\";\n missing: \"missing\";\n }>;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype EnvironmentDiffBranchesResponse = z$1.infer<typeof environmentDiffBranchesResponseSchema>;\ndeclare const environmentStatusQuerySchema: z$1.ZodObject<{\n mergeBaseBranch: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodString, z$1.ZodString>>;\n}, z$1.core.$strip>;\ntype EnvironmentStatusQuery = z$1.infer<typeof environmentStatusQuerySchema>;\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<z$1.ZodString, z$1.ZodString>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n target: z$1.ZodLiteral<\"all\">;\n mergeBaseBranch: z$1.ZodPipe<z$1.ZodString, z$1.ZodString>;\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<typeof environmentDiffQuerySchema>;\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<typeof environmentDiffFileQuerySchema>;\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<z$1.ZodString>;\n sizeBytes: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype EnvironmentDiffFileResponse = z$1.infer<typeof environmentDiffFileResponseSchema>;\ndeclare const environmentArchiveThreadsResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral<true>;\n archivedThreadIds: z$1.ZodArray<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype EnvironmentArchiveThreadsResponse = z$1.infer<typeof environmentArchiveThreadsResponseSchema>;\ndeclare const pullRequestMergeMethodSchema: z$1.ZodEnum<{\n merge: \"merge\";\n rebase: \"rebase\";\n squash: \"squash\";\n}>;\ntype PullRequestMergeMethod = z$1.infer<typeof pullRequestMergeMethodSchema>;\ndeclare const commitActionResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral<true>;\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<typeof commitActionResponseSchema>;\ndeclare const squashMergeActionResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral<true>;\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<typeof squashMergeActionResponseSchema>;\ndeclare const pullRequestReadyActionResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral<true>;\n action: z$1.ZodLiteral<\"pull_request_ready\">;\n message: z$1.ZodString;\n}, z$1.core.$strip>;\ntype PullRequestReadyActionResponse = z$1.infer<typeof pullRequestReadyActionResponseSchema>;\ndeclare const pullRequestMergeActionResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral<true>;\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<typeof pullRequestMergeActionResponseSchema>;\ndeclare const pullRequestDraftActionResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral<true>;\n action: z$1.ZodLiteral<\"pull_request_draft\">;\n message: z$1.ZodString;\n}, z$1.core.$strip>;\ntype PullRequestDraftActionResponse = z$1.infer<typeof pullRequestDraftActionResponseSchema>;\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<z$1.ZodObject<{\n path: z$1.ZodString;\n status: z$1.ZodEnum<{\n M: \"M\";\n A: \"A\";\n D: \"D\";\n R: \"R\";\n C: \"C\";\n U: \"U\";\n \"??\": \"??\";\n \"?\": \"?\";\n }>;\n insertions: z$1.ZodNullable<z$1.ZodNumber>;\n deletions: z$1.ZodNullable<z$1.ZodNumber>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"detached\">;\n headSha: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unborn\">;\n branchName: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n defaultBranch: z$1.ZodString;\n }, z$1.core.$strip>;\n mergeBase: z$1.ZodNullable<z$1.ZodObject<{\n insertions: z$1.ZodNumber;\n deletions: z$1.ZodNumber;\n files: z$1.ZodArray<z$1.ZodObject<{\n path: z$1.ZodString;\n status: z$1.ZodEnum<{\n M: \"M\";\n A: \"A\";\n D: \"D\";\n R: \"R\";\n C: \"C\";\n U: \"U\";\n \"??\": \"??\";\n \"?\": \"?\";\n }>;\n insertions: z$1.ZodNullable<z$1.ZodNumber>;\n deletions: z$1.ZodNullable<z$1.ZodNumber>;\n }, z$1.core.$strip>>;\n mergeBaseBranch: z$1.ZodString;\n baseRef: z$1.ZodNullable<z$1.ZodString>;\n aheadCount: z$1.ZodNumber;\n behindCount: z$1.ZodNumber;\n hasCommittedUnmergedChanges: z$1.ZodBoolean;\n commits: z$1.ZodArray<z$1.ZodObject<{\n sha: z$1.ZodString;\n shortSha: z$1.ZodString;\n subject: z$1.ZodString;\n authorName: z$1.ZodString;\n authoredAt: z$1.ZodNumber;\n }, z$1.core.$strip>>;\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<z$1.ZodEnum<{\n BEHIND: \"BEHIND\";\n BLOCKED: \"BLOCKED\";\n CLEAN: \"CLEAN\";\n DIRTY: \"DIRTY\";\n DRAFT: \"DRAFT\";\n HAS_HOOKS: \"HAS_HOOKS\";\n UNKNOWN: \"UNKNOWN\";\n UNSTABLE: \"UNSTABLE\";\n }>>;\n mergeable: z$1.ZodNullable<z$1.ZodEnum<{\n UNKNOWN: \"UNKNOWN\";\n CONFLICTING: \"CONFLICTING\";\n MERGEABLE: \"MERGEABLE\";\n }>>;\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<typeof environmentPullRequestResponseSchema>;\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<z$1.ZodString>;\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<typeof environmentDiffResponseSchema>;\ndeclare const environmentDiffFilesResponseSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n files: z$1.ZodArray<z$1.ZodObject<{\n path: z$1.ZodString;\n previousPath: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n initialPatches: z$1.ZodArray<z$1.ZodObject<{\n path: z$1.ZodString;\n patch: z$1.ZodString;\n truncated: z$1.ZodBoolean;\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 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<typeof environmentDiffFilesResponseSchema>;\ndeclare const environmentDiffPatchResponseSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n patches: z$1.ZodArray<z$1.ZodObject<{\n path: z$1.ZodString;\n patch: z$1.ZodString;\n truncated: z$1.ZodBoolean;\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 EnvironmentDiffPatchResponse = z$1.infer<typeof environmentDiffPatchResponseSchema>;\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<z$1.ZodString>;\n}, z$1.core.$strict>;\ntype EnvironmentDiffPatchRequest = z$1.infer<typeof environmentDiffPatchRequestSchema>;\ntype EnvironmentStatusResponse = z$1.infer<typeof environmentStatusResponseSchema>;\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<z$1.ZodString>;\n planLabel: z$1.ZodNullable<z$1.ZodString>;\n windows: z$1.ZodArray<z$1.ZodObject<{\n label: z$1.ZodString;\n usedPercent: z$1.ZodNumber;\n resetsAt: z$1.ZodNullable<z$1.ZodString>;\n cost: z$1.ZodOptional<z$1.ZodObject<{\n usedUsdCents: z$1.ZodNumber;\n limitUsdCents: z$1.ZodNumber;\n }, z$1.core.$strip>>;\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 planLabel: z$1.ZodDefault<z$1.ZodNullable<z$1.ZodString>>;\n accountEmail: z$1.ZodDefault<z$1.ZodNullable<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<z$1.ZodString>;\n planLabel: z$1.ZodNullable<z$1.ZodString>;\n windows: z$1.ZodArray<z$1.ZodObject<{\n label: z$1.ZodString;\n usedPercent: z$1.ZodNumber;\n resetsAt: z$1.ZodNullable<z$1.ZodString>;\n cost: z$1.ZodOptional<z$1.ZodObject<{\n usedUsdCents: z$1.ZodNumber;\n limitUsdCents: z$1.ZodNumber;\n }, z$1.core.$strip>>;\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 planLabel: z$1.ZodDefault<z$1.ZodNullable<z$1.ZodString>>;\n accountEmail: z$1.ZodDefault<z$1.ZodNullable<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<z$1.ZodString>;\n planLabel: z$1.ZodNullable<z$1.ZodString>;\n windows: z$1.ZodArray<z$1.ZodObject<{\n label: z$1.ZodString;\n usedPercent: z$1.ZodNumber;\n resetsAt: z$1.ZodNullable<z$1.ZodString>;\n cost: z$1.ZodOptional<z$1.ZodObject<{\n usedUsdCents: z$1.ZodNumber;\n limitUsdCents: z$1.ZodNumber;\n }, z$1.core.$strip>>;\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 planLabel: z$1.ZodDefault<z$1.ZodNullable<z$1.ZodString>>;\n accountEmail: z$1.ZodDefault<z$1.ZodNullable<z$1.ZodString>>;\n }, z$1.core.$strip>], \"status\">;\n}, z$1.core.$strip>;\ntype ProviderUsageResponse = z$1.infer<typeof providerUsageResponseSchema>;\ndeclare const discoverReposResultSchema: z$1.ZodObject<{\n repos: z$1.ZodArray<z$1.ZodObject<{\n path: z$1.ZodString;\n name: z$1.ZodString;\n lastActivityAt: z$1.ZodString;\n originUrl: z$1.ZodNullable<z$1.ZodString>;\n agentSeen: z$1.ZodBoolean;\n agentSeenAt: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strict>>;\n truncated: z$1.ZodBoolean;\n}, z$1.core.$strict>;\ntype DiscoverReposResult = z$1.infer<typeof discoverReposResultSchema>;\ntype HostDaemonCommandTransport = \"settled\" | \"onlineRpc\";\ntype HostDaemonCommandEnvironmentLane = \"read\" | \"write\";\ntype HostDaemonFlushEventsBeforeResult = boolean | \"when-initiated\";\ninterface HostDaemonCommandDescriptor<Type extends string, Schema extends z$1.ZodTypeAny, ResultSchema extends z$1.ZodTypeAny, Transport extends HostDaemonCommandTransport, Retryable extends boolean> {\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<z$1.ZodObject<{\n displayName: z$1.ZodString;\n command: z$1.ZodString;\n args: z$1.ZodArray<z$1.ZodString>;\n env: z$1.ZodRecord<z$1.ZodString, z$1.ZodString>;\n cwd: z$1.ZodOptional<z$1.ZodString>;\n modelCli: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodObject<{\n listArgs: z$1.ZodArray<z$1.ZodString>;\n selectFlag: z$1.ZodOptional<z$1.ZodString>;\n primaryModels: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodObject<{\n flag: z$1.ZodString;\n supportedLevels: z$1.ZodArray<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 levelValues: z$1.ZodOptional<z$1.ZodRecord<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 }> & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional<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 }, z$1.core.$strict>>;\n nativeReasoning: z$1.ZodOptional<z$1.ZodObject<{\n configId: z$1.ZodString;\n supportedLevels: z$1.ZodArray<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 levelValues: z$1.ZodOptional<z$1.ZodRecord<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 }> & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional<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 }, z$1.core.$strict>>;\n permissionCli: z$1.ZodOptional<z$1.ZodObject<{\n full: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n workspaceWrite: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n readonly: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n insertAfterArgs: z$1.ZodOptional<z$1.ZodNumber>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>>;\n options: z$1.ZodIntersection<z$1.ZodObject<{\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 claudeCodePermissionMode: z$1.ZodOptional<z$1.ZodLiteral<\"plan\">>;\n claudeCodeMockCliTraffic: z$1.ZodOptional<z$1.ZodObject<{\n enabled: z$1.ZodBoolean;\n endpoint: z$1.ZodString;\n }, z$1.core.$strict>>;\n workflowsEnabled: z$1.ZodBoolean;\n memoryEnabled: z$1.ZodOptional<z$1.ZodBoolean>;\n providerSubagentsEnabled: z$1.ZodOptional<z$1.ZodBoolean>;\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<z$1.ZodObject<{\n name: z$1.ZodString;\n description: z$1.ZodString;\n inputSchema: z$1.ZodUnknown;\n }, z$1.core.$strip>>;\n injectedSkillSources: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n name: z$1.ZodString;\n description: z$1.ZodString;\n kind: z$1.ZodLiteral<\"tree\">;\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<z$1.ZodArray<z$1.ZodString>>;\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<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{\n start: z$1.ZodNumber;\n end: z$1.ZodNumber;\n resource: z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\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<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional<z$1.ZodString>;\n sizeBytes: z$1.ZodOptional<z$1.ZodNumber>;\n mimeType: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>], \"type\">>;\n inputGroups: z$1.ZodOptional<z$1.ZodArray<z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{\n start: z$1.ZodNumber;\n end: z$1.ZodNumber;\n resource: z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\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<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional<z$1.ZodString>;\n sizeBytes: z$1.ZodOptional<z$1.ZodNumber>;\n mimeType: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>], \"type\">>>>;\n threadStoragePath: z$1.ZodOptional<z$1.ZodString>;\n fork: z$1.ZodOptional<z$1.ZodObject<{\n sourceProviderThreadId: z$1.ZodString;\n }, z$1.core.$strip>>;\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<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{\n start: z$1.ZodNumber;\n end: z$1.ZodNumber;\n resource: z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\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<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional<z$1.ZodString>;\n sizeBytes: z$1.ZodOptional<z$1.ZodNumber>;\n mimeType: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>], \"type\">>;\n inputGroups: z$1.ZodOptional<z$1.ZodArray<z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{\n start: z$1.ZodNumber;\n end: z$1.ZodNumber;\n resource: z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\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<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional<z$1.ZodString>;\n sizeBytes: z$1.ZodOptional<z$1.ZodNumber>;\n mimeType: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>], \"type\">>>>;\n options: z$1.ZodIntersection<z$1.ZodObject<{\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 claudeCodePermissionMode: z$1.ZodOptional<z$1.ZodLiteral<\"plan\">>;\n claudeCodeMockCliTraffic: z$1.ZodOptional<z$1.ZodObject<{\n enabled: z$1.ZodBoolean;\n endpoint: z$1.ZodString;\n }, z$1.core.$strict>>;\n workflowsEnabled: z$1.ZodBoolean;\n memoryEnabled: z$1.ZodOptional<z$1.ZodBoolean>;\n providerSubagentsEnabled: z$1.ZodOptional<z$1.ZodBoolean>;\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<z$1.ZodObject<{\n displayName: z$1.ZodString;\n command: z$1.ZodString;\n args: z$1.ZodArray<z$1.ZodString>;\n env: z$1.ZodRecord<z$1.ZodString, z$1.ZodString>;\n cwd: z$1.ZodOptional<z$1.ZodString>;\n modelCli: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodObject<{\n listArgs: z$1.ZodArray<z$1.ZodString>;\n selectFlag: z$1.ZodOptional<z$1.ZodString>;\n primaryModels: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodObject<{\n flag: z$1.ZodString;\n supportedLevels: z$1.ZodArray<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 levelValues: z$1.ZodOptional<z$1.ZodRecord<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 }> & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional<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 }, z$1.core.$strict>>;\n nativeReasoning: z$1.ZodOptional<z$1.ZodObject<{\n configId: z$1.ZodString;\n supportedLevels: z$1.ZodArray<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 levelValues: z$1.ZodOptional<z$1.ZodRecord<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 }> & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional<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 }, z$1.core.$strict>>;\n permissionCli: z$1.ZodOptional<z$1.ZodObject<{\n full: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n workspaceWrite: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n readonly: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n insertAfterArgs: z$1.ZodOptional<z$1.ZodNumber>;\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<z$1.ZodObject<{\n displayName: z$1.ZodString;\n command: z$1.ZodString;\n args: z$1.ZodArray<z$1.ZodString>;\n env: z$1.ZodRecord<z$1.ZodString, z$1.ZodString>;\n cwd: z$1.ZodOptional<z$1.ZodString>;\n modelCli: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodObject<{\n listArgs: z$1.ZodArray<z$1.ZodString>;\n selectFlag: z$1.ZodOptional<z$1.ZodString>;\n primaryModels: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodObject<{\n flag: z$1.ZodString;\n supportedLevels: z$1.ZodArray<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 levelValues: z$1.ZodOptional<z$1.ZodRecord<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 }> & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional<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 }, z$1.core.$strict>>;\n nativeReasoning: z$1.ZodOptional<z$1.ZodObject<{\n configId: z$1.ZodString;\n supportedLevels: z$1.ZodArray<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 levelValues: z$1.ZodOptional<z$1.ZodRecord<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 }> & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional<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 }, z$1.core.$strict>>;\n permissionCli: z$1.ZodOptional<z$1.ZodObject<{\n full: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n workspaceWrite: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n readonly: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n insertAfterArgs: z$1.ZodOptional<z$1.ZodNumber>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>>;\n instructions: z$1.ZodString;\n dynamicTools: z$1.ZodArray<z$1.ZodObject<{\n name: z$1.ZodString;\n description: z$1.ZodString;\n inputSchema: z$1.ZodUnknown;\n }, z$1.core.$strip>>;\n injectedSkillSources: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n name: z$1.ZodString;\n description: z$1.ZodString;\n kind: z$1.ZodLiteral<\"tree\">;\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<z$1.ZodArray<z$1.ZodString>>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n mode: z$1.ZodLiteral<\"steer\">;\n expectedTurnId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodObject<{\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 claudeCodePermissionMode: z$1.ZodOptional<z$1.ZodLiteral<\"plan\">>;\n claudeCodeMockCliTraffic: z$1.ZodOptional<z$1.ZodObject<{\n enabled: z$1.ZodBoolean;\n endpoint: z$1.ZodString;\n }, z$1.core.$strict>>;\n workflowsEnabled: z$1.ZodBoolean;\n memoryEnabled: z$1.ZodOptional<z$1.ZodBoolean>;\n providerSubagentsEnabled: z$1.ZodOptional<z$1.ZodBoolean>;\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<z$1.ZodObject<{\n displayName: z$1.ZodString;\n command: z$1.ZodString;\n args: z$1.ZodArray<z$1.ZodString>;\n env: z$1.ZodRecord<z$1.ZodString, z$1.ZodString>;\n cwd: z$1.ZodOptional<z$1.ZodString>;\n modelCli: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodObject<{\n listArgs: z$1.ZodArray<z$1.ZodString>;\n selectFlag: z$1.ZodOptional<z$1.ZodString>;\n primaryModels: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodObject<{\n flag: z$1.ZodString;\n supportedLevels: z$1.ZodArray<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 levelValues: z$1.ZodOptional<z$1.ZodRecord<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 }> & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional<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 }, z$1.core.$strict>>;\n nativeReasoning: z$1.ZodOptional<z$1.ZodObject<{\n configId: z$1.ZodString;\n supportedLevels: z$1.ZodArray<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 levelValues: z$1.ZodOptional<z$1.ZodRecord<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 }> & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional<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 }, z$1.core.$strict>>;\n permissionCli: z$1.ZodOptional<z$1.ZodObject<{\n full: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n workspaceWrite: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n readonly: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n insertAfterArgs: z$1.ZodOptional<z$1.ZodNumber>;\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<z$1.ZodObject<{\n displayName: z$1.ZodString;\n command: z$1.ZodString;\n args: z$1.ZodArray<z$1.ZodString>;\n env: z$1.ZodRecord<z$1.ZodString, z$1.ZodString>;\n cwd: z$1.ZodOptional<z$1.ZodString>;\n modelCli: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodObject<{\n listArgs: z$1.ZodArray<z$1.ZodString>;\n selectFlag: z$1.ZodOptional<z$1.ZodString>;\n primaryModels: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodObject<{\n flag: z$1.ZodString;\n supportedLevels: z$1.ZodArray<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 levelValues: z$1.ZodOptional<z$1.ZodRecord<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 }> & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional<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 }, z$1.core.$strict>>;\n nativeReasoning: z$1.ZodOptional<z$1.ZodObject<{\n configId: z$1.ZodString;\n supportedLevels: z$1.ZodArray<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 levelValues: z$1.ZodOptional<z$1.ZodRecord<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 }> & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional<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 }, z$1.core.$strict>>;\n permissionCli: z$1.ZodOptional<z$1.ZodObject<{\n full: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n workspaceWrite: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n readonly: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n insertAfterArgs: z$1.ZodOptional<z$1.ZodNumber>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>>;\n instructions: z$1.ZodString;\n dynamicTools: z$1.ZodArray<z$1.ZodObject<{\n name: z$1.ZodString;\n description: z$1.ZodString;\n inputSchema: z$1.ZodUnknown;\n }, z$1.core.$strip>>;\n injectedSkillSources: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n name: z$1.ZodString;\n description: z$1.ZodString;\n kind: z$1.ZodLiteral<\"tree\">;\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<z$1.ZodArray<z$1.ZodString>>;\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<readonly [z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"allow_once\">;\n grantedPermissions: z$1.ZodNullable<z$1.ZodObject<{\n network: z$1.ZodNullable<z$1.ZodObject<{\n enabled: z$1.ZodNullable<z$1.ZodBoolean>;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable<z$1.ZodObject<{\n read: z$1.ZodArray<z$1.ZodString>;\n write: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodObject<{\n network: z$1.ZodNullable<z$1.ZodObject<{\n enabled: z$1.ZodNullable<z$1.ZodBoolean>;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable<z$1.ZodObject<{\n read: z$1.ZodArray<z$1.ZodString>;\n write: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodString, z$1.ZodObject<{\n selected: z$1.ZodArray<z$1.ZodString>;\n freeText: z$1.ZodOptional<z$1.ZodString>;\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 reasoningEffort: z$1.ZodLiteral<\"none\">;\n prompt: z$1.ZodString;\n outputSchema: z$1.ZodType<JsonObject, unknown, z$1.core.$ZodTypeInternals<JsonObject, unknown>>;\n timeoutMs: z$1.ZodNumber;\n }, z$1.core.$strict>, z$1.ZodObject<{\n model: z$1.ZodString;\n value: z$1.ZodType<JsonObject, unknown, z$1.core.$ZodTypeInternals<JsonObject, unknown>>;\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<z$1.ZodString>;\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<z$1.ZodObject<{\n threadId: z$1.ZodString;\n provisioningId: z$1.ZodString;\n }, z$1.core.$strict>>;\n workspaceProvisionType: z$1.ZodLiteral<\"unmanaged\">;\n path: z$1.ZodString;\n checkout: z$1.ZodOptional<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"existing\">;\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<z$1.ZodObject<{\n threadId: z$1.ZodString;\n provisioningId: z$1.ZodString;\n }, z$1.core.$strict>>;\n sourcePath: z$1.ZodString;\n targetPath: z$1.ZodString;\n branchName: z$1.ZodString;\n baseBranch: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodObject<{\n threadId: z$1.ZodString;\n provisioningId: z$1.ZodString;\n }, z$1.core.$strict>>;\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<z$1.ZodString>;\n defaultBranch: z$1.ZodNullable<z$1.ZodString>;\n transcript: z$1.ZodArray<z$1.ZodObject<{\n type: z$1.ZodEnum<{\n output: \"output\";\n step: \"step\";\n }>;\n key: z$1.ZodString;\n text: z$1.ZodString;\n startedAt: z$1.ZodOptional<z$1.ZodNumber>;\n status: z$1.ZodOptional<z$1.ZodEnum<{\n started: \"started\";\n completed: \"completed\";\n failed: \"failed\";\n }>>;\n metadata: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;\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<z$1.ZodString>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n path: z$1.ZodString;\n gitRemoteUrl: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n limit: z$1.ZodNumber;\n }, z$1.core.$strip>, z$1.ZodObject<{\n files: z$1.ZodArray<z$1.ZodObject<{\n path: z$1.ZodString;\n name: z$1.ZodString;\n }, z$1.core.$strip>>;\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<z$1.ZodString>;\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<z$1.ZodObject<{\n kind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n name: z$1.ZodString;\n score: z$1.ZodNumber;\n positions: z$1.ZodArray<z$1.ZodNumber>;\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<z$1.ZodString>;\n recursive: z$1.ZodBoolean;\n }, z$1.core.$strict>, z$1.ZodObject<{\n ok: z$1.ZodLiteral<true>;\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<z$1.ZodString>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n ok: z$1.ZodLiteral<true>;\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<z$1.ZodString>;\n recursive: z$1.ZodBoolean;\n }, z$1.core.$strict>, z$1.ZodObject<{\n ok: z$1.ZodLiteral<true>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n directory: z$1.ZodString;\n parent: z$1.ZodNullable<z$1.ZodString>;\n entries: z$1.ZodArray<z$1.ZodObject<{\n kind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\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.ZodArray<z$1.ZodString>, z$1.ZodTransform<string[], string[]>>;\n type: z$1.ZodLiteral<\"host.paths_exist\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n existence: z$1.ZodRecord<z$1.ZodString, z$1.ZodBoolean>;\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<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n commands: z$1.ZodArray<z$1.ZodObject<{\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 user: \"user\";\n }>;\n description: z$1.ZodNullable<z$1.ZodString>;\n argumentHint: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n skills: z$1.ZodArray<z$1.ZodObject<{\n id: z$1.ZodString;\n name: z$1.ZodString;\n description: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n rootPath: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>], \"outcome\">, \"onlineRpc\", false>;\n \"host.install_global_skills\": HostDaemonCommandDescriptor<\"host.install_global_skills\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.install_global_skills\">;\n skills: z$1.ZodArray<z$1.ZodObject<{\n name: z$1.ZodString;\n treeHash: z$1.ZodString;\n entryPath: z$1.ZodString;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n installations: z$1.ZodArray<z$1.ZodObject<{\n name: z$1.ZodString;\n path: z$1.ZodString;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>, \"onlineRpc\", false>;\n \"host.global_skills_status\": HostDaemonCommandDescriptor<\"host.global_skills_status\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.global_skills_status\">;\n names: z$1.ZodArray<z$1.ZodString>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n entries: z$1.ZodArray<z$1.ZodObject<{\n name: z$1.ZodString;\n path: z$1.ZodString;\n treeHash: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>, \"onlineRpc\", true>;\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<z$1.ZodString>;\n selectedBranch: z$1.ZodOptional<z$1.ZodString>;\n limit: z$1.ZodNumber;\n }, z$1.core.$strip>, z$1.ZodObject<{\n branches: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"detached\">;\n headSha: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unborn\">;\n branchName: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n defaultBranchRelation: z$1.ZodNullable<z$1.ZodEnum<{\n unknown: \"unknown\";\n equal: \"equal\";\n \"local-behind\": \"local-behind\";\n \"local-ahead\": \"local-ahead\";\n diverged: \"diverged\";\n }>>;\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<z$1.ZodString>;\n remoteBranches: z$1.ZodArray<z$1.ZodString>;\n remoteBranchesTruncated: z$1.ZodBoolean;\n selectedBranch: z$1.ZodNullable<z$1.ZodObject<{\n name: z$1.ZodString;\n kind: z$1.ZodEnum<{\n local: \"local\";\n remote: \"remote\";\n missing: \"missing\";\n }>;\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<z$1.ZodString>;\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<z$1.ZodString>;\n ref: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n sizeBytes: z$1.ZodNumber;\n modifiedAtMs: z$1.ZodOptional<z$1.ZodNumber>;\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<z$1.ZodString>;\n sizeBytes: z$1.ZodNumber;\n modifiedAtMs: z$1.ZodOptional<z$1.ZodNumber>;\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<z$1.ZodString>;\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<z$1.ZodNullable<z$1.ZodString>>;\n mode: z$1.ZodOptional<z$1.ZodNumber>;\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<z$1.ZodString>;\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<z$1.ZodObject<{\n displayName: z$1.ZodString;\n command: z$1.ZodString;\n args: z$1.ZodArray<z$1.ZodString>;\n env: z$1.ZodRecord<z$1.ZodString, z$1.ZodString>;\n cwd: z$1.ZodOptional<z$1.ZodString>;\n modelCli: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodObject<{\n listArgs: z$1.ZodArray<z$1.ZodString>;\n selectFlag: z$1.ZodOptional<z$1.ZodString>;\n primaryModels: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodObject<{\n flag: z$1.ZodString;\n supportedLevels: z$1.ZodArray<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 levelValues: z$1.ZodOptional<z$1.ZodRecord<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 }> & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional<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 }, z$1.core.$strict>>;\n nativeReasoning: z$1.ZodOptional<z$1.ZodObject<{\n configId: z$1.ZodString;\n supportedLevels: z$1.ZodArray<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 levelValues: z$1.ZodOptional<z$1.ZodRecord<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 }> & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional<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 }, z$1.core.$strict>>;\n permissionCli: z$1.ZodOptional<z$1.ZodObject<{\n full: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n workspaceWrite: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n readonly: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n insertAfterArgs: z$1.ZodOptional<z$1.ZodNumber>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>>;\n cwd: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n models: z$1.ZodArray<z$1.ZodObject<{\n id: z$1.ZodString;\n model: z$1.ZodString;\n displayName: z$1.ZodString;\n description: z$1.ZodString;\n supportedReasoningEfforts: z$1.ZodArray<z$1.ZodObject<{\n reasoningEffort: 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 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<z$1.ZodObject<{\n id: z$1.ZodString;\n model: z$1.ZodString;\n displayName: z$1.ZodString;\n description: z$1.ZodString;\n supportedReasoningEfforts: z$1.ZodArray<z$1.ZodObject<{\n reasoningEffort: 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 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<z$1.ZodObject<{\n id: z$1.ZodString;\n executableName: z$1.ZodString;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n agents: z$1.ZodArray<z$1.ZodObject<{\n id: z$1.ZodString;\n executableName: z$1.ZodString;\n installed: z$1.ZodBoolean;\n executablePath: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n planLabel: z$1.ZodNullable<z$1.ZodString>;\n windows: z$1.ZodArray<z$1.ZodObject<{\n label: z$1.ZodString;\n usedPercent: z$1.ZodNumber;\n resetsAt: z$1.ZodNullable<z$1.ZodString>;\n cost: z$1.ZodOptional<z$1.ZodObject<{\n usedUsdCents: z$1.ZodNumber;\n limitUsdCents: z$1.ZodNumber;\n }, z$1.core.$strip>>;\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 planLabel: z$1.ZodDefault<z$1.ZodNullable<z$1.ZodString>>;\n accountEmail: z$1.ZodDefault<z$1.ZodNullable<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<z$1.ZodString>;\n planLabel: z$1.ZodNullable<z$1.ZodString>;\n windows: z$1.ZodArray<z$1.ZodObject<{\n label: z$1.ZodString;\n usedPercent: z$1.ZodNumber;\n resetsAt: z$1.ZodNullable<z$1.ZodString>;\n cost: z$1.ZodOptional<z$1.ZodObject<{\n usedUsdCents: z$1.ZodNumber;\n limitUsdCents: z$1.ZodNumber;\n }, z$1.core.$strip>>;\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 planLabel: z$1.ZodDefault<z$1.ZodNullable<z$1.ZodString>>;\n accountEmail: z$1.ZodDefault<z$1.ZodNullable<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<z$1.ZodString>;\n planLabel: z$1.ZodNullable<z$1.ZodString>;\n windows: z$1.ZodArray<z$1.ZodObject<{\n label: z$1.ZodString;\n usedPercent: z$1.ZodNumber;\n resetsAt: z$1.ZodNullable<z$1.ZodString>;\n cost: z$1.ZodOptional<z$1.ZodObject<{\n usedUsdCents: z$1.ZodNumber;\n limitUsdCents: z$1.ZodNumber;\n }, z$1.core.$strip>>;\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 planLabel: z$1.ZodDefault<z$1.ZodNullable<z$1.ZodString>>;\n accountEmail: z$1.ZodDefault<z$1.ZodNullable<z$1.ZodString>>;\n }, z$1.core.$strip>], \"status\">;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"workspace.discover_repos\": HostDaemonCommandDescriptor<\"workspace.discover_repos\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"workspace.discover_repos\">;\n maxDepth: z$1.ZodNumber;\n sinceDays: z$1.ZodNumber;\n limit: z$1.ZodNumber;\n }, z$1.core.$strict>, z$1.ZodObject<{\n repos: z$1.ZodArray<z$1.ZodObject<{\n path: z$1.ZodString;\n name: z$1.ZodString;\n lastActivityAt: z$1.ZodString;\n originUrl: z$1.ZodNullable<z$1.ZodString>;\n agentSeen: z$1.ZodBoolean;\n agentSeenAt: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strict>>;\n truncated: z$1.ZodBoolean;\n }, z$1.core.$strict>, \"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.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n }>, z$1.ZodObject<{\n displayName: z$1.ZodString;\n executableName: z$1.ZodString;\n executablePath: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n latestVersion: z$1.ZodNullable<z$1.ZodString>;\n minimumSupportedVersion: z$1.ZodNullable<z$1.ZodString>;\n npmPackageName: z$1.ZodNullable<z$1.ZodString>;\n npmGlobalPackageVersion: z$1.ZodNullable<z$1.ZodString>;\n installAction: z$1.ZodNullable<z$1.ZodObject<{\n kind: z$1.ZodEnum<{\n install: \"install\";\n update: \"update\";\n }>;\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<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<z$1.ZodNumber>;\n signal: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodObject<{\n path: z$1.ZodString;\n status: z$1.ZodEnum<{\n M: \"M\";\n A: \"A\";\n D: \"D\";\n R: \"R\";\n C: \"C\";\n U: \"U\";\n \"??\": \"??\";\n \"?\": \"?\";\n }>;\n insertions: z$1.ZodNullable<z$1.ZodNumber>;\n deletions: z$1.ZodNullable<z$1.ZodNumber>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"detached\">;\n headSha: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unborn\">;\n branchName: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n defaultBranch: z$1.ZodString;\n }, z$1.core.$strip>;\n mergeBase: z$1.ZodNullable<z$1.ZodObject<{\n insertions: z$1.ZodNumber;\n deletions: z$1.ZodNumber;\n files: z$1.ZodArray<z$1.ZodObject<{\n path: z$1.ZodString;\n status: z$1.ZodEnum<{\n M: \"M\";\n A: \"A\";\n D: \"D\";\n R: \"R\";\n C: \"C\";\n U: \"U\";\n \"??\": \"??\";\n \"?\": \"?\";\n }>;\n insertions: z$1.ZodNullable<z$1.ZodNumber>;\n deletions: z$1.ZodNullable<z$1.ZodNumber>;\n }, z$1.core.$strip>>;\n mergeBaseBranch: z$1.ZodString;\n baseRef: z$1.ZodNullable<z$1.ZodString>;\n aheadCount: z$1.ZodNumber;\n behindCount: z$1.ZodNumber;\n hasCommittedUnmergedChanges: z$1.ZodBoolean;\n commits: z$1.ZodArray<z$1.ZodObject<{\n sha: z$1.ZodString;\n shortSha: z$1.ZodString;\n subject: z$1.ZodString;\n authorName: z$1.ZodString;\n authoredAt: z$1.ZodNumber;\n }, z$1.core.$strip>>;\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<z$1.ZodString>;\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<z$1.ZodObject<{\n path: z$1.ZodString;\n previousPath: z$1.ZodNullable<z$1.ZodString>;\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<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 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<z$1.ZodString>;\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<z$1.ZodObject<{\n path: z$1.ZodString;\n patch: z$1.ZodString;\n truncated: z$1.ZodBoolean;\n }, z$1.core.$strict>>;\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<z$1.ZodObject<{\n name: z$1.ZodString;\n status: z$1.ZodEnum<{\n unknown: \"unknown\";\n completed: \"completed\";\n queued: \"queued\";\n in_progress: \"in_progress\";\n }>;\n conclusion: z$1.ZodNullable<z$1.ZodEnum<{\n unknown: \"unknown\";\n success: \"success\";\n cancelled: \"cancelled\";\n failure: \"failure\";\n skipped: \"skipped\";\n neutral: \"neutral\";\n timed_out: \"timed_out\";\n action_required: \"action_required\";\n startup_failure: \"startup_failure\";\n stale: \"stale\";\n }>>;\n url: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strict>>;\n reviewDecision: z$1.ZodNullable<z$1.ZodEnum<{\n APPROVED: \"APPROVED\";\n CHANGES_REQUESTED: \"CHANGES_REQUESTED\";\n REVIEW_REQUIRED: \"REVIEW_REQUIRED\";\n }>>;\n reviewRequestCount: z$1.ZodNumber;\n mergeStateStatus: z$1.ZodNullable<z$1.ZodEnum<{\n BEHIND: \"BEHIND\";\n BLOCKED: \"BLOCKED\";\n CLEAN: \"CLEAN\";\n DIRTY: \"DIRTY\";\n DRAFT: \"DRAFT\";\n HAS_HOOKS: \"HAS_HOOKS\";\n UNKNOWN: \"UNKNOWN\";\n UNSTABLE: \"UNSTABLE\";\n }>>;\n mergeable: z$1.ZodNullable<z$1.ZodEnum<{\n UNKNOWN: \"UNKNOWN\";\n CONFLICTING: \"CONFLICTING\";\n MERGEABLE: \"MERGEABLE\";\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\">, \"onlineRpc\", true>;\n};\ntype HostDaemonCommandRegistry = typeof hostDaemonCommandRegistry;\ntype AnyHostDaemonCommandDescriptor = HostDaemonCommandRegistry[keyof HostDaemonCommandRegistry];\ntype HostDaemonCommandDescriptorForTransport<Transport extends HostDaemonCommandTransport> = Extract<AnyHostDaemonCommandDescriptor, {\n transport: Transport;\n}>;\ntype HostDaemonResultSchemaMapForTransport<Transport extends HostDaemonCommandTransport> = {\n [Descriptor in HostDaemonCommandDescriptorForTransport<Transport> as Descriptor[\"type\"]]: Descriptor[\"resultSchema\"];\n};\ntype HostDaemonOnlineRpcResultSchemaMap = HostDaemonResultSchemaMapForTransport<\"onlineRpc\">;\ntype HostDaemonOnlineRpcResultByType = {\n [K in keyof HostDaemonOnlineRpcResultSchemaMap]: z$1.infer<HostDaemonOnlineRpcResultSchemaMap[K]>;\n};\n\ndeclare const pickFolderResponseSchema: z$1.ZodObject<{\n path: z$1.ZodNullable<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype PickFolderResponse = z$1.infer<typeof pickFolderResponseSchema>;\ndeclare const pathsExistRequestSchema: z$1.ZodObject<{\n paths: z$1.ZodPipe<z$1.ZodArray<z$1.ZodString>, z$1.ZodTransform<string[], string[]>>;\n}, z$1.core.$strip>;\ntype PathsExistRequest = z$1.infer<typeof pathsExistRequestSchema>;\ndeclare const pathsExistResponseSchema: z$1.ZodObject<{\n existence: z$1.ZodRecord<z$1.ZodString, z$1.ZodBoolean>;\n}, z$1.core.$strip>;\ntype PathsExistResponse = z$1.infer<typeof pathsExistResponseSchema>;\ndeclare const providerCliStatusResponseSchema: z$1.ZodRecord<z$1.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n}>, z$1.ZodObject<{\n displayName: z$1.ZodString;\n executableName: z$1.ZodString;\n executablePath: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n latestVersion: z$1.ZodNullable<z$1.ZodString>;\n minimumSupportedVersion: z$1.ZodNullable<z$1.ZodString>;\n npmPackageName: z$1.ZodNullable<z$1.ZodString>;\n npmGlobalPackageVersion: z$1.ZodNullable<z$1.ZodString>;\n installAction: z$1.ZodNullable<z$1.ZodObject<{\n kind: z$1.ZodEnum<{\n install: \"install\";\n update: \"update\";\n }>;\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<typeof providerCliStatusResponseSchema>;\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<typeof providerCliInstallRequestSchema>;\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<z$1.ZodNumber>;\n signal: z$1.ZodNullable<z$1.ZodString>;\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<typeof providerCliInstallEventSchema>;\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<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype HostDirectoryQuery = z$1.infer<typeof hostDirectoryQuerySchema>;\ndeclare const hostDirectoryListingSchema: z$1.ZodObject<{\n directory: z$1.ZodString;\n parent: z$1.ZodNullable<z$1.ZodString>;\n entries: z$1.ZodArray<z$1.ZodObject<{\n kind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\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<typeof hostDirectoryListingSchema>;\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<typeof hostCloneDefaultPathQuerySchema>;\ndeclare const hostCloneDefaultPathResponseSchema: z$1.ZodObject<{\n path: z$1.ZodString;\n}, z$1.core.$strict>;\ntype HostCloneDefaultPathResponse = z$1.infer<typeof hostCloneDefaultPathResponseSchema>;\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<typeof createHostJoinCodeResponseSchema>;\ndeclare const updateHostRequestSchema: z$1.ZodObject<{\n name: z$1.ZodString;\n}, z$1.core.$strict>;\ntype UpdateHostRequest = z$1.infer<typeof updateHostRequestSchema>;\ndeclare const hostRetryUpdateResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral<true>;\n}, z$1.core.$strict>;\ntype HostRetryUpdateResponse = z$1.infer<typeof hostRetryUpdateResponseSchema>;\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<typeof hostPickFolderRequestSchema>;\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<z$1.ZodLiteral<true>>;\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<z$1.ZodObject<{\n version: z$1.ZodString;\n display: z$1.ZodString;\n }, z$1.core.$strip>>;\n blocked: z$1.ZodOptional<z$1.ZodObject<{\n version: z$1.ZodString;\n reasons: z$1.ZodArray<z$1.ZodString>;\n }, z$1.core.$strip>>;\n detail: z$1.ZodOptional<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype PluginUpdateCheckEntry = z$1.infer<typeof pluginUpdateCheckEntrySchema>;\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<z$1.ZodObject<{\n version: z$1.ZodString;\n display: z$1.ZodString;\n }, z$1.core.$strip>>;\n outcome: z$1.ZodEnum<{\n current: \"current\";\n updated: \"updated\";\n \"rolled-back\": \"rolled-back\";\n }>;\n detail: z$1.ZodOptional<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype PluginApplyUpdateResult$1 = z$1.infer<typeof pluginApplyUpdateResultSchema>;\ndeclare const pluginSourceDetailSchema: z$1.ZodObject<{\n requested: z$1.ZodString;\n resolved: z$1.ZodString;\n integrity: z$1.ZodOptional<z$1.ZodString>;\n registry: z$1.ZodOptional<z$1.ZodString>;\n engines: z$1.ZodObject<{\n bb: z$1.ZodOptional<z$1.ZodString>;\n bbPluginSdk: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>;\n installedAt: z$1.ZodOptional<z$1.ZodNumber>;\n history: z$1.ZodArray<z$1.ZodObject<{\n version: z$1.ZodString;\n activatedAt: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype PluginSourceDetail = z$1.infer<typeof pluginSourceDetailSchema>;\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<z$1.ZodString>;\n sourceDisplay: z$1.ZodString;\n updateState: z$1.ZodObject<{\n outcome: z$1.ZodOptional<z$1.ZodEnum<{\n unavailable: \"unavailable\";\n incompatible: \"incompatible\";\n current: \"current\";\n \"update-available\": \"update-available\";\n pinned: \"pinned\";\n }>>;\n availableVersion: z$1.ZodOptional<z$1.ZodString>;\n blockedVersion: z$1.ZodOptional<z$1.ZodString>;\n blockedReasons: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n lastCheckAt: z$1.ZodOptional<z$1.ZodNumber>;\n lastFailure: z$1.ZodOptional<z$1.ZodObject<{\n version: z$1.ZodString;\n at: z$1.ZodNumber;\n detail: z$1.ZodString;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>;\n enabled: z$1.ZodBoolean;\n description: z$1.ZodNullable<z$1.ZodString>;\n name: z$1.ZodNullable<z$1.ZodString>;\n icon: z$1.ZodNullable<z$1.ZodString>;\n iconUrl: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodObject<{\n name: z$1.ZodString;\n state: z$1.ZodEnum<{\n running: \"running\";\n stopped: \"stopped\";\n backoff: \"backoff\";\n }>;\n }, z$1.core.$strip>>;\n schedules: z$1.ZodArray<z$1.ZodObject<{\n name: z$1.ZodString;\n cron: z$1.ZodString;\n nextRunAt: z$1.ZodNumber;\n lastRunAt: z$1.ZodNullable<z$1.ZodNumber>;\n lastStatus: z$1.ZodNullable<z$1.ZodEnum<{\n error: \"error\";\n running: \"running\";\n ok: \"ok\";\n }>>;\n lastError: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strip>>;\n cliCommand: z$1.ZodNullable<z$1.ZodObject<{\n name: z$1.ZodString;\n summary: z$1.ZodString;\n }, z$1.core.$strip>>;\n capabilities: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{\n kind: z$1.ZodEnum<{\n skill: \"skill\";\n theme: \"theme\";\n \"agent-tool\": \"agent-tool\";\n \"thread-integration\": \"thread-integration\";\n }>;\n id: z$1.ZodString;\n label: z$1.ZodString;\n detail: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strip>>>;\n hasSettings: z$1.ZodBoolean;\n app: z$1.ZodObject<{\n hasApp: z$1.ZodBoolean;\n bundle: z$1.ZodNullable<z$1.ZodObject<{\n jsUrl: z$1.ZodString;\n cssUrl: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n logoDarkUrl: z$1.ZodNullable<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype InstalledPlugin = z$1.infer<typeof installedPluginSchema>;\ndeclare const pluginListResponseSchema: z$1.ZodObject<{\n plugins: z$1.ZodArray<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<z$1.ZodString>;\n sourceDisplay: z$1.ZodString;\n updateState: z$1.ZodObject<{\n outcome: z$1.ZodOptional<z$1.ZodEnum<{\n unavailable: \"unavailable\";\n incompatible: \"incompatible\";\n current: \"current\";\n \"update-available\": \"update-available\";\n pinned: \"pinned\";\n }>>;\n availableVersion: z$1.ZodOptional<z$1.ZodString>;\n blockedVersion: z$1.ZodOptional<z$1.ZodString>;\n blockedReasons: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n lastCheckAt: z$1.ZodOptional<z$1.ZodNumber>;\n lastFailure: z$1.ZodOptional<z$1.ZodObject<{\n version: z$1.ZodString;\n at: z$1.ZodNumber;\n detail: z$1.ZodString;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>;\n enabled: z$1.ZodBoolean;\n description: z$1.ZodNullable<z$1.ZodString>;\n name: z$1.ZodNullable<z$1.ZodString>;\n icon: z$1.ZodNullable<z$1.ZodString>;\n iconUrl: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodObject<{\n name: z$1.ZodString;\n state: z$1.ZodEnum<{\n running: \"running\";\n stopped: \"stopped\";\n backoff: \"backoff\";\n }>;\n }, z$1.core.$strip>>;\n schedules: z$1.ZodArray<z$1.ZodObject<{\n name: z$1.ZodString;\n cron: z$1.ZodString;\n nextRunAt: z$1.ZodNumber;\n lastRunAt: z$1.ZodNullable<z$1.ZodNumber>;\n lastStatus: z$1.ZodNullable<z$1.ZodEnum<{\n error: \"error\";\n running: \"running\";\n ok: \"ok\";\n }>>;\n lastError: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strip>>;\n cliCommand: z$1.ZodNullable<z$1.ZodObject<{\n name: z$1.ZodString;\n summary: z$1.ZodString;\n }, z$1.core.$strip>>;\n capabilities: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{\n kind: z$1.ZodEnum<{\n skill: \"skill\";\n theme: \"theme\";\n \"agent-tool\": \"agent-tool\";\n \"thread-integration\": \"thread-integration\";\n }>;\n id: z$1.ZodString;\n label: z$1.ZodString;\n detail: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strip>>>;\n hasSettings: z$1.ZodBoolean;\n app: z$1.ZodObject<{\n hasApp: z$1.ZodBoolean;\n bundle: z$1.ZodNullable<z$1.ZodObject<{\n jsUrl: z$1.ZodString;\n cssUrl: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n logoDarkUrl: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype PluginListResponse = z$1.infer<typeof pluginListResponseSchema>;\ndeclare const pluginReloadResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral<true>;\n plugins: z$1.ZodArray<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<z$1.ZodString>;\n sourceDisplay: z$1.ZodString;\n updateState: z$1.ZodObject<{\n outcome: z$1.ZodOptional<z$1.ZodEnum<{\n unavailable: \"unavailable\";\n incompatible: \"incompatible\";\n current: \"current\";\n \"update-available\": \"update-available\";\n pinned: \"pinned\";\n }>>;\n availableVersion: z$1.ZodOptional<z$1.ZodString>;\n blockedVersion: z$1.ZodOptional<z$1.ZodString>;\n blockedReasons: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n lastCheckAt: z$1.ZodOptional<z$1.ZodNumber>;\n lastFailure: z$1.ZodOptional<z$1.ZodObject<{\n version: z$1.ZodString;\n at: z$1.ZodNumber;\n detail: z$1.ZodString;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>;\n enabled: z$1.ZodBoolean;\n description: z$1.ZodNullable<z$1.ZodString>;\n name: z$1.ZodNullable<z$1.ZodString>;\n icon: z$1.ZodNullable<z$1.ZodString>;\n iconUrl: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodObject<{\n name: z$1.ZodString;\n state: z$1.ZodEnum<{\n running: \"running\";\n stopped: \"stopped\";\n backoff: \"backoff\";\n }>;\n }, z$1.core.$strip>>;\n schedules: z$1.ZodArray<z$1.ZodObject<{\n name: z$1.ZodString;\n cron: z$1.ZodString;\n nextRunAt: z$1.ZodNumber;\n lastRunAt: z$1.ZodNullable<z$1.ZodNumber>;\n lastStatus: z$1.ZodNullable<z$1.ZodEnum<{\n error: \"error\";\n running: \"running\";\n ok: \"ok\";\n }>>;\n lastError: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strip>>;\n cliCommand: z$1.ZodNullable<z$1.ZodObject<{\n name: z$1.ZodString;\n summary: z$1.ZodString;\n }, z$1.core.$strip>>;\n capabilities: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{\n kind: z$1.ZodEnum<{\n skill: \"skill\";\n theme: \"theme\";\n \"agent-tool\": \"agent-tool\";\n \"thread-integration\": \"thread-integration\";\n }>;\n id: z$1.ZodString;\n label: z$1.ZodString;\n detail: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strip>>>;\n hasSettings: z$1.ZodBoolean;\n app: z$1.ZodObject<{\n hasApp: z$1.ZodBoolean;\n bundle: z$1.ZodNullable<z$1.ZodObject<{\n jsUrl: z$1.ZodString;\n cssUrl: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n logoDarkUrl: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype PluginReloadResponse = z$1.infer<typeof pluginReloadResponseSchema>;\ndeclare const pluginRemoveResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral<true>;\n}, z$1.core.$strip>;\ntype PluginRemoveResponse = z$1.infer<typeof pluginRemoveResponseSchema>;\ndeclare const pluginSettingsResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral<true>;\n schema: z$1.ZodRecord<z$1.ZodString, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"string\">;\n secret: z$1.ZodOptional<z$1.ZodLiteral<true>>;\n default: z$1.ZodOptional<z$1.ZodString>;\n label: z$1.ZodString;\n description: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"boolean\">;\n default: z$1.ZodOptional<z$1.ZodBoolean>;\n label: z$1.ZodString;\n description: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"select\">;\n options: z$1.ZodArray<z$1.ZodString>;\n default: z$1.ZodOptional<z$1.ZodString>;\n label: z$1.ZodString;\n description: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"project\">;\n default: z$1.ZodOptional<z$1.ZodString>;\n label: z$1.ZodString;\n description: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strict>], \"type\">>;\n values: z$1.ZodRecord<z$1.ZodString, z$1.ZodType<JsonValue$1, unknown, z$1.core.$ZodTypeInternals<JsonValue$1, unknown>>>;\n}, z$1.core.$strip>;\ntype PluginSettingsResponse = z$1.infer<typeof pluginSettingsResponseSchema>;\ndeclare const pluginTokenResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral<true>;\n token: z$1.ZodString;\n}, z$1.core.$strip>;\ntype PluginTokenResponse = z$1.infer<typeof pluginTokenResponseSchema>;\ndeclare const pluginCatalogStatusSchema: z$1.ZodObject<{\n pluginCount: z$1.ZodNumber;\n includedPluginCount: z$1.ZodNumber;\n optionalPluginCount: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype PluginCatalogStatus = z$1.infer<typeof pluginCatalogStatusSchema>;\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<z$1.ZodString>;\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<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype PluginCatalogSearchResult$1 = z$1.infer<typeof pluginCatalogSearchResultSchema>;\n\ndeclare const systemExecutionOptionsResponseSchema: z$1.ZodObject<{\n providers: z$1.ZodArray<z$1.ZodObject<{\n id: z$1.ZodString;\n displayName: z$1.ZodString;\n logoUrl: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodEnum<{\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n full: \"full\";\n }>>;\n }, z$1.core.$strip>;\n composerActions: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"skills\">;\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 permissionCeiling: z$1.ZodEnum<{\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n full: \"full\";\n }>;\n models: z$1.ZodArray<z$1.ZodObject<{\n id: z$1.ZodString;\n model: z$1.ZodString;\n displayName: z$1.ZodString;\n description: z$1.ZodString;\n supportedReasoningEfforts: z$1.ZodArray<z$1.ZodObject<{\n reasoningEffort: 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 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<z$1.ZodObject<{\n id: z$1.ZodString;\n model: z$1.ZodString;\n displayName: z$1.ZodString;\n description: z$1.ZodString;\n supportedReasoningEfforts: z$1.ZodArray<z$1.ZodObject<{\n reasoningEffort: 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 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<z$1.ZodObject<{\n providerId: z$1.ZodString;\n code: z$1.ZodEnum<{\n failed: \"failed\";\n missing_executable: \"missing_executable\";\n auth_required: \"auth_required\";\n timeout: \"timeout\";\n }>;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype SystemExecutionOptionsResponse = z$1.infer<typeof systemExecutionOptionsResponseSchema>;\ndeclare const systemExecutionOptionsQuerySchema: z$1.ZodObject<{\n providerId: z$1.ZodOptional<z$1.ZodString>;\n hostId: z$1.ZodOptional<z$1.ZodString>;\n environmentId: z$1.ZodOptional<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype SystemExecutionOptionsQuery = z$1.infer<typeof systemExecutionOptionsQuerySchema>;\n/** Omission preserves the existing behavior of reading the primary machine. */\ndeclare const systemUsageLimitsQuerySchema: z$1.ZodObject<{\n hostId: z$1.ZodOptional<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype SystemUsageLimitsQuery = z$1.infer<typeof systemUsageLimitsQuerySchema>;\ndeclare const systemVoiceTranscriptionResponseSchema: z$1.ZodObject<{\n text: z$1.ZodString;\n}, z$1.core.$strip>;\ntype SystemVoiceTranscriptionResponse = z$1.infer<typeof systemVoiceTranscriptionResponseSchema>;\ndeclare const onboardingAgentOverviewSchema: z$1.ZodObject<{\n agents: z$1.ZodArray<z$1.ZodObject<{\n providerId: z$1.ZodString;\n displayName: z$1.ZodString;\n status: z$1.ZodEnum<{\n connected: \"connected\";\n unauthenticated: \"unauthenticated\";\n expired: \"expired\";\n not_installed: \"not_installed\";\n }>;\n planLabel: z$1.ZodNullable<z$1.ZodString>;\n accountEmail: z$1.ZodNullable<z$1.ZodString>;\n canInstall: z$1.ZodBoolean;\n loginCommand: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype OnboardingAgentOverview = z$1.infer<typeof onboardingAgentOverviewSchema>;\n/** Omission reads the primary machine, matching the usage-limits route. */\ndeclare const systemOnboardingReposQuerySchema: z$1.ZodObject<{\n hostId: z$1.ZodOptional<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype SystemOnboardingReposQuery = z$1.infer<typeof systemOnboardingReposQuerySchema>;\n/**\n * Onboarding funnel events, reported by the app and forwarded to the server's\n * anonymous telemetry. Categorical or counts only — never paths, project names,\n * or account emails.\n */\ndeclare const onboardingTelemetryEventSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n name: z$1.ZodLiteral<\"onboarding_started\">;\n agentState: z$1.ZodEnum<{\n connected: \"connected\";\n none: \"none\";\n signed_out: \"signed_out\";\n }>;\n detectedAgentCount: z$1.ZodNumber;\n}, z$1.core.$strip>, z$1.ZodObject<{\n name: z$1.ZodLiteral<\"onboarding_step_completed\">;\n step: z$1.ZodEnum<{\n agents: \"agents\";\n projects: \"projects\";\n }>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n name: z$1.ZodLiteral<\"onboarding_step_skipped\">;\n step: z$1.ZodEnum<{\n agents: \"agents\";\n projects: \"projects\";\n }>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n name: z$1.ZodLiteral<\"onboarding_completed\">;\n agentState: z$1.ZodEnum<{\n connected: \"connected\";\n none: \"none\";\n signed_out: \"signed_out\";\n }>;\n projectsAdded: z$1.ZodNumber;\n durationMs: z$1.ZodNumber;\n}, z$1.core.$strip>, z$1.ZodObject<{\n name: z$1.ZodLiteral<\"onboarding_dismissed\">;\n step: z$1.ZodEnum<{\n agents: \"agents\";\n projects: \"projects\";\n }>;\n}, z$1.core.$strip>], \"name\">;\ntype OnboardingTelemetryEvent = z$1.infer<typeof onboardingTelemetryEventSchema>;\ndeclare const systemConfigResponseSchema: z$1.ZodObject<{\n generalSettings: z$1.ZodObject<{\n caffeinate: z$1.ZodBoolean;\n showKeyboardHints: z$1.ZodBoolean;\n steerActiveThreadOnEnter: 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 onboardingCompletedAt: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strict>;\n keybindings: z$1.ZodArray<z$1.ZodObject<{\n command: z$1.ZodEnum<{\n \"thread.new\": \"thread.new\";\n \"thread.search\": \"thread.search\";\n \"thread.previous\": \"thread.previous\";\n \"thread.next\": \"thread.next\";\n \"thread.jump.1\": \"thread.jump.1\";\n \"thread.jump.2\": \"thread.jump.2\";\n \"thread.jump.3\": \"thread.jump.3\";\n \"thread.jump.4\": \"thread.jump.4\";\n \"thread.jump.5\": \"thread.jump.5\";\n \"thread.jump.6\": \"thread.jump.6\";\n \"thread.jump.7\": \"thread.jump.7\";\n \"thread.jump.8\": \"thread.jump.8\";\n \"thread.jump.9\": \"thread.jump.9\";\n \"pane.focus.previous\": \"pane.focus.previous\";\n \"pane.focus.next\": \"pane.focus.next\";\n \"pane.focus.1\": \"pane.focus.1\";\n \"pane.focus.2\": \"pane.focus.2\";\n \"pane.focus.3\": \"pane.focus.3\";\n \"pane.focus.4\": \"pane.focus.4\";\n \"pane.focus.5\": \"pane.focus.5\";\n \"pane.focus.6\": \"pane.focus.6\";\n \"pane.focus.7\": \"pane.focus.7\";\n \"pane.focus.8\": \"pane.focus.8\";\n \"pane.maximize.toggle\": \"pane.maximize.toggle\";\n \"pane.close\": \"pane.close\";\n \"window.new\": \"window.new\";\n \"settings.open\": \"settings.open\";\n \"settings.openServers\": \"settings.openServers\";\n \"sidebar.toggle\": \"sidebar.toggle\";\n \"panel.newTab\": \"panel.newTab\";\n \"panel.close\": \"panel.close\";\n \"panel.toggle\": \"panel.toggle\";\n \"file.quickOpen\": \"file.quickOpen\";\n \"diff.toggle\": \"diff.toggle\";\n \"terminal.open\": \"terminal.open\";\n \"composer.focus\": \"composer.focus\";\n \"modelPicker.toggle\": \"modelPicker.toggle\";\n \"modelPicker.cycleModel\": \"modelPicker.cycleModel\";\n \"modelPicker.cycleReasoning\": \"modelPicker.cycleReasoning\";\n \"browser.focusLocation\": \"browser.focusLocation\";\n \"browser.reload\": \"browser.reload\";\n \"workspace.openPreferred\": \"workspace.openPreferred\";\n \"question.select.1\": \"question.select.1\";\n \"question.select.2\": \"question.select.2\";\n \"question.select.3\": \"question.select.3\";\n \"question.select.4\": \"question.select.4\";\n \"question.select.5\": \"question.select.5\";\n \"question.select.6\": \"question.select.6\";\n \"question.select.7\": \"question.select.7\";\n \"question.select.8\": \"question.select.8\";\n \"question.select.9\": \"question.select.9\";\n }>;\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<z$1.ZodEnum<{\n mainSurface: \"mainSurface\";\n modalOpen: \"modalOpen\";\n editableFocus: \"editableFocus\";\n terminalFocus: \"terminalFocus\";\n browserFocus: \"browserFocus\";\n modelPickerOpen: \"modelPickerOpen\";\n questionOpen: \"questionOpen\";\n promptAvailable: \"promptAvailable\";\n splitActive: \"splitActive\";\n webSurface: \"webSurface\";\n macPlatform: \"macPlatform\";\n }>>;\n none: z$1.ZodArray<z$1.ZodEnum<{\n mainSurface: \"mainSurface\";\n modalOpen: \"modalOpen\";\n editableFocus: \"editableFocus\";\n terminalFocus: \"terminalFocus\";\n browserFocus: \"browserFocus\";\n modelPickerOpen: \"modelPickerOpen\";\n questionOpen: \"questionOpen\";\n promptAvailable: \"promptAvailable\";\n splitActive: \"splitActive\";\n webSurface: \"webSurface\";\n macPlatform: \"macPlatform\";\n }>>;\n }, z$1.core.$strict>;\n }, z$1.core.$strict>>;\n defaultKeybindings: z$1.ZodArray<z$1.ZodObject<{\n command: z$1.ZodEnum<{\n \"thread.new\": \"thread.new\";\n \"thread.search\": \"thread.search\";\n \"thread.previous\": \"thread.previous\";\n \"thread.next\": \"thread.next\";\n \"thread.jump.1\": \"thread.jump.1\";\n \"thread.jump.2\": \"thread.jump.2\";\n \"thread.jump.3\": \"thread.jump.3\";\n \"thread.jump.4\": \"thread.jump.4\";\n \"thread.jump.5\": \"thread.jump.5\";\n \"thread.jump.6\": \"thread.jump.6\";\n \"thread.jump.7\": \"thread.jump.7\";\n \"thread.jump.8\": \"thread.jump.8\";\n \"thread.jump.9\": \"thread.jump.9\";\n \"pane.focus.previous\": \"pane.focus.previous\";\n \"pane.focus.next\": \"pane.focus.next\";\n \"pane.focus.1\": \"pane.focus.1\";\n \"pane.focus.2\": \"pane.focus.2\";\n \"pane.focus.3\": \"pane.focus.3\";\n \"pane.focus.4\": \"pane.focus.4\";\n \"pane.focus.5\": \"pane.focus.5\";\n \"pane.focus.6\": \"pane.focus.6\";\n \"pane.focus.7\": \"pane.focus.7\";\n \"pane.focus.8\": \"pane.focus.8\";\n \"pane.maximize.toggle\": \"pane.maximize.toggle\";\n \"pane.close\": \"pane.close\";\n \"window.new\": \"window.new\";\n \"settings.open\": \"settings.open\";\n \"settings.openServers\": \"settings.openServers\";\n \"sidebar.toggle\": \"sidebar.toggle\";\n \"panel.newTab\": \"panel.newTab\";\n \"panel.close\": \"panel.close\";\n \"panel.toggle\": \"panel.toggle\";\n \"file.quickOpen\": \"file.quickOpen\";\n \"diff.toggle\": \"diff.toggle\";\n \"terminal.open\": \"terminal.open\";\n \"composer.focus\": \"composer.focus\";\n \"modelPicker.toggle\": \"modelPicker.toggle\";\n \"modelPicker.cycleModel\": \"modelPicker.cycleModel\";\n \"modelPicker.cycleReasoning\": \"modelPicker.cycleReasoning\";\n \"browser.focusLocation\": \"browser.focusLocation\";\n \"browser.reload\": \"browser.reload\";\n \"workspace.openPreferred\": \"workspace.openPreferred\";\n \"question.select.1\": \"question.select.1\";\n \"question.select.2\": \"question.select.2\";\n \"question.select.3\": \"question.select.3\";\n \"question.select.4\": \"question.select.4\";\n \"question.select.5\": \"question.select.5\";\n \"question.select.6\": \"question.select.6\";\n \"question.select.7\": \"question.select.7\";\n \"question.select.8\": \"question.select.8\";\n \"question.select.9\": \"question.select.9\";\n }>;\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<z$1.ZodEnum<{\n mainSurface: \"mainSurface\";\n modalOpen: \"modalOpen\";\n editableFocus: \"editableFocus\";\n terminalFocus: \"terminalFocus\";\n browserFocus: \"browserFocus\";\n modelPickerOpen: \"modelPickerOpen\";\n questionOpen: \"questionOpen\";\n promptAvailable: \"promptAvailable\";\n splitActive: \"splitActive\";\n webSurface: \"webSurface\";\n macPlatform: \"macPlatform\";\n }>>;\n none: z$1.ZodArray<z$1.ZodEnum<{\n mainSurface: \"mainSurface\";\n modalOpen: \"modalOpen\";\n editableFocus: \"editableFocus\";\n terminalFocus: \"terminalFocus\";\n browserFocus: \"browserFocus\";\n modelPickerOpen: \"modelPickerOpen\";\n questionOpen: \"questionOpen\";\n promptAvailable: \"promptAvailable\";\n splitActive: \"splitActive\";\n webSurface: \"webSurface\";\n macPlatform: \"macPlatform\";\n }>>;\n }, z$1.core.$strict>;\n }, z$1.core.$strict>>;\n keybindingOverrides: z$1.ZodArray<z$1.ZodObject<{\n command: z$1.ZodEnum<{\n \"thread.new\": \"thread.new\";\n \"thread.search\": \"thread.search\";\n \"thread.previous\": \"thread.previous\";\n \"thread.next\": \"thread.next\";\n \"thread.jump.1\": \"thread.jump.1\";\n \"thread.jump.2\": \"thread.jump.2\";\n \"thread.jump.3\": \"thread.jump.3\";\n \"thread.jump.4\": \"thread.jump.4\";\n \"thread.jump.5\": \"thread.jump.5\";\n \"thread.jump.6\": \"thread.jump.6\";\n \"thread.jump.7\": \"thread.jump.7\";\n \"thread.jump.8\": \"thread.jump.8\";\n \"thread.jump.9\": \"thread.jump.9\";\n \"pane.focus.previous\": \"pane.focus.previous\";\n \"pane.focus.next\": \"pane.focus.next\";\n \"pane.focus.1\": \"pane.focus.1\";\n \"pane.focus.2\": \"pane.focus.2\";\n \"pane.focus.3\": \"pane.focus.3\";\n \"pane.focus.4\": \"pane.focus.4\";\n \"pane.focus.5\": \"pane.focus.5\";\n \"pane.focus.6\": \"pane.focus.6\";\n \"pane.focus.7\": \"pane.focus.7\";\n \"pane.focus.8\": \"pane.focus.8\";\n \"pane.maximize.toggle\": \"pane.maximize.toggle\";\n \"pane.close\": \"pane.close\";\n \"window.new\": \"window.new\";\n \"settings.open\": \"settings.open\";\n \"settings.openServers\": \"settings.openServers\";\n \"sidebar.toggle\": \"sidebar.toggle\";\n \"panel.newTab\": \"panel.newTab\";\n \"panel.close\": \"panel.close\";\n \"panel.toggle\": \"panel.toggle\";\n \"file.quickOpen\": \"file.quickOpen\";\n \"diff.toggle\": \"diff.toggle\";\n \"terminal.open\": \"terminal.open\";\n \"composer.focus\": \"composer.focus\";\n \"modelPicker.toggle\": \"modelPicker.toggle\";\n \"modelPicker.cycleModel\": \"modelPicker.cycleModel\";\n \"modelPicker.cycleReasoning\": \"modelPicker.cycleReasoning\";\n \"browser.focusLocation\": \"browser.focusLocation\";\n \"browser.reload\": \"browser.reload\";\n \"workspace.openPreferred\": \"workspace.openPreferred\";\n \"question.select.1\": \"question.select.1\";\n \"question.select.2\": \"question.select.2\";\n \"question.select.3\": \"question.select.3\";\n \"question.select.4\": \"question.select.4\";\n \"question.select.5\": \"question.select.5\";\n \"question.select.6\": \"question.select.6\";\n \"question.select.7\": \"question.select.7\";\n \"question.select.8\": \"question.select.8\";\n \"question.select.9\": \"question.select.9\";\n }>;\n shortcut: z$1.ZodNullable<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 }, z$1.core.$strict>>;\n experiments: z$1.ZodObject<{\n claudeCodeMockCliTraffic: z$1.ZodBoolean;\n newOnboarding: z$1.ZodBoolean;\n toolsHub: z$1.ZodBoolean;\n }, z$1.core.$strip>;\n appearance: z$1.ZodObject<{\n themeId: z$1.ZodString;\n customCss: z$1.ZodNullable<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>;\n customThemes: z$1.ZodArray<z$1.ZodString>;\n pluginThemes: z$1.ZodArray<z$1.ZodObject<{\n id: z$1.ZodString;\n pluginId: z$1.ZodString;\n name: z$1.ZodString;\n description: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strip>>;\n featureFlags: z$1.ZodObject<{\n placeholder: z$1.ZodBoolean;\n timelineWindowEventBudget: z$1.ZodNumber;\n }, z$1.core.$strip>;\n hostDaemonPort: z$1.ZodNullable<z$1.ZodNumber>;\n primaryHostId: z$1.ZodNullable<z$1.ZodString>;\n primaryHostPlatform: z$1.ZodNullable<z$1.ZodEnum<{\n unknown: \"unknown\";\n darwin: \"darwin\";\n linux: \"linux\";\n wsl: \"wsl\";\n }>>;\n voiceTranscriptionEnabled: z$1.ZodBoolean;\n dataDir: z$1.ZodString;\n}, z$1.core.$strip>;\ntype SystemConfigResponse = z$1.infer<typeof systemConfigResponseSchema>;\ndeclare const systemAttentionResponseSchema: z$1.ZodObject<{\n hasAttention: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype SystemAttentionResponse = z$1.infer<typeof systemAttentionResponseSchema>;\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<z$1.ZodString>;\n plugins: z$1.ZodArray<z$1.ZodObject<{\n id: z$1.ZodString;\n pluginId: z$1.ZodString;\n name: z$1.ZodString;\n description: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strip>>;\n active: z$1.ZodObject<{\n themeId: z$1.ZodString;\n customCss: z$1.ZodNullable<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>;\n}, z$1.core.$strip>;\ntype ThemeCatalogResponse = z$1.infer<typeof themeCatalogResponseSchema>;\ndeclare const systemVersionResponseSchema: z$1.ZodObject<{\n currentVersion: z$1.ZodString;\n latestVersion: z$1.ZodNullable<z$1.ZodString>;\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<typeof systemVersionResponseSchema>;\ndeclare const systemConfigReloadResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral<true>;\n}, z$1.core.$strip>;\ndeclare const systemCliSkillsStatusResponseSchema: z$1.ZodObject<{\n machines: z$1.ZodArray<z$1.ZodObject<{\n hostId: z$1.ZodString;\n hostName: z$1.ZodString;\n status: z$1.ZodEnum<{\n unknown: \"unknown\";\n missing: \"missing\";\n installed: \"installed\";\n outdated: \"outdated\";\n }>;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype SystemCliSkillsStatusResponse = z$1.infer<typeof systemCliSkillsStatusResponseSchema>;\n/** The machines to copy the built-in bb CLI skills onto. */\ndeclare const systemInstallCliSkillsRequestSchema: z$1.ZodObject<{\n hostIds: z$1.ZodArray<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype SystemInstallCliSkillsRequest = z$1.infer<typeof systemInstallCliSkillsRequestSchema>;\n/**\n * One entry per requested machine. A machine that is offline or otherwise\n * refuses the install fails on its own without taking the others down, so the\n * caller can report exactly which machines got the skills.\n */\ndeclare const systemInstallCliSkillsResponseSchema: z$1.ZodObject<{\n results: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n ok: z$1.ZodLiteral<true>;\n hostId: z$1.ZodString;\n hostName: z$1.ZodString;\n installations: z$1.ZodArray<z$1.ZodObject<{\n name: z$1.ZodString;\n path: z$1.ZodString;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n ok: z$1.ZodLiteral<false>;\n hostId: z$1.ZodString;\n hostName: z$1.ZodString;\n errorMessage: z$1.ZodString;\n }, z$1.core.$strip>], \"ok\">>;\n}, z$1.core.$strip>;\ntype SystemInstallCliSkillsResponse = z$1.infer<typeof systemInstallCliSkillsResponseSchema>;\ntype SystemConfigReloadResponse = z$1.infer<typeof systemConfigReloadResponseSchema>;\n\ndeclare const terminalSessionSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodNullable<z$1.ZodString>;\n environmentId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodNumber>;\n closeReason: z$1.ZodNullable<z$1.ZodEnum<{\n user: \"user\";\n \"thread-deleted\": \"thread-deleted\";\n \"process-exit\": \"process-exit\";\n \"daemon-disconnect\": \"daemon-disconnect\";\n \"environment-destroyed\": \"environment-destroyed\";\n \"thread-archived\": \"thread-archived\";\n \"open-timeout\": \"open-timeout\";\n }>>;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n lastUserInputAt: z$1.ZodNullable<z$1.ZodNumber>;\n}, z$1.core.$strip>;\ntype TerminalSession = z$1.infer<typeof terminalSessionSchema>;\ndeclare const terminalListResponseSchema: z$1.ZodObject<{\n sessions: z$1.ZodArray<z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodNullable<z$1.ZodString>;\n environmentId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodNumber>;\n closeReason: z$1.ZodNullable<z$1.ZodEnum<{\n user: \"user\";\n \"thread-deleted\": \"thread-deleted\";\n \"process-exit\": \"process-exit\";\n \"daemon-disconnect\": \"daemon-disconnect\";\n \"environment-destroyed\": \"environment-destroyed\";\n \"thread-archived\": \"thread-archived\";\n \"open-timeout\": \"open-timeout\";\n }>>;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n lastUserInputAt: z$1.ZodNullable<z$1.ZodNumber>;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype TerminalListResponse = z$1.infer<typeof terminalListResponseSchema>;\ndeclare const createTerminalRequestSchema: z$1.ZodObject<{\n cols: z$1.ZodNumber;\n rows: z$1.ZodNumber;\n start: z$1.ZodOptional<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n mode: z$1.ZodLiteral<\"shell\">;\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<z$1.ZodString>;\n }, z$1.core.$strict>], \"kind\">;\n title: z$1.ZodOptional<z$1.ZodString>;\n}, z$1.core.$strict>;\ntype CreateTerminalRequest = z$1.infer<typeof createTerminalRequestSchema>;\ndeclare const updateTerminalRequestSchema: z$1.ZodObject<{\n title: z$1.ZodString;\n}, z$1.core.$strict>;\ntype UpdateTerminalRequest = z$1.infer<typeof updateTerminalRequestSchema>;\ndeclare const terminalInputRequestSchema: z$1.ZodObject<{\n dataBase64: z$1.ZodString;\n}, z$1.core.$strict>;\ntype TerminalInputRequest = z$1.infer<typeof terminalInputRequestSchema>;\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<typeof terminalResizeRequestSchema>;\ndeclare const terminalOutputQuerySchema: z$1.ZodObject<{\n sinceSeq: z$1.ZodOptional<z$1.ZodCoercedNumber<unknown>>;\n tailBytes: z$1.ZodOptional<z$1.ZodCoercedNumber<unknown>>;\n limitChunks: z$1.ZodOptional<z$1.ZodCoercedNumber<unknown>>;\n}, z$1.core.$strict>;\ntype TerminalOutputQuery = z$1.infer<typeof terminalOutputQuerySchema>;\ndeclare const terminalOutputResponseSchema: z$1.ZodObject<{\n chunks: z$1.ZodArray<z$1.ZodObject<{\n seq: z$1.ZodNumber;\n dataBase64: z$1.ZodString;\n }, z$1.core.$strict>>;\n nextSeq: z$1.ZodNumber;\n truncated: z$1.ZodBoolean;\n}, z$1.core.$strict>;\ntype TerminalOutputResponse = z$1.infer<typeof terminalOutputResponseSchema>;\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<typeof timelineRowStatusSchema>;\ndeclare const timelineRowBaseSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable<z$1.ZodString>;\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<typeof timelineRowBaseSchema>;\ndeclare const timelineConversationRowSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodObject<{\n webImages: z$1.ZodNumber;\n localImages: z$1.ZodNumber;\n localFiles: z$1.ZodNumber;\n imageUrls: z$1.ZodArray<z$1.ZodString>;\n localImagePaths: z$1.ZodArray<z$1.ZodString>;\n localFilePaths: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\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.ZodObject<{\n start: z$1.ZodNumber;\n end: z$1.ZodNumber;\n resource: z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\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<z$1.ZodString>;\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<z$1.ZodObject<{\n webImages: z$1.ZodNumber;\n localImages: z$1.ZodNumber;\n localFiles: z$1.ZodNumber;\n imageUrls: z$1.ZodArray<z$1.ZodString>;\n localImagePaths: z$1.ZodArray<z$1.ZodString>;\n localFilePaths: z$1.ZodArray<z$1.ZodString>;\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<typeof timelineConversationRowSchema>;\ndeclare const timelineSystemRowSchema: z$1.ZodUnion<readonly [z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n status: z$1.ZodNullable<z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>>;\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<z$1.ZodString>;\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<z$1.ZodString>;\n status: z$1.ZodNullable<z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>>;\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<z$1.ZodNumber>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodString>;\n previousParentThreadTitle: z$1.ZodNullable<z$1.ZodString>;\n nextParentThreadId: z$1.ZodNullable<z$1.ZodString>;\n nextParentThreadTitle: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strip>;\n completedAt: z$1.ZodNullable<z$1.ZodNumber>;\n}, z$1.core.$strip>], \"operationKind\">]>;\ntype TimelineSystemRow = z$1.infer<typeof timelineSystemRowSchema>;\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<z$1.ZodString>;\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<z$1.ZodString>;\n source: z$1.ZodNullable<z$1.ZodString>;\n output: z$1.ZodString;\n exitCode: z$1.ZodNullable<z$1.ZodNumber>;\n completedAt: z$1.ZodNullable<z$1.ZodNumber>;\n approvalStatus: z$1.ZodNullable<z$1.ZodEnum<{\n waiting_for_approval: \"waiting_for_approval\";\n denied: \"denied\";\n }>>;\n activityIntents: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"read\">;\n command: z$1.ZodString;\n name: z$1.ZodString;\n path: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"search\">;\n command: z$1.ZodString;\n query: z$1.ZodNullable<z$1.ZodString>;\n path: z$1.ZodNullable<z$1.ZodString>;\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<typeof timelineCommandWorkRowSchema>;\ndeclare const timelineToolWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodRecord<z$1.ZodString, z$1.ZodType<JsonValue$1, unknown, z$1.core.$ZodTypeInternals<JsonValue$1, unknown>>>>;\n statusLabels: z$1.ZodOptional<z$1.ZodObject<{\n pending: z$1.ZodString;\n completed: z$1.ZodString;\n }, z$1.core.$strip>>;\n output: z$1.ZodString;\n completedAt: z$1.ZodNullable<z$1.ZodNumber>;\n approvalStatus: z$1.ZodNullable<z$1.ZodEnum<{\n waiting_for_approval: \"waiting_for_approval\";\n denied: \"denied\";\n }>>;\n activityIntents: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"read\">;\n command: z$1.ZodString;\n name: z$1.ZodString;\n path: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"search\">;\n command: z$1.ZodString;\n query: z$1.ZodNullable<z$1.ZodString>;\n path: z$1.ZodNullable<z$1.ZodString>;\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<typeof timelineToolWorkRowSchema>;\ndeclare const timelineFileChangeWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n movePath: z$1.ZodNullable<z$1.ZodString>;\n diff: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n stderr: z$1.ZodNullable<z$1.ZodString>;\n approvalStatus: z$1.ZodNullable<z$1.ZodEnum<{\n waiting_for_approval: \"waiting_for_approval\";\n denied: \"denied\";\n }>>;\n}, z$1.core.$strip>;\ntype TimelineFileChangeWorkRow = z$1.infer<typeof timelineFileChangeWorkRowSchema>;\ndeclare const timelineWebSearchWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n completedAt: z$1.ZodNullable<z$1.ZodNumber>;\n}, z$1.core.$strip>;\ntype TimelineWebSearchWorkRow = z$1.infer<typeof timelineWebSearchWorkRowSchema>;\ndeclare const timelineWebFetchWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n pattern: z$1.ZodNullable<z$1.ZodString>;\n completedAt: z$1.ZodNullable<z$1.ZodNumber>;\n}, z$1.core.$strip>;\ntype TimelineWebFetchWorkRow = z$1.infer<typeof timelineWebFetchWorkRowSchema>;\ndeclare const timelineImageViewWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodNumber>;\n}, z$1.core.$strip>;\ntype TimelineImageViewWorkRow = z$1.infer<typeof timelineImageViewWorkRowSchema>;\ndeclare const timelineApprovalWorkRowSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodEnum<{\n turn: \"turn\";\n session: \"session\";\n }>>;\n statusReason: z$1.ZodNullable<z$1.ZodString>;\n}, z$1.core.$strip>], \"approvalKind\">;\ntype TimelineApprovalWorkRow = z$1.infer<typeof timelineApprovalWorkRowSchema>;\ndeclare const timelineQuestionWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodObject<{\n id: z$1.ZodString;\n prompt: z$1.ZodString;\n shortLabel: z$1.ZodOptional<z$1.ZodString>;\n multiSelect: z$1.ZodBoolean;\n options: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{\n value: z$1.ZodString;\n label: z$1.ZodString;\n description: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>>>;\n allowFreeText: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n answers: z$1.ZodNullable<z$1.ZodRecord<z$1.ZodString, z$1.ZodObject<{\n selected: z$1.ZodArray<z$1.ZodString>;\n freeText: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>>>;\n statusReason: z$1.ZodNullable<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype TimelineQuestionWorkRow = z$1.infer<typeof timelineQuestionWorkRowSchema>;\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<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodObject<{\n phases: z$1.ZodArray<z$1.ZodObject<{\n index: z$1.ZodNumber;\n title: z$1.ZodString;\n kind: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>>;\n agents: z$1.ZodArray<z$1.ZodObject<{\n index: z$1.ZodNumber;\n label: z$1.ZodString;\n state: z$1.ZodEnum<{\n running: \"running\";\n failed: \"failed\";\n queued: \"queued\";\n done: \"done\";\n skipped: \"skipped\";\n }>;\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<z$1.ZodNumber>;\n phaseTitle: z$1.ZodOptional<z$1.ZodString>;\n agentType: z$1.ZodOptional<z$1.ZodString>;\n isolation: z$1.ZodOptional<z$1.ZodString>;\n queuedAt: z$1.ZodOptional<z$1.ZodNumber>;\n startedAt: z$1.ZodOptional<z$1.ZodNumber>;\n lastToolName: z$1.ZodOptional<z$1.ZodString>;\n lastToolSummary: z$1.ZodOptional<z$1.ZodString>;\n promptPreview: z$1.ZodOptional<z$1.ZodString>;\n resultPreview: z$1.ZodOptional<z$1.ZodString>;\n error: z$1.ZodOptional<z$1.ZodString>;\n tokens: z$1.ZodOptional<z$1.ZodNumber>;\n toolCalls: z$1.ZodOptional<z$1.ZodNumber>;\n durationMs: z$1.ZodOptional<z$1.ZodNumber>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n usage: z$1.ZodNullable<z$1.ZodObject<{\n totalTokens: z$1.ZodNumber;\n toolUses: z$1.ZodNumber;\n durationMs: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n summary: z$1.ZodNullable<z$1.ZodString>;\n error: z$1.ZodNullable<z$1.ZodString>;\n completedAt: z$1.ZodNullable<z$1.ZodNumber>;\n}, z$1.core.$strip>;\ntype TimelineWorkflowWorkRow = z$1.infer<typeof timelineWorkflowWorkRowSchema>;\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 createExecutionInputSourcesSchema: z$1.ZodObject<{\n providerId: z$1.ZodOptional<z$1.ZodEnum<{\n explicit: \"explicit\";\n \"client-preference\": \"client-preference\";\n }>>;\n model: z$1.ZodOptional<z$1.ZodEnum<{\n explicit: \"explicit\";\n \"client-preference\": \"client-preference\";\n }>>;\n serviceTier: z$1.ZodOptional<z$1.ZodEnum<{\n explicit: \"explicit\";\n \"client-preference\": \"client-preference\";\n }>>;\n reasoningLevel: z$1.ZodOptional<z$1.ZodEnum<{\n explicit: \"explicit\";\n \"client-preference\": \"client-preference\";\n }>>;\n permissionMode: z$1.ZodOptional<z$1.ZodEnum<{\n explicit: \"explicit\";\n \"client-preference\": \"client-preference\";\n }>>;\n}, z$1.core.$strict>;\ntype CreateExecutionInputSources = z$1.infer<typeof createExecutionInputSourcesSchema>;\ndeclare const createThreadRequestSchema: z$1.ZodObject<{\n projectId: z$1.ZodString;\n providerId: z$1.ZodOptional<z$1.ZodString>;\n origin: z$1.ZodEnum<{\n plugin: \"plugin\";\n app: \"app\";\n cli: \"cli\";\n sdk: \"sdk\";\n }>;\n originPluginId: z$1.ZodOptional<z$1.ZodString>;\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n visible: \"visible\";\n hidden: \"hidden\";\n }>>;\n title: z$1.ZodOptional<z$1.ZodString>;\n input: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{\n start: z$1.ZodNumber;\n end: z$1.ZodNumber;\n resource: z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\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<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional<z$1.ZodString>;\n sizeBytes: z$1.ZodOptional<z$1.ZodNumber>;\n mimeType: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>], \"type\">>;\n model: z$1.ZodOptional<z$1.ZodString>;\n serviceTier: z$1.ZodOptional<z$1.ZodEnum<{\n default: \"default\";\n fast: \"fast\";\n }>>;\n reasoningLevel: z$1.ZodOptional<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.ZodOptional<z$1.ZodPipe<z$1.ZodUnion<readonly [z$1.ZodEnum<{\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n full: \"full\";\n }>, z$1.ZodLiteral<\"workspace-write\">]>, z$1.ZodTransform<\"auto\" | \"accept-edits\" | \"full\", \"auto\" | \"accept-edits\" | \"full\" | \"workspace-write\">>>;\n executionInputSources: z$1.ZodOptional<z$1.ZodObject<{\n providerId: z$1.ZodOptional<z$1.ZodEnum<{\n explicit: \"explicit\";\n \"client-preference\": \"client-preference\";\n }>>;\n model: z$1.ZodOptional<z$1.ZodEnum<{\n explicit: \"explicit\";\n \"client-preference\": \"client-preference\";\n }>>;\n serviceTier: z$1.ZodOptional<z$1.ZodEnum<{\n explicit: \"explicit\";\n \"client-preference\": \"client-preference\";\n }>>;\n reasoningLevel: z$1.ZodOptional<z$1.ZodEnum<{\n explicit: \"explicit\";\n \"client-preference\": \"client-preference\";\n }>>;\n permissionMode: z$1.ZodOptional<z$1.ZodEnum<{\n explicit: \"explicit\";\n \"client-preference\": \"client-preference\";\n }>>;\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<z$1.ZodString>;\n workspace: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"unmanaged\">;\n path: z$1.ZodNullable<z$1.ZodString>;\n branch: z$1.ZodOptional<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"existing\">;\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<z$1.ZodString>;\n sectionId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\n sourceThreadId: z$1.ZodOptional<z$1.ZodString>;\n sourceSeqEnd: z$1.ZodOptional<z$1.ZodNumber>;\n startedOnBehalfOf: z$1.ZodDefault<z$1.ZodNullable<z$1.ZodObject<{\n initiator: z$1.ZodEnum<{\n agent: \"agent\";\n system: \"system\";\n }>;\n senderThreadId: z$1.ZodString;\n }, z$1.core.$strip>>>;\n originKind: z$1.ZodDefault<z$1.ZodNullable<z$1.ZodEnum<{\n fork: \"fork\";\n }>>>;\n childOrigin: z$1.ZodDefault<z$1.ZodNullable<z$1.ZodEnum<{\n fork: \"fork\";\n }>>>;\n}, z$1.core.$strip>;\ntype CreateThreadRequest = z$1.infer<typeof createThreadRequestSchema>;\ndeclare const forkThreadRequestSchema: z$1.ZodObject<{\n sourceThreadId: z$1.ZodString;\n sourceSeqEnd: z$1.ZodOptional<z$1.ZodNumber>;\n input: z$1.ZodOptional<z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{\n start: z$1.ZodNumber;\n end: z$1.ZodNumber;\n resource: z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\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<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional<z$1.ZodString>;\n sizeBytes: z$1.ZodOptional<z$1.ZodNumber>;\n mimeType: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>], \"type\">>>;\n agentContextSeed: z$1.ZodOptional<z$1.ZodArray<z$1.ZodIntersection<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{\n start: z$1.ZodNumber;\n end: z$1.ZodNumber;\n resource: z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\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<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional<z$1.ZodString>;\n sizeBytes: z$1.ZodOptional<z$1.ZodNumber>;\n mimeType: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n permissionMode: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodUnion<readonly [z$1.ZodEnum<{\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n full: \"full\";\n }>, z$1.ZodLiteral<\"workspace-write\">]>, z$1.ZodTransform<\"auto\" | \"accept-edits\" | \"full\", \"auto\" | \"accept-edits\" | \"full\" | \"workspace-write\">>>;\n visibility: z$1.ZodDefault<z$1.ZodEnum<{\n visible: \"visible\";\n hidden: \"hidden\";\n }>>;\n workspace: z$1.ZodDefault<z$1.ZodEnum<{\n reuse: \"reuse\";\n isolated: \"isolated\";\n }>>;\n origin: z$1.ZodDefault<z$1.ZodEnum<{\n plugin: \"plugin\";\n app: \"app\";\n cli: \"cli\";\n sdk: \"sdk\";\n }>>;\n originPluginId: z$1.ZodOptional<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype ForkThreadRequest = z$1.infer<typeof forkThreadRequestSchema>;\ndeclare const sendMessageRequestSchema: z$1.ZodObject<{\n input: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{\n start: z$1.ZodNumber;\n end: z$1.ZodNumber;\n resource: z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\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<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional<z$1.ZodString>;\n sizeBytes: z$1.ZodOptional<z$1.ZodNumber>;\n mimeType: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>], \"type\">>;\n model: z$1.ZodOptional<z$1.ZodString>;\n serviceTier: z$1.ZodOptional<z$1.ZodEnum<{\n default: \"default\";\n fast: \"fast\";\n }>>;\n reasoningLevel: z$1.ZodOptional<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.ZodOptional<z$1.ZodPipe<z$1.ZodUnion<readonly [z$1.ZodEnum<{\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n full: \"full\";\n }>, z$1.ZodLiteral<\"workspace-write\">]>, z$1.ZodTransform<\"auto\" | \"accept-edits\" | \"full\", \"auto\" | \"accept-edits\" | \"full\" | \"workspace-write\">>>;\n executionInputSources: z$1.ZodOptional<z$1.ZodObject<{\n model: z$1.ZodOptional<z$1.ZodEnum<{\n explicit: \"explicit\";\n \"client-preference\": \"client-preference\";\n }>>;\n serviceTier: z$1.ZodOptional<z$1.ZodEnum<{\n explicit: \"explicit\";\n \"client-preference\": \"client-preference\";\n }>>;\n reasoningLevel: z$1.ZodOptional<z$1.ZodEnum<{\n explicit: \"explicit\";\n \"client-preference\": \"client-preference\";\n }>>;\n permissionMode: z$1.ZodOptional<z$1.ZodEnum<{\n explicit: \"explicit\";\n \"client-preference\": \"client-preference\";\n }>>;\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<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype SendMessageRequest = z$1.infer<typeof sendMessageRequestSchema>;\ndeclare const createQueuedMessageRequestSchema: z$1.ZodObject<{\n input: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{\n start: z$1.ZodNumber;\n end: z$1.ZodNumber;\n resource: z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\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<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional<z$1.ZodString>;\n sizeBytes: z$1.ZodOptional<z$1.ZodNumber>;\n mimeType: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>], \"type\">>;\n model: z$1.ZodOptional<z$1.ZodString>;\n serviceTier: z$1.ZodOptional<z$1.ZodEnum<{\n default: \"default\";\n fast: \"fast\";\n }>>;\n reasoningLevel: z$1.ZodOptional<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.ZodOptional<z$1.ZodPipe<z$1.ZodUnion<readonly [z$1.ZodEnum<{\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n full: \"full\";\n }>, z$1.ZodLiteral<\"workspace-write\">]>, z$1.ZodTransform<\"auto\" | \"accept-edits\" | \"full\", \"auto\" | \"accept-edits\" | \"full\" | \"workspace-write\">>>;\n executionInputSources: z$1.ZodOptional<z$1.ZodObject<{\n model: z$1.ZodOptional<z$1.ZodEnum<{\n explicit: \"explicit\";\n \"client-preference\": \"client-preference\";\n }>>;\n serviceTier: z$1.ZodOptional<z$1.ZodEnum<{\n explicit: \"explicit\";\n \"client-preference\": \"client-preference\";\n }>>;\n reasoningLevel: z$1.ZodOptional<z$1.ZodEnum<{\n explicit: \"explicit\";\n \"client-preference\": \"client-preference\";\n }>>;\n permissionMode: z$1.ZodOptional<z$1.ZodEnum<{\n explicit: \"explicit\";\n \"client-preference\": \"client-preference\";\n }>>;\n }, z$1.core.$strict>>;\n senderThreadId: z$1.ZodOptional<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype CreateQueuedMessageRequest = z$1.infer<typeof createQueuedMessageRequestSchema>;\ndeclare const updateQueuedMessageRequestSchema: z$1.ZodObject<{\n expectedUpdatedAt: z$1.ZodNumber;\n input: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{\n start: z$1.ZodNumber;\n end: z$1.ZodNumber;\n resource: z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\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<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional<z$1.ZodString>;\n sizeBytes: z$1.ZodOptional<z$1.ZodNumber>;\n mimeType: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>], \"type\">>;\n}, z$1.core.$strip>;\ntype UpdateQueuedMessageRequest = z$1.infer<typeof updateQueuedMessageRequestSchema>;\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<typeof sendQueuedMessageRequestSchema>;\ndeclare const reorderQueuedMessageRequestSchema: z$1.ZodObject<{\n previousQueuedMessageId: z$1.ZodNullable<z$1.ZodString>;\n nextQueuedMessageId: z$1.ZodNullable<z$1.ZodString>;\n groupBoundaryQueuedMessageId: z$1.ZodOptional<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype ReorderQueuedMessageRequest = z$1.infer<typeof reorderQueuedMessageRequestSchema>;\ndeclare const setQueuedMessageGroupBoundaryRequestSchema: z$1.ZodObject<{\n expectedGroupedPrefixQueuedMessageIds: z$1.ZodArray<z$1.ZodString>;\n groupBoundaryQueuedMessageId: z$1.ZodString;\n}, z$1.core.$strip>;\ntype SetQueuedMessageGroupBoundaryRequest = z$1.infer<typeof setQueuedMessageGroupBoundaryRequestSchema>;\ndeclare const sendQueuedMessageResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral<true>;\n queuedMessage: z$1.ZodObject<{\n id: z$1.ZodString;\n content: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{\n start: z$1.ZodNumber;\n end: z$1.ZodNumber;\n resource: z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\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<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional<z$1.ZodString>;\n sizeBytes: z$1.ZodOptional<z$1.ZodNumber>;\n mimeType: z$1.ZodOptional<z$1.ZodString>;\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<typeof sendQueuedMessageResponseSchema>;\ndeclare const threadListResponseSchema: z$1.ZodArray<z$1.ZodObject<{\n id: z$1.ZodString;\n projectId: z$1.ZodString;\n environmentId: z$1.ZodNullable<z$1.ZodString>;\n providerId: z$1.ZodString;\n title: z$1.ZodNullable<z$1.ZodString>;\n titleFallback: z$1.ZodNullable<z$1.ZodString>;\n sectionId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n sourceThreadId: z$1.ZodNullable<z$1.ZodString>;\n originKind: z$1.ZodNullable<z$1.ZodEnum<{\n fork: \"fork\";\n }>>;\n childOrigin: z$1.ZodNullable<z$1.ZodEnum<{\n fork: \"fork\";\n }>>;\n originPluginId: z$1.ZodNullable<z$1.ZodString>;\n visibility: z$1.ZodEnum<{\n visible: \"visible\";\n hidden: \"hidden\";\n }>;\n archivedAt: z$1.ZodNullable<z$1.ZodNumber>;\n pinnedAt: z$1.ZodNullable<z$1.ZodNumber>;\n deletedAt: z$1.ZodNullable<z$1.ZodNumber>;\n lastReadAt: z$1.ZodNullable<z$1.ZodNumber>;\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<z$1.ZodNumber>;\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<z$1.ZodString>;\n hasPendingInteraction: z$1.ZodBoolean;\n environmentHostId: z$1.ZodNullable<z$1.ZodString>;\n environmentName: z$1.ZodNullable<z$1.ZodString>;\n environmentBranchName: z$1.ZodNullable<z$1.ZodString>;\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<typeof threadListResponseSchema>;\ndeclare const threadSearchResponseSchema: z$1.ZodObject<{\n active: z$1.ZodObject<{\n total: z$1.ZodNumber;\n results: z$1.ZodArray<z$1.ZodObject<{\n thread: z$1.ZodObject<{\n id: z$1.ZodString;\n projectId: z$1.ZodString;\n environmentId: z$1.ZodNullable<z$1.ZodString>;\n providerId: z$1.ZodString;\n title: z$1.ZodNullable<z$1.ZodString>;\n titleFallback: z$1.ZodNullable<z$1.ZodString>;\n sectionId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n sourceThreadId: z$1.ZodNullable<z$1.ZodString>;\n originKind: z$1.ZodNullable<z$1.ZodEnum<{\n fork: \"fork\";\n }>>;\n childOrigin: z$1.ZodNullable<z$1.ZodEnum<{\n fork: \"fork\";\n }>>;\n originPluginId: z$1.ZodNullable<z$1.ZodString>;\n visibility: z$1.ZodEnum<{\n visible: \"visible\";\n hidden: \"hidden\";\n }>;\n archivedAt: z$1.ZodNullable<z$1.ZodNumber>;\n pinnedAt: z$1.ZodNullable<z$1.ZodNumber>;\n deletedAt: z$1.ZodNullable<z$1.ZodNumber>;\n lastReadAt: z$1.ZodNullable<z$1.ZodNumber>;\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<z$1.ZodNumber>;\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<z$1.ZodString>;\n hasPendingInteraction: z$1.ZodBoolean;\n environmentHostId: z$1.ZodNullable<z$1.ZodString>;\n environmentName: z$1.ZodNullable<z$1.ZodString>;\n environmentBranchName: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodObject<{\n sourceKind: z$1.ZodEnum<{\n title: \"title\";\n title_fallback: \"title_fallback\";\n user_message: \"user_message\";\n assistant_message: \"assistant_message\";\n system_message: \"system_message\";\n }>;\n text: z$1.ZodString;\n highlightRanges: z$1.ZodArray<z$1.ZodObject<{\n start: z$1.ZodNumber;\n end: z$1.ZodNumber;\n }, z$1.core.$strict>>;\n sourceSeq: z$1.ZodNullable<z$1.ZodNumber>;\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<z$1.ZodObject<{\n thread: z$1.ZodObject<{\n id: z$1.ZodString;\n projectId: z$1.ZodString;\n environmentId: z$1.ZodNullable<z$1.ZodString>;\n providerId: z$1.ZodString;\n title: z$1.ZodNullable<z$1.ZodString>;\n titleFallback: z$1.ZodNullable<z$1.ZodString>;\n sectionId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n sourceThreadId: z$1.ZodNullable<z$1.ZodString>;\n originKind: z$1.ZodNullable<z$1.ZodEnum<{\n fork: \"fork\";\n }>>;\n childOrigin: z$1.ZodNullable<z$1.ZodEnum<{\n fork: \"fork\";\n }>>;\n originPluginId: z$1.ZodNullable<z$1.ZodString>;\n visibility: z$1.ZodEnum<{\n visible: \"visible\";\n hidden: \"hidden\";\n }>;\n archivedAt: z$1.ZodNullable<z$1.ZodNumber>;\n pinnedAt: z$1.ZodNullable<z$1.ZodNumber>;\n deletedAt: z$1.ZodNullable<z$1.ZodNumber>;\n lastReadAt: z$1.ZodNullable<z$1.ZodNumber>;\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<z$1.ZodNumber>;\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<z$1.ZodString>;\n hasPendingInteraction: z$1.ZodBoolean;\n environmentHostId: z$1.ZodNullable<z$1.ZodString>;\n environmentName: z$1.ZodNullable<z$1.ZodString>;\n environmentBranchName: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodObject<{\n sourceKind: z$1.ZodEnum<{\n title: \"title\";\n title_fallback: \"title_fallback\";\n user_message: \"user_message\";\n assistant_message: \"assistant_message\";\n system_message: \"system_message\";\n }>;\n text: z$1.ZodString;\n highlightRanges: z$1.ZodArray<z$1.ZodObject<{\n start: z$1.ZodNumber;\n end: z$1.ZodNumber;\n }, z$1.core.$strict>>;\n sourceSeq: z$1.ZodNullable<z$1.ZodNumber>;\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<typeof threadSearchResponseSchema>;\ndeclare const threadResponseSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n projectId: z$1.ZodString;\n environmentId: z$1.ZodNullable<z$1.ZodString>;\n providerId: z$1.ZodString;\n title: z$1.ZodNullable<z$1.ZodString>;\n titleFallback: z$1.ZodNullable<z$1.ZodString>;\n sectionId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n sourceThreadId: z$1.ZodNullable<z$1.ZodString>;\n originKind: z$1.ZodNullable<z$1.ZodEnum<{\n fork: \"fork\";\n }>>;\n childOrigin: z$1.ZodNullable<z$1.ZodEnum<{\n fork: \"fork\";\n }>>;\n originPluginId: z$1.ZodNullable<z$1.ZodString>;\n visibility: z$1.ZodEnum<{\n visible: \"visible\";\n hidden: \"hidden\";\n }>;\n archivedAt: z$1.ZodNullable<z$1.ZodNumber>;\n pinnedAt: z$1.ZodNullable<z$1.ZodNumber>;\n deletedAt: z$1.ZodNullable<z$1.ZodNumber>;\n lastReadAt: z$1.ZodNullable<z$1.ZodNumber>;\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<z$1.ZodNumber>;\n }, z$1.core.$strip>;\n canSpawnChild: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype ThreadResponse = z$1.infer<typeof threadResponseSchema>;\ndeclare const threadGetQuerySchema: z$1.ZodObject<{\n include: z$1.ZodOptional<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype ThreadGetQuery = z$1.infer<typeof threadGetQuerySchema>;\ndeclare const threadWithIncludesResponseSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n projectId: z$1.ZodString;\n environmentId: z$1.ZodNullable<z$1.ZodString>;\n providerId: z$1.ZodString;\n title: z$1.ZodNullable<z$1.ZodString>;\n titleFallback: z$1.ZodNullable<z$1.ZodString>;\n sectionId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n sourceThreadId: z$1.ZodNullable<z$1.ZodString>;\n originKind: z$1.ZodNullable<z$1.ZodEnum<{\n fork: \"fork\";\n }>>;\n childOrigin: z$1.ZodNullable<z$1.ZodEnum<{\n fork: \"fork\";\n }>>;\n originPluginId: z$1.ZodNullable<z$1.ZodString>;\n visibility: z$1.ZodEnum<{\n visible: \"visible\";\n hidden: \"hidden\";\n }>;\n archivedAt: z$1.ZodNullable<z$1.ZodNumber>;\n pinnedAt: z$1.ZodNullable<z$1.ZodNumber>;\n deletedAt: z$1.ZodNullable<z$1.ZodNumber>;\n lastReadAt: z$1.ZodNullable<z$1.ZodNumber>;\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<z$1.ZodNumber>;\n }, z$1.core.$strip>;\n canSpawnChild: z$1.ZodBoolean;\n environment: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodObject<{\n id: z$1.ZodString;\n name: z$1.ZodNullable<z$1.ZodString>;\n projectId: z$1.ZodString;\n hostId: z$1.ZodString;\n path: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n baseBranch: z$1.ZodNullable<z$1.ZodString>;\n defaultBranch: z$1.ZodNullable<z$1.ZodString>;\n mergeBaseBranch: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodNullable<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 disconnected: \"disconnected\";\n connected: \"connected\";\n }>;\n maxPermissionMode: z$1.ZodEnum<{\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n full: \"full\";\n }>;\n lastSeenAt: z$1.ZodNullable<z$1.ZodNumber>;\n lastRejectedProtocolVersion: z$1.ZodNullable<z$1.ZodNumber>;\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<typeof threadWithIncludesResponseSchema>;\ndeclare const threadPendingInteractionsResponseSchema: z$1.ZodArray<z$1.ZodUnion<readonly [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<z$1.ZodString>;\n createdAt: z$1.ZodNumber;\n expiresAt: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;\n resolvedAt: z$1.ZodNullable<z$1.ZodNumber>;\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<z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"provider\">;\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<readonly [z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"approval\">;\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<z$1.ZodString>;\n actions: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"read\">;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"search\">;\n command: z$1.ZodString;\n query: z$1.ZodNullable<z$1.ZodString>;\n path: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodObject<{\n network: z$1.ZodNullable<z$1.ZodObject<{\n enabled: z$1.ZodNullable<z$1.ZodBoolean>;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable<z$1.ZodObject<{\n read: z$1.ZodArray<z$1.ZodString>;\n write: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodString>;\n sessionGrant: z$1.ZodNullable<z$1.ZodObject<{\n network: z$1.ZodNullable<z$1.ZodObject<{\n enabled: z$1.ZodNullable<z$1.ZodBoolean>;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable<z$1.ZodObject<{\n read: z$1.ZodArray<z$1.ZodString>;\n write: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodString>;\n permissions: z$1.ZodObject<{\n network: z$1.ZodNullable<z$1.ZodObject<{\n enabled: z$1.ZodNullable<z$1.ZodBoolean>;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable<z$1.ZodObject<{\n read: z$1.ZodArray<z$1.ZodString>;\n write: z$1.ZodArray<z$1.ZodString>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>;\n }, z$1.core.$strip>], \"kind\">;\n reason: z$1.ZodNullable<z$1.ZodString>;\n availableDecisions: z$1.ZodArray<z$1.ZodEnum<{\n allow_once: \"allow_once\";\n allow_for_session: \"allow_for_session\";\n deny: \"deny\";\n }>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"user_question\">;\n questions: z$1.ZodArray<z$1.ZodObject<{\n id: z$1.ZodString;\n prompt: z$1.ZodString;\n shortLabel: z$1.ZodOptional<z$1.ZodString>;\n multiSelect: z$1.ZodBoolean;\n options: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{\n value: z$1.ZodString;\n label: z$1.ZodString;\n description: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodUnion<readonly [z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"allow_once\">;\n grantedPermissions: z$1.ZodNullable<z$1.ZodObject<{\n network: z$1.ZodNullable<z$1.ZodObject<{\n enabled: z$1.ZodNullable<z$1.ZodBoolean>;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable<z$1.ZodObject<{\n read: z$1.ZodArray<z$1.ZodString>;\n write: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodObject<{\n network: z$1.ZodNullable<z$1.ZodObject<{\n enabled: z$1.ZodNullable<z$1.ZodBoolean>;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable<z$1.ZodObject<{\n read: z$1.ZodArray<z$1.ZodString>;\n write: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodString, z$1.ZodObject<{\n selected: z$1.ZodArray<z$1.ZodString>;\n freeText: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n createdAt: z$1.ZodNumber;\n expiresAt: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;\n resolvedAt: z$1.ZodNullable<z$1.ZodNumber>;\n turnId: z$1.ZodNullable<z$1.ZodString>;\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<JsonValue$1, unknown, z$1.core.$ZodTypeInternals<JsonValue$1, unknown>>;\n }, z$1.core.$strip>;\n resolution: z$1.ZodNullable<z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin_submitted\">;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>]>>;\ntype ThreadPendingInteractionsResponse = z$1.infer<typeof threadPendingInteractionsResponseSchema>;\ndeclare const threadQueuedMessageListResponseSchema: z$1.ZodArray<z$1.ZodObject<{\n id: z$1.ZodString;\n content: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{\n start: z$1.ZodNumber;\n end: z$1.ZodNumber;\n resource: z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\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<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional<z$1.ZodString>;\n sizeBytes: z$1.ZodOptional<z$1.ZodNumber>;\n mimeType: z$1.ZodOptional<z$1.ZodString>;\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<typeof threadQueuedMessageListResponseSchema>;\ndeclare const threadChildSummaryResponseSchema: z$1.ZodObject<{\n nonDeletedChildCount: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype ThreadChildSummaryResponse = z$1.infer<typeof threadChildSummaryResponseSchema>;\ndeclare const deleteThreadRequestSchema: z$1.ZodObject<{\n childThreadsConfirmed: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype DeleteThreadRequest = z$1.infer<typeof deleteThreadRequestSchema>;\ndeclare const updateThreadRequestSchema: z$1.ZodObject<{\n title: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\n sectionId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\n parentThreadId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\n model: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\n reasoningLevel: z$1.ZodOptional<z$1.ZodNullable<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 visibility: z$1.ZodOptional<z$1.ZodEnum<{\n visible: \"visible\";\n hidden: \"hidden\";\n }>>;\n}, z$1.core.$strip>;\ntype UpdateThreadRequest = z$1.infer<typeof updateThreadRequestSchema>;\ndeclare const reorderPinnedThreadRequestSchema: z$1.ZodObject<{\n previousThreadId: z$1.ZodNullable<z$1.ZodString>;\n nextThreadId: z$1.ZodNullable<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype ReorderPinnedThreadRequest = z$1.infer<typeof reorderPinnedThreadRequestSchema>;\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<typeof threadOpenSplitSchema>;\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<z$1.ZodNumber>;\n}, z$1.core.$strict>;\ntype ThreadOpenFile = z$1.infer<typeof threadOpenFileSchema>;\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<typeof threadOpenResponseSchema>;\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<typeof threadPaneActionSchema>;\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<typeof threadPaneActionResponseSchema>;\ndeclare const threadArchiveAllResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral<true>;\n archivedThreadIds: z$1.ZodArray<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype ThreadArchiveAllResponse = z$1.infer<typeof threadArchiveAllResponseSchema>;\ndeclare const threadListQuerySchema: z$1.ZodObject<{\n projectId: z$1.ZodOptional<z$1.ZodString>;\n parentThreadId: z$1.ZodOptional<z$1.ZodString>;\n sourceThreadId: z$1.ZodOptional<z$1.ZodString>;\n archived: z$1.ZodOptional<z$1.ZodEnum<{\n true: \"true\";\n false: \"false\";\n }>>;\n sectionId: z$1.ZodOptional<z$1.ZodString>;\n unsectioned: z$1.ZodOptional<z$1.ZodEnum<{\n true: \"true\";\n false: \"false\";\n }>>;\n hasParent: z$1.ZodOptional<z$1.ZodEnum<{\n true: \"true\";\n false: \"false\";\n }>>;\n originKind: z$1.ZodOptional<z$1.ZodEnum<{\n fork: \"fork\";\n }>>;\n originPluginId: z$1.ZodOptional<z$1.ZodString>;\n childOrigin: z$1.ZodOptional<z$1.ZodEnum<{\n fork: \"fork\";\n }>>;\n includeHidden: z$1.ZodOptional<z$1.ZodEnum<{\n true: \"true\";\n false: \"false\";\n }>>;\n limit: z$1.ZodOptional<z$1.ZodString>;\n offset: z$1.ZodOptional<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype ThreadListQuery = z$1.infer<typeof threadListQuerySchema>;\ndeclare const threadSearchQuerySchema: z$1.ZodObject<{\n query: z$1.ZodString;\n limitPerGroup: z$1.ZodOptional<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype ThreadSearchQuery = z$1.infer<typeof threadSearchQuerySchema>;\ndeclare const threadTimelineQuerySchema: z$1.ZodObject<{\n includeNestedRows: z$1.ZodOptional<z$1.ZodEnum<{\n true: \"true\";\n false: \"false\";\n }>>;\n segmentLimit: z$1.ZodOptional<z$1.ZodString>;\n beforeAnchorSeq: z$1.ZodOptional<z$1.ZodString>;\n beforeAnchorId: z$1.ZodOptional<z$1.ZodString>;\n summaryOnly: z$1.ZodOptional<z$1.ZodEnum<{\n true: \"true\";\n false: \"false\";\n }>>;\n afterSequence: z$1.ZodOptional<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype ThreadTimelineQuery = z$1.infer<typeof threadTimelineQuerySchema>;\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<typeof timelineTurnSummaryDetailsQuerySchema>;\ndeclare const threadStorageFilesQuerySchema: z$1.ZodObject<{\n query: z$1.ZodOptional<z$1.ZodString>;\n limit: z$1.ZodOptional<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype ThreadStorageFilesQuery = z$1.infer<typeof threadStorageFilesQuerySchema>;\ndeclare const threadStoragePathsQuerySchema: z$1.ZodObject<{\n query: z$1.ZodOptional<z$1.ZodString>;\n limit: z$1.ZodOptional<z$1.ZodString>;\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<typeof threadStoragePathsQuerySchema>;\ndeclare const timelineTurnSummaryDetailsResponseSchema: z$1.ZodObject<{\n rows: z$1.ZodArray<z$1.ZodType<TimelineRow, unknown, z$1.core.$ZodTypeInternals<TimelineRow, unknown>>>;\n}, z$1.core.$strip>;\ntype TimelineTurnSummaryDetailsResponse = z$1.infer<typeof timelineTurnSummaryDetailsResponseSchema>;\ndeclare const threadTimelineResponseSchema: z$1.ZodObject<{\n rows: z$1.ZodArray<z$1.ZodType<TimelineRow, unknown, z$1.core.$ZodTypeInternals<TimelineRow, unknown>>>;\n activePromptMode: z$1.ZodNullable<z$1.ZodObject<{\n mode: z$1.ZodLiteral<\"plan\">;\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<z$1.ZodObject<{\n id: z$1.ZodString;\n text: z$1.ZodString;\n startedAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n activeWorkflows: z$1.ZodArray<z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodObject<{\n phases: z$1.ZodArray<z$1.ZodObject<{\n index: z$1.ZodNumber;\n title: z$1.ZodString;\n kind: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>>;\n agents: z$1.ZodArray<z$1.ZodObject<{\n index: z$1.ZodNumber;\n label: z$1.ZodString;\n state: z$1.ZodEnum<{\n running: \"running\";\n failed: \"failed\";\n queued: \"queued\";\n done: \"done\";\n skipped: \"skipped\";\n }>;\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<z$1.ZodNumber>;\n phaseTitle: z$1.ZodOptional<z$1.ZodString>;\n agentType: z$1.ZodOptional<z$1.ZodString>;\n isolation: z$1.ZodOptional<z$1.ZodString>;\n queuedAt: z$1.ZodOptional<z$1.ZodNumber>;\n startedAt: z$1.ZodOptional<z$1.ZodNumber>;\n lastToolName: z$1.ZodOptional<z$1.ZodString>;\n lastToolSummary: z$1.ZodOptional<z$1.ZodString>;\n promptPreview: z$1.ZodOptional<z$1.ZodString>;\n resultPreview: z$1.ZodOptional<z$1.ZodString>;\n error: z$1.ZodOptional<z$1.ZodString>;\n tokens: z$1.ZodOptional<z$1.ZodNumber>;\n toolCalls: z$1.ZodOptional<z$1.ZodNumber>;\n durationMs: z$1.ZodOptional<z$1.ZodNumber>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n usage: z$1.ZodNullable<z$1.ZodObject<{\n totalTokens: z$1.ZodNumber;\n toolUses: z$1.ZodNumber;\n durationMs: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n summary: z$1.ZodNullable<z$1.ZodString>;\n error: z$1.ZodNullable<z$1.ZodString>;\n completedAt: z$1.ZodNullable<z$1.ZodNumber>;\n }, z$1.core.$strip>>;\n activeBackgroundCommands: z$1.ZodArray<z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodObject<{\n phases: z$1.ZodArray<z$1.ZodObject<{\n index: z$1.ZodNumber;\n title: z$1.ZodString;\n kind: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>>;\n agents: z$1.ZodArray<z$1.ZodObject<{\n index: z$1.ZodNumber;\n label: z$1.ZodString;\n state: z$1.ZodEnum<{\n running: \"running\";\n failed: \"failed\";\n queued: \"queued\";\n done: \"done\";\n skipped: \"skipped\";\n }>;\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<z$1.ZodNumber>;\n phaseTitle: z$1.ZodOptional<z$1.ZodString>;\n agentType: z$1.ZodOptional<z$1.ZodString>;\n isolation: z$1.ZodOptional<z$1.ZodString>;\n queuedAt: z$1.ZodOptional<z$1.ZodNumber>;\n startedAt: z$1.ZodOptional<z$1.ZodNumber>;\n lastToolName: z$1.ZodOptional<z$1.ZodString>;\n lastToolSummary: z$1.ZodOptional<z$1.ZodString>;\n promptPreview: z$1.ZodOptional<z$1.ZodString>;\n resultPreview: z$1.ZodOptional<z$1.ZodString>;\n error: z$1.ZodOptional<z$1.ZodString>;\n tokens: z$1.ZodOptional<z$1.ZodNumber>;\n toolCalls: z$1.ZodOptional<z$1.ZodNumber>;\n durationMs: z$1.ZodOptional<z$1.ZodNumber>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n usage: z$1.ZodNullable<z$1.ZodObject<{\n totalTokens: z$1.ZodNumber;\n toolUses: z$1.ZodNumber;\n durationMs: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n summary: z$1.ZodNullable<z$1.ZodString>;\n error: z$1.ZodNullable<z$1.ZodString>;\n completedAt: z$1.ZodNullable<z$1.ZodNumber>;\n }, z$1.core.$strip>>;\n pendingTodos: z$1.ZodNullable<z$1.ZodObject<{\n sourceSeq: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n items: z$1.ZodArray<z$1.ZodObject<{\n id: z$1.ZodString;\n text: z$1.ZodString;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n in_progress: \"in_progress\";\n }>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n goal: z$1.ZodNullable<z$1.ZodObject<{\n sourceSeq: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n objective: z$1.ZodString;\n status: z$1.ZodEnum<{\n active: \"active\";\n paused: \"paused\";\n budgetLimited: \"budgetLimited\";\n complete: \"complete\";\n }>;\n tokenBudget: z$1.ZodNullable<z$1.ZodNumber>;\n tokensUsed: z$1.ZodNumber;\n timeUsedSeconds: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n modelFallback: z$1.ZodNullable<z$1.ZodObject<{\n sourceSeq: z$1.ZodNumber;\n detectedAt: z$1.ZodNumber;\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>>;\n contextWindowUsage: z$1.ZodOptional<z$1.ZodObject<{\n usedTokens: z$1.ZodNumber;\n modelContextWindow: z$1.ZodNumber;\n estimated: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\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<z$1.ZodObject<{\n anchorSeq: z$1.ZodNumber;\n anchorId: z$1.ZodString;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>;\n maxSeq: z$1.ZodNumber;\n delta: z$1.ZodOptional<z$1.ZodObject<{\n upsertRows: z$1.ZodArray<z$1.ZodType<TimelineRow, unknown, z$1.core.$ZodTypeInternals<TimelineRow, unknown>>>;\n rowOrder: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype ThreadTimelineResponse = z$1.infer<typeof threadTimelineResponseSchema>;\ndeclare const threadConversationOutlineResponseSchema: z$1.ZodObject<{\n items: z$1.ZodArray<z$1.ZodObject<{\n id: z$1.ZodString;\n role: z$1.ZodEnum<{\n user: \"user\";\n assistant: \"assistant\";\n }>;\n preview: z$1.ZodString;\n attachmentSummary: z$1.ZodNullable<z$1.ZodObject<{\n imageCount: z$1.ZodNumber;\n fileCount: z$1.ZodNumber;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>>;\n maxSeq: z$1.ZodNumber;\n}, z$1.core.$strict>;\ntype ThreadConversationOutlineResponse = z$1.infer<typeof threadConversationOutlineResponseSchema>;\ndeclare const threadStorageFileListResponseSchema: z$1.ZodObject<{\n files: z$1.ZodArray<z$1.ZodObject<{\n path: z$1.ZodString;\n name: z$1.ZodString;\n }, z$1.core.$strip>>;\n truncated: z$1.ZodBoolean;\n storageRootPath: z$1.ZodString;\n}, z$1.core.$strip>;\ntype ThreadStorageFileListResponse = z$1.infer<typeof threadStorageFileListResponseSchema>;\ndeclare const threadStoragePathListResponseSchema: z$1.ZodObject<{\n paths: z$1.ZodArray<z$1.ZodObject<{\n kind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n name: z$1.ZodString;\n score: z$1.ZodNumber;\n positions: z$1.ZodArray<z$1.ZodNumber>;\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<typeof threadStoragePathListResponseSchema>;\n\ndeclare const threadTabsResponseSchema: z$1.ZodObject<{\n revision: z$1.ZodNumber;\n tabs: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"thread-info\">;\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<z$1.ZodString>;\n pluginId: z$1.ZodString;\n title: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable<z$1.ZodString>;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"workspace-file-preview\">;\n lineRange: z$1.ZodNullable<z$1.ZodObject<{\n endLineNumber: z$1.ZodNumber;\n startLineNumber: z$1.ZodNumber;\n }, z$1.core.$strict>>;\n path: z$1.ZodString;\n projectId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodLiteral<\"deleted\">>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable<z$1.ZodString>;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"host-file-preview\">;\n lineRange: z$1.ZodNullable<z$1.ZodObject<{\n endLineNumber: z$1.ZodNumber;\n startLineNumber: z$1.ZodNumber;\n }, z$1.core.$strict>>;\n path: z$1.ZodString;\n threadId: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable<z$1.ZodString>;\n id: z$1.ZodString;\n isPinned: z$1.ZodBoolean;\n kind: z$1.ZodLiteral<\"thread-storage-file-preview\">;\n lineRange: z$1.ZodNullable<z$1.ZodObject<{\n endLineNumber: z$1.ZodNumber;\n startLineNumber: z$1.ZodNumber;\n }, z$1.core.$strict>>;\n path: z$1.ZodString;\n threadId: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable<z$1.ZodString>;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"browser\">;\n title: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodNumber>;\n threadId: z$1.ZodNullable<z$1.ZodString>;\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<typeof threadTabsResponseSchema>;\ndeclare const updateThreadTabsRequestSchema: z$1.ZodObject<{\n expectedRevision: z$1.ZodNumber;\n tabs: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"thread-info\">;\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<z$1.ZodString>;\n pluginId: z$1.ZodString;\n title: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable<z$1.ZodString>;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"workspace-file-preview\">;\n lineRange: z$1.ZodNullable<z$1.ZodObject<{\n endLineNumber: z$1.ZodNumber;\n startLineNumber: z$1.ZodNumber;\n }, z$1.core.$strict>>;\n path: z$1.ZodString;\n projectId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodLiteral<\"deleted\">>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable<z$1.ZodString>;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"host-file-preview\">;\n lineRange: z$1.ZodNullable<z$1.ZodObject<{\n endLineNumber: z$1.ZodNumber;\n startLineNumber: z$1.ZodNumber;\n }, z$1.core.$strict>>;\n path: z$1.ZodString;\n threadId: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable<z$1.ZodString>;\n id: z$1.ZodString;\n isPinned: z$1.ZodBoolean;\n kind: z$1.ZodLiteral<\"thread-storage-file-preview\">;\n lineRange: z$1.ZodNullable<z$1.ZodObject<{\n endLineNumber: z$1.ZodNumber;\n startLineNumber: z$1.ZodNumber;\n }, z$1.core.$strict>>;\n path: z$1.ZodString;\n threadId: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable<z$1.ZodString>;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"browser\">;\n title: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodNumber>;\n threadId: z$1.ZodNullable<z$1.ZodString>;\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<typeof updateThreadTabsRequestSchema>;\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/** 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<Input = unknown, Output = Input> {\n readonly \"~standard\": {\n readonly version: 1;\n readonly vendor: string;\n readonly validate: (value: unknown) => StandardSchemaV1Result<Output> | Promise<StandardSchemaV1Result<Output>>;\n readonly types?: {\n readonly input: Input;\n readonly output: Output;\n };\n };\n}\ntype StandardSchemaV1Result<Output> = {\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<Schema extends StandardSchemaV1> = NonNullable<Schema[\"~standard\"][\"types\"]>[\"input\"];\ntype StandardSchemaV1InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema[\"~standard\"][\"types\"]>[\"output\"];\ninterface PluginRpcMethodContract<InputSchema extends StandardSchemaV1 = StandardSchemaV1, OutputSchema extends StandardSchemaV1 = StandardSchemaV1> {\n readonly input: InputSchema;\n readonly output: OutputSchema;\n}\ntype PluginRpcContract = Readonly<Record<string, PluginRpcMethodContract>>;\n/** Define a shared RPC contract while preserving exact method/schema types. */\ndeclare function defineRpcContract<const Contract extends PluginRpcContract>(contract: Contract): Contract;\ntype PluginRpcHandlers<Contract extends PluginRpcContract> = {\n [Method in keyof Contract]: (input: StandardSchemaV1InferOutput<Contract[Method][\"input\"]>) => StandardSchemaV1InferInput<Contract[Method][\"output\"]> | Promise<StandardSchemaV1InferInput<Contract[Method][\"output\"]>>;\n};\ntype PluginRpcCallInput<Method extends PluginRpcMethodContract> = StandardSchemaV1InferInput<Method[\"input\"]>;\ntype PluginRpcCallArgs<Method extends PluginRpcMethodContract> = null extends PluginRpcCallInput<Method> ? [input?: PluginRpcCallInput<Method>] : [input: PluginRpcCallInput<Method>];\ntype PluginRpcResult<Method extends PluginRpcMethodContract> = StandardSchemaV1InferOutput<Method[\"output\"]>;\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/<pluginId>/<path>/*`, 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<void>;\n cancel(): Promise<void>;\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 * Props passed to an `experimental_threadList` component — the sidebar's\n * scrolling thread area, replaced wholesale by one plugin.\n */\ninterface PluginThreadListProps {\n /** The thread the route currently shows; null on non-thread routes. */\n activeThreadId: string | null;\n /** The project the route currently shows; null when none is selected. */\n activeProjectId: string | null;\n /** True on phone-width viewports and coarse pointers. */\n isCompactViewport: boolean;\n /**\n * Call after the user opens a thread. Closes the mobile sidebar drawer and\n * is a no-op on desktop, so always call it.\n */\n onNavigate: () => void;\n /**\n * The host search field's current text, or \"\" when the field is closed.\n * The host owns that field, so a plugin list filters by this rather than\n * shipping a second search box.\n */\n searchQuery: string;\n}\n/**\n * Props passed to an `experimental_threadHeaderAction` component, rendered in\n * the thread header's action row.\n */\ninterface PluginThreadHeaderActionProps {\n /**\n * The thread this header belongs to. Never null: the slot is not rendered\n * on the compose screen or other non-thread routes. A split layout renders\n * one header per pane, so the component mounts once per visible thread,\n * each with its own id — keep per-thread state in the component, never in a\n * module-level singleton.\n */\n threadId: string;\n projectId: string;\n /**\n * True on phone-width viewports and coarse pointers. Collapse to an\n * icon-sized control when it is true — the row is short.\n */\n isCompactViewport: boolean;\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<Record<string, string>>;\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<PluginHomepageSectionProps>;\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<PluginSettingsSectionProps>;\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/<pluginId>/`; letters, digits, `-`, `_`. */\n path: string;\n component: ComponentType<PluginNavPanelProps>;\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<PluginNavPanelProps>;\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<PluginThreadPanelProps>;\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 * `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<void>;\n}\ninterface PluginPendingInteractionRegistration {\n /** Matches `rendererId` passed to `bb.ui.requestInput`. */\n id: string;\n component: ComponentType<PluginPendingInteractionProps>;\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<void>;\n}\n/**\n * The one status bb would paint for a thread, already resolved through the\n * host's precedence (attention before work; plan and goal before the generic\n * spinner). Draw your own glyph for it — the SDK ships no status component.\n *\n * Treat an unrecognized value as \"none\": bb adds kinds over time, and an\n * older plugin must degrade to drawing nothing rather than throwing.\n *\n * \"draft\" and \"working-draft\" are never reported here: an unsubmitted composer\n * draft is per-client state the host reads per row, which an array-wide view\n * cannot. A thread holding a draft reports whatever it would report without\n * one.\n */\ntype PluginSidebarThreadIndicator = \"unread-error\" | \"waiting-for-input\" | \"working-draft\" | \"workflow\" | \"background-agent\" | \"background-command\" | \"plan-mode\" | \"goal\" | \"runtime\" | \"draft\" | \"unread-success\" | \"none\";\n/**\n * How a thread's environment presents its workspace: a worktree bb manages,\n * a worktree the user manages, or anything else (a plain checkout).\n */\ntype PluginSidebarWorkspaceKind = \"managed-worktree\" | \"unmanaged-worktree\" | \"other\";\n/** Live work counts on a thread. All zero means nothing is running. */\ninterface PluginSidebarThreadActivity {\n workflows: number;\n backgroundAgents: number;\n backgroundCommands: number;\n planMode: number;\n goals: number;\n}\n/**\n * One thread in the sidebar's live view.\n *\n * A deliberate copy of the fields a sidebar needs — not a re-export of the\n * host's internal thread row type, which changes whenever the app needs a\n * field. Timestamps are epoch milliseconds.\n */\ninterface PluginSidebarThread {\n id: string;\n projectId: string;\n /** Null while a thread is still unnamed; pair with `titleFallback`. */\n title: string | null;\n titleFallback: string | null;\n /** The thread this one was forked from or spawned under; null at the root. */\n parentThreadId: string | null;\n sectionId: string | null;\n /** How this thread came to exist under its parent; null for root threads. */\n originKind: \"fork\" | \"side-chat\" | null;\n /** The plugin that spawned it, or null for non-plugin origins. */\n originPluginId: string | null;\n /** The agent provider this thread runs on, e.g. \"codex\", \"claude-code\". */\n providerId: string;\n /** The agent is blocked on the user: an approval or a question. */\n hasPendingInteraction: boolean;\n activity: PluginSidebarThreadActivity;\n indicator: PluginSidebarThreadIndicator;\n /**\n * The host's accessible label for `indicator`, e.g. \"Thread needs user\n * input\"; null when the indicator is \"none\". Use it for `aria-label` so\n * screen-reader text stays consistent across sidebars.\n */\n indicatorLabel: string | null;\n isUnread: boolean;\n isPinned: boolean;\n isArchived: boolean;\n environment: {\n id: string | null;\n name: string | null;\n branchName: string | null;\n workspaceDisplayKind: PluginSidebarWorkspaceKind;\n } | null;\n /**\n * The machine this thread's work runs on, with the name resolved for you.\n * Null when the thread has no environment yet, or when its host is not in\n * the known-hosts list. Useful where a thread has no branch to show — a\n * personal-project thread has a machine but no worktree.\n */\n host: {\n id: string;\n name: string;\n } | null;\n createdAt: number;\n updatedAt: number;\n lastReadAt: number | null;\n latestAttentionAt: number;\n}\n/**\n * The pull request for a thread's branch, narrowed to what a sidebar row\n * needs. `attention` is bb's rolled-up \"does this need you\" signal, so a row\n * can colour a badge without reading checks, review, and mergeability itself.\n */\ninterface PluginSidebarPullRequest {\n number: number;\n title: string;\n url: string;\n state: \"draft\" | \"open\" | \"merged\" | \"closed\";\n attention: \"checks_failed\" | \"checks_pending\" | \"changes_requested\" | \"review_requested\" | \"conflicts\" | \"blocked\" | \"draft\" | \"ready_to_merge\" | \"merged\" | \"closed\" | \"none\";\n}\ninterface PluginSidebarThreadPullRequestState {\n /** True while the first lookup for this thread's environment is in flight. */\n isLoading: boolean;\n /**\n * The pull request, or null when the branch has none, the thread has no\n * environment, or the lookup could not run (a git-host hiccup). A row should\n * treat null as \"nothing to show\", never as an error.\n */\n pullRequest: PluginSidebarPullRequest | null;\n}\n/** One project in the sidebar's live view. */\ninterface PluginSidebarProject {\n id: string;\n name: string;\n /** True for the implicit personal project. */\n isPersonal: boolean;\n}\ninterface PluginSidebarThreadsState {\n status: \"loading\" | \"ready\" | \"error\";\n threads: readonly PluginSidebarThread[];\n projects: readonly PluginSidebarProject[];\n}\n/**\n * Act on threads from a plugin surface. Every method routes to the host's own\n * flow, so optimistic updates, toasts, dialogs, pane closing, and route repair\n * behave exactly as they do in the built-in sidebar. Unknown thread ids are\n * ignored by `open` and rejected by the rest.\n */\ninterface PluginSidebarThreadActions {\n /**\n * Navigate to a thread. `split: true` applies bb's split placement rules —\n * a right split by default, focus when the thread is already open, replace\n * at the pane cap — and falls back to plain navigation where splits are off.\n */\n open(threadId: string, options?: {\n split?: boolean;\n }): void;\n /**\n * Go to the new-thread screen. Passing `projectId` also makes that project\n * the composer's selection, so the thread is created where you asked.\n */\n openNewThread(options?: {\n projectId?: string;\n focusPrompt?: boolean;\n }): void;\n setPinned(threadId: string, pinned: boolean): Promise<void>;\n setRead(threadId: string, read: boolean): Promise<void>;\n /** Silent rename — no dialog. For inline editing in your own row. */\n rename(threadId: string, title: string): Promise<void>;\n /** Archives the thread AND its children, closing any panes showing them. */\n archive(threadId: string): void;\n /**\n * Opens bb's delete confirmation, which counts child threads first. Deletion\n * is destructive and recursive, so the host owns the confirmation: there is\n * deliberately no silent `delete`.\n */\n requestDelete(threadId: string): void;\n}\n/**\n * Render a plugin component in the thread header's action row.\n *\n * The frontend sibling of the backend `bb.ui.registerThreadAction`, which\n * renders a host-owned button and runs server-side. Use that one for \"do a\n * thing\"; use this one when the control must draw live state.\n *\n * The host places it at the left end of the action row, before the workspace\n * button, git actions, the panel toggle, maximize, and close. That row is a\n * 48px chrome row with 28px controls: render one inline control that fits, and\n * put anything taller in a portalled popover.\n */\ninterface PluginThreadHeaderActionRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /**\n * Names the region the host wraps around your component (a labelled group).\n * It does NOT label your control: an icon-only button still needs its own\n * accessible name.\n */\n title: string;\n component: ComponentType<PluginThreadHeaderActionProps>;\n}\n/** One pane's place in the split layout, as fractions of the split area. */\ninterface PluginSidebarSplitPane {\n paneId: string;\n rect: {\n x: number;\n y: number;\n width: number;\n height: number;\n };\n /** This pane holds the thread the row represents. */\n isMe: boolean;\n isFocused: boolean;\n}\n/**\n * Drag-to-split support for one row, plus where that thread currently sits in\n * the split layout.\n */\ninterface PluginSidebarThreadSplit {\n /**\n * Spread onto the row's interactive element. Carries the pointer handler\n * that starts a split drag; empty when splits are unavailable, so spreading\n * it is always safe.\n *\n * The host owns every rule: the gesture engages only once the pointer leaves\n * the sidebar toward the main area (so a list with its own drag-to-reorder\n * keeps working), an edge drop splits, a center drop replaces, an\n * already-open thread focuses its pane, and the pane cap coerces a split\n * into a replace.\n */\n splitProps: {\n onPointerDown?: (event: react.PointerEvent<HTMLElement>) => void;\n };\n /**\n * False on compact viewports, when the user disabled splits, and for an\n * unknown thread id. Gate any \"open in split\" affordance you draw on it.\n */\n isAvailable: boolean;\n /**\n * Where this thread sits in the split layout, or null when it is not open in\n * one (including single-pane layouts). Draw a mini-map, a tint, or nothing.\n */\n layout: {\n panes: readonly PluginSidebarSplitPane[];\n } | null;\n}\n/**\n * Replace the sidebar's thread list with a plugin component.\n *\n * Unlike every other slot, this one is EXCLUSIVE: two lists cannot share one\n * scroll area. The built-in list stays the default; the user picks a provider\n * in Settings → Appearance, stored per client. A provider that is uninstalled,\n * disabled, or crashing falls back to the built-in list rather than leaving\n * the user with no sidebar.\n *\n * The plugin gets the scrolling list and nothing else. The New-thread button,\n * the search field, the plugin nav rows, and the footer stay host-rendered in\n * every sidebar — they are shared surfaces (other plugins live in two of\n * them), and a replaced list must not be able to remove them.\n */\ninterface PluginThreadListRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Label in the Settings → Appearance → Sidebar picker. */\n title: string;\n /** Optional one-line description under the title in that picker. */\n description?: string;\n component: ComponentType<PluginThreadListProps>;\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<PluginFileOpenerProps>;\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<PluginMessageDirectiveProps>;\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().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<void>;\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 /**\n * Replace the sidebar's thread list (see\n * {@link PluginThreadListRegistration}). Experimental: see\n * docs/api_to_audit.md for what to audit before the prefix drops.\n */\n experimental_threadList(registration: PluginThreadListRegistration): void;\n /**\n * Render a component in the thread header's action row (see\n * {@link PluginThreadHeaderActionRegistration}). Experimental: see\n * docs/api_to_audit.md.\n */\n experimental_threadHeaderAction(registration: PluginThreadHeaderActionRegistration): void;\n fileOpener(registration: PluginFileOpenerRegistration): void;\n messageDirective(registration: PluginMessageDirectiveRegistration): void;\n 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 * Persistently decorate any thread row for this plugin generation.\n *\n * The status is owned by the frontend generation and therefore survives\n * route changes. Passing `null` clears the plugin's status for that thread.\n * The host clears every remaining status when the frontend generation\n * deactivates.\n *\n * Optional so bundles can feature-detect support while this experimental\n * surface rolls out across 0.x clients.\n */\n readonly experimental_setThreadRowStatus?: (threadId: string, status: PluginComposerThreadRowStatus | null) => void;\n}\n/** Cleanup returned by a frontend content script. */\ntype PluginContentScriptDisposer = () => void | Promise<void>;\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<void | PluginContentScriptDisposer>;\n}\n/** Lifecycle surface for trusted frontend content scripts. */\ninterface PluginAppContentScripts {\n register(registration: PluginContentScriptRegistration): void;\n}\ninterface PluginAppBuilder {\n slots: PluginAppSlots;\n composer: PluginAppComposer;\n 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<Contract extends PluginRpcContract = PluginRpcContract> {\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 extends Extract<keyof Contract, string>>(method: Method, ...args: PluginRpcCallArgs<Contract[Method]>): Promise<PluginRpcResult<Contract[Method]>>;\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<string, string | boolean> | 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<void>;\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 * 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<void>;\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 /**\n * Who controls the permission mode sends run with. \"inherit\" (default)\n * pins every send to the thread's own resolved default and renders the\n * picker as a dimmed label — a plugin surface can never widen it.\n * \"editable\" gives this chat its own picker, so the user can raise or\n * lower permissions for this thread independently of the thread it was\n * forked from. Ignored by `variant: \"timeline\"` (no composer).\n */\n permissionPolicy?: \"inherit\" | \"editable\";\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 * Every selection the composer resolved, JSON-serializable so a plugin can\n * forward it to its own backend rpc verbatim and hand it straight to\n * `bb.sdk.threads.spawn`.\n *\n * The split is deliberate: the composer owns *user selections*, the plugin\n * owns *filing and attribution*. `bb.sdk.threads.spawn` auto-fills\n * `origin: \"plugin\"` and `originPluginId`, so a thread created this way stays\n * attributed to the plugin — which it would not be if the component created\n * the thread itself. The plugin adds `sectionId`, `parentThreadId`, `title`,\n * and `visibility` to the request on its own; they are deliberately not\n * composer props.\n */\ninterface NewThreadRequest {\n projectId: string;\n providerId: string;\n model: string;\n reasoningLevel: ReasoningLevel;\n permissionMode: PermissionMode;\n /** Omitted when the selected provider has no service tiers. */\n serviceTier?: ServiceTier;\n /**\n * Per-field provenance (caller-explicit vs. default) for the execution\n * options above, forwarded to `spawn` so the server records what the user\n * actually chose.\n */\n executionInputSources: CreateExecutionInputSources;\n environment: CreateThreadEnvironmentArgs;\n input: PromptInput[];\n}\n/**\n * Props of the host-owned `experimental_NewThreadComposer` component — bb's\n * full new-thread compose surface (prompt editor with @-mentions and expand,\n * attachments, provider/model/reasoning picker, voice, submit, and the row\n * beneath with project, environment, branch-from, and permission mode),\n * rendered by the BB app inside a plugin slot.\n *\n * It is the create-side counterpart to `ThreadChat`: same deliberate\n * exception to the no-host-components rule (§5.5), same additive versioning.\n */\ninterface NewThreadComposerProps {\n /** Seeds the project picker. The user can change it. */\n defaultProjectId?: string;\n /**\n * Seeds the provider picker. Like every `default*` prop this is a SEED, not\n * a controlled value: the composer stays uncontrolled, the user can change\n * it, and when omitted the composer falls back to the project's remembered\n * execution defaults exactly as before. When provided it takes precedence\n * over those project defaults.\n *\n * Re-seeding: the `default*` props are value-compared each render. When any\n * of them changes after mount, the composer re-seeds EVERY execution and\n * environment selection from the new props — including selections the user\n * had already touched — so switching between two saved records in the same\n * mounted composer reloads that record's values (the same rule\n * `defaultProjectId` already follows).\n *\n * Every seeded field is reported as caller-explicit in the submitted\n * request's `executionInputSources`. That is what makes the seed survive\n * `threads.spawn`: the server drops a requested `providerId`/`model` that\n * carries no provenance source and re-derives it from the project's stored\n * defaults, which would silently undo the seed.\n */\n defaultProviderId?: string;\n /** Seeds the model picker. Same seed semantics as {@link defaultProviderId}. */\n defaultModel?: string;\n /**\n * Seeds the reasoning-level picker. Same seed semantics as\n * {@link defaultProviderId}. If the seeded model does not support this\n * level, the composer reconciles to the closest supported one.\n */\n defaultReasoningLevel?: ReasoningLevel;\n /**\n * Seeds the service-tier picker. Same seed semantics as\n * {@link defaultProviderId}. Ignored (and omitted from the submitted\n * request) when the selected provider has no service tiers.\n */\n defaultServiceTier?: ServiceTier;\n /** Seeds the permission-mode picker. Same seed semantics as {@link defaultProviderId}. */\n defaultPermissionMode?: PermissionMode;\n /**\n * Seeds the environment and branch pickers from a previously submitted\n * `NewThreadRequest.environment`. Same seed semantics as\n * {@link defaultProviderId}: a seed the user can change, taking precedence\n * over the composer's own environment default when provided.\n *\n * Round trip: feeding a submitted request's `environment` back in and\n * resubmitting untouched reproduces an equivalent environment, with these\n * documented limits — the composer cannot represent every args variant:\n *\n * - `{ type: \"project-default\" }` seeds nothing; the composer resolves its\n * own default and submits that concrete environment instead.\n * - A `host` environment whose host no longer exists (or whose project has\n * no source on it) falls back to the composer's default host, exactly as\n * the primary compose surface would.\n * - A `reuse` environment whose worktree no longer has unarchived threads\n * falls back the same way.\n * - An `unmanaged` workspace's `path` has no composer control; the seeded\n * selection submits `path: null` (the host's configured checkout). The\n * composer itself never produces a non-null `path`, so real round trips\n * are unaffected.\n * - A `managed-worktree` with `baseBranch: { kind: \"default\" }` leaves the\n * branch picker on its default, which may resolve to a named base branch\n * when the project configures a dedicated worktree base — the same branch\n * the original `default` submission would have created from.\n */\n defaultEnvironment?: CreateThreadEnvironmentArgs;\n /** Seeds the draft, only while the draft is still empty. */\n initialPrompt?: string;\n placeholder?: string;\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 editor. */\n focusRequest?: number;\n className?: string;\n /**\n * Where the draft persists. Drafts survive reloads and are shared by every\n * composer using the same key; defaults to a key scoped to this plugin.\n */\n draftKey?: string;\n /**\n * Fires on submit with every selection resolved. The draft clears when this\n * resolves and is KEPT if it throws, so a failed create never loses what the\n * user typed.\n */\n onSubmit: (request: NewThreadRequest) => void | Promise<void>;\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 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<Contract extends PluginRpcContract = PluginRpcContract>(): PluginRpcClient<Contract>;\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 sidebar's live thread view (see {@link PluginSidebarThreadsState}).\n * Reads the host's own cache and realtime subscriptions, so it costs no\n * extra request and updates exactly when the built-in sidebar does.\n * Experimental: see docs/api_to_audit.md.\n */\n experimental_useSidebarThreads(): PluginSidebarThreadsState;\n /**\n * Thread actions bound to the host's mutations (see\n * {@link PluginSidebarThreadActions}). Experimental: see\n * docs/api_to_audit.md.\n */\n experimental_useSidebarThreadActions(): PluginSidebarThreadActions;\n /**\n * The pull request for one thread's branch (see\n * {@link PluginSidebarThreadPullRequestState}).\n *\n * Per row and opt-in, because it costs a git-host lookup: it is NOT on the\n * thread payload every sidebar loads. Threads sharing an environment share\n * one query, and the host owns the polling and staleness rules — an open PR\n * with pending checks refreshes, a merged one does not.\n *\n * Experimental: see docs/api_to_audit.md.\n */\n experimental_useSidebarThreadPullRequest(threadId: string): PluginSidebarThreadPullRequestState;\n /**\n * Per-row drag-to-split support (see {@link PluginSidebarThreadSplit}).\n * Call it once per rendered row, like the built-in sidebar does.\n * Experimental: see docs/api_to_audit.md.\n */\n experimental_useSidebarThreadSplit(threadId: string): PluginSidebarThreadSplit;\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 ThreadChat: ComponentType<ThreadChatProps>;\n /**\n * The host-owned chat-message markdown renderer (see\n * {@link MarkdownProps}).\n */\n Markdown: ComponentType<MarkdownProps>;\n /**\n * The host-owned new-thread compose surface (see\n * {@link NewThreadComposerProps}). Experimental: see\n * docs/api_to_audit.md for what to audit before the prefix drops.\n */\n experimental_NewThreadComposer: ComponentType<NewThreadComposerProps>;\n useComposerView(): ComposerView;\n}\n\ninterface EnvironmentActionArgs {\n environmentId: string;\n}\ninterface EnvironmentGetArgs extends EnvironmentActionArgs {\n signal?: AbortSignal;\n}\ntype EnvironmentMergeBaseBranchUpdateValue = Exclude<UpdateEnvironmentRequest[\"mergeBaseBranch\"], undefined>;\ntype EnvironmentNameUpdateValue = Exclude<UpdateEnvironmentRequest[\"name\"], undefined>;\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<EnvironmentArchiveThreadsResult>;\n commit(args: EnvironmentCommitArgs): Promise<EnvironmentCommitResult>;\n diff(args: EnvironmentDiffArgs): Promise<EnvironmentDiffResult>;\n diffBranches(args: EnvironmentDiffBranchesArgs): Promise<EnvironmentDiffBranchesResult>;\n diffFile(args: EnvironmentDiffFileArgs): Promise<EnvironmentDiffFileResult>;\n diffFiles(args: EnvironmentDiffArgs): Promise<EnvironmentDiffFilesResult>;\n diffPatch(args: EnvironmentDiffPatchArgs): Promise<EnvironmentDiffPatchResult>;\n get(args: EnvironmentGetArgs): Promise<EnvironmentGetResult>;\n pullRequest(args: EnvironmentGetArgs): Promise<EnvironmentPullRequestResult>;\n markPullRequestDraft(args: EnvironmentActionArgs): Promise<EnvironmentMarkPullRequestDraftResult>;\n markPullRequestReady(args: EnvironmentActionArgs): Promise<EnvironmentMarkPullRequestReadyResult>;\n mergePullRequest(args: EnvironmentPullRequestMergeArgs): Promise<EnvironmentMergePullRequestResult>;\n paths(args: EnvironmentPathsArgs): Promise<EnvironmentPathsResult>;\n squashMerge(args: EnvironmentSquashMergeArgs): Promise<EnvironmentSquashMergeResult>;\n status(args: EnvironmentStatusArgs): Promise<EnvironmentStatusResult>;\n update(args: EnvironmentUpdateArgs): Promise<EnvironmentUpdateResult>;\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<FileReadResult>;\n write(args: FileWriteArgs): Promise<FileWriteResult>;\n list(args: FileListArgs): Promise<FileListResult>;\n listPaths(args: PathListArgs): Promise<PathListResult>;\n mkdir(args: FileMkdirArgs): Promise<FileMkdirResult>;\n move(args: FileMoveArgs): Promise<FileMoveResult>;\n remove(args: FileRemoveArgs): Promise<FileRemoveResult>;\n createPreview(args: FilePreviewArgs): Promise<FilePreviewResult>;\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<HostCreateJoinCodeResult>;\n delete(args: HostDeleteArgs): Promise<HostDeleteResult>;\n directory(args: HostDirectoryArgs): Promise<HostDirectoryResult>;\n get(args: HostGetArgs): Promise<HostGetResult>;\n cloneDefaultPath(args: HostCloneDefaultPathArgs): Promise<HostCloneDefaultPathResult>;\n installProviderCli(args: HostProviderCliInstallArgs): Promise<HostProviderCliInstallResult>;\n list(args?: HostListArgs): Promise<HostListResult>;\n pathsExist(args: HostPathsExistArgs): Promise<HostPathsExistResult>;\n pickFolder(args: HostPickFolderArgs): Promise<HostPickFolderResult>;\n providerCliStatus(args: HostGetArgs): Promise<HostProviderCliStatusResult>;\n retryUpdate(args: HostRetryUpdateArgs): Promise<HostRetryUpdateResult>;\n update(args: HostUpdateArgs): Promise<HostUpdateResult>;\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<ProjectFilesQuery, \"environmentId\" | \"hostId\"> & {\n projectId: string;\n signal?: AbortSignal;\n};\ntype ProjectPathsArgs = ProjectWorkspaceRoutingArgs & Omit<ProjectPathsQuery, \"environmentId\" | \"hostId\"> & {\n projectId: string;\n signal?: AbortSignal;\n};\ntype ProjectCommandsArgs = ProjectWorkspaceRoutingArgs & Omit<ProjectCommandsQuery, \"environmentId\" | \"hostId\"> & {\n projectId: string;\n signal?: AbortSignal;\n};\ntype ProjectFileContentArgs = ProjectWorkspaceRoutingArgs & Omit<ProjectFileContentQuery, \"environmentId\" | \"hostId\"> & {\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<ArrayBuffer>;\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<ProjectSourceAddResult>;\n delete(args: ProjectSourceDeleteArgs): Promise<ProjectSourceDeleteResult>;\n update(args: ProjectSourceUpdateArgs): Promise<ProjectSourceUpdateResult>;\n}\ninterface ProjectAttachmentsArea {\n copy(args: ProjectAttachmentCopyArgs): Promise<void>;\n read(args: ProjectAttachmentReadArgs): Promise<ProjectAttachmentReadResult>;\n upload(args: ProjectAttachmentUploadArgs): Promise<ProjectAttachmentUploadResult>;\n}\ninterface ProjectsArea {\n attachments: ProjectAttachmentsArea;\n branches(args: ProjectBranchesArgs): Promise<ProjectBranchesResult>;\n commands(args: ProjectCommandsArgs): Promise<ProjectCommandsResult>;\n create(args: ProjectCreateArgs): Promise<ProjectCreateResult>;\n defaultExecutionOptions(args: ProjectDefaultExecutionOptionsArgs): Promise<ProjectDefaultExecutionOptionsResult>;\n delete(args: ProjectDeleteArgs): Promise<ProjectDeleteResult>;\n fileContent(args: ProjectFileContentArgs): Promise<ProjectFileContentResult>;\n files(args: ProjectFilesArgs): Promise<ProjectFilesResult>;\n get(args: ProjectGetArgs): Promise<ProjectGetResult>;\n list(args?: ProjectListArgs): Promise<ProjectListResult>;\n paths(args: ProjectPathsArgs): Promise<ProjectPathsResult>;\n promptHistory(args: ProjectPromptHistoryArgs): Promise<ProjectPromptHistoryResult>;\n reorder(args: ProjectReorderArgs): Promise<ProjectReorderResult>;\n sources: ProjectSourcesArea;\n update(args: ProjectUpdateArgs): Promise<ProjectUpdateResult>;\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<ProviderListResult>;\n /** List models on the environment host, explicit host, or primary host. */\n models(args?: ProviderModelsArgs): Promise<ProviderModelsResult>;\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<string, JsonValue$1>;\n}\ninterface PluginTokenArgs extends PluginIdArgs {\n rotate?: boolean;\n}\ninterface PluginCheckUpdatesArgs {\n pluginId?: string;\n signal?: AbortSignal;\n}\ninterface PluginRpcArgs<TOutput> extends PluginIdArgs {\n input?: JsonValue$1;\n method: string;\n outputSchema: z$1.ZodType<TOutput>;\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<PluginInstallResult>;\n search(args: PluginCatalogSearchArgs): Promise<PluginCatalogSearchResult>;\n status(args?: PluginCatalogStatusArgs): Promise<PluginCatalogStatusResult>;\n}\ninterface PluginsArea {\n applyUpdate(args: PluginIdArgs): Promise<PluginApplyUpdateResult>;\n callRpc<TOutput>(args: PluginRpcArgs<TOutput>): Promise<TOutput>;\n checkUpdates(args?: PluginCheckUpdatesArgs): Promise<PluginCheckUpdatesResult>;\n catalog: PluginCatalogArea;\n disable(args: PluginIdArgs): Promise<PluginDisableResult>;\n enable(args: PluginIdArgs): Promise<PluginEnableResult>;\n getSettings(args: PluginGetSettingsArgs): Promise<PluginGetSettingsResult>;\n getSource(args: PluginGetSourceArgs): Promise<PluginGetSourceResult>;\n install(args: PluginInstallArgs): Promise<PluginInstallResult>;\n list(args?: PluginListArgs): Promise<PluginListResult>;\n listUpdateResults(args?: PluginListUpdateResultsArgs): Promise<PluginCheckUpdatesResult>;\n reload(args?: PluginReloadArgs): Promise<PluginReloadResult>;\n remove(args: PluginIdArgs): Promise<PluginRemoveResult>;\n token(args: PluginTokenArgs): Promise<PluginTokenResult>;\n updateSettings(args: PluginSettingsUpdateArgs): Promise<PluginUpdateSettingsResult>;\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<ChangedMessage, {\n entity: \"thread\";\n}>;\ntype ProjectRealtimeEvent = Extract<ChangedMessage, {\n entity: \"project\";\n}>;\ntype EnvironmentRealtimeEvent = Extract<ChangedMessage, {\n entity: \"environment\";\n}>;\ntype HostRealtimeEvent = Extract<ChangedMessage, {\n entity: \"host\";\n}>;\ntype SystemRealtimeEvent = Extract<ChangedMessage, {\n entity: \"system\";\n}>;\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<TEventName extends BbRealtimeEventName> = (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<TEventName extends BbRealtimeEventName = BbRealtimeEventName> = Extract<BbRealtimeSubscribeArgsUnion, {\n event: TEventName;\n}>;\ninterface BbRealtime {\n subscribe<TEventName extends BbRealtimeEventName>(args: BbRealtimeSubscribeArgs<TEventName>): 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<StatusResult>;\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}\n/**\n * Registry calls proxy out to skills.sh and GitHub, and the browse grid fans\n * out one per card. Callers pass their query's AbortSignal so abandoning a\n * page cancels its requests instead of leaving them in flight.\n */\ninterface AbortableArgs {\n signal?: AbortSignal;\n}\ninterface RegistrySkillsSearchArgs extends AbortableArgs {\n query?: string;\n page?: number;\n perPage?: number;\n}\ninterface RegistrySkillIdArgs extends AbortableArgs {\n registrySkillId: string;\n}\ninterface RegistrySkillSourceArgs extends AbortableArgs {\n source: string;\n skillId: string;\n}\ninterface RegistryRepositoryArgs extends AbortableArgs {\n source: string;\n}\n/**\n * Install is a mutation and deliberately takes no signal: its body is parsed\n * with a strict schema, so an extra key would throw at runtime.\n */\ninterface RegistrySkillInstallArgs {\n registrySkillId: string;\n}\ninterface SkillsRegistryArea {\n detail(args: RegistrySkillSourceArgs): Promise<RegistrySkillDetail>;\n get(args: RegistrySkillIdArgs): Promise<RegistrySkill>;\n install(args: RegistrySkillInstallArgs): Promise<RegistrySkillInstallResponse>;\n repositoryStars(args: RegistryRepositoryArgs): Promise<RegistryRepositoryStars>;\n search(args?: RegistrySkillsSearchArgs): Promise<RegistrySkillsPage>;\n}\ninterface SkillsArea {\n getContent(args: SkillContentArgs): Promise<SkillContentResponse>;\n list(args: SkillListArgs): Promise<SkillListResponse>;\n listFiles(args: SkillIdentityArgs): Promise<SkillFilesResponse>;\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<ThemeGetResult>;\n /** The custom-theme directory plus discovered themes and the active palette. */\n catalog(args?: ThemeCatalogArgs): Promise<ThemeCatalogResult>;\n /** Set the complete app appearance selection in one request. */\n set(selection: ThemeSetInput): Promise<ThemeSetResult>;\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<ThemeSetResult>;\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 SystemInstallCliSkillsArgs = SystemInstallCliSkillsRequest;\ninterface SystemCliSkillsStatusArgs {\n /** Omit for every enrolled machine. */\n hostIds?: readonly string[];\n signal?: AbortSignal;\n}\ntype SystemCliSkillsStatusResult = SystemCliSkillsStatusResponse;\ntype SystemInstallCliSkillsResult = SystemInstallCliSkillsResponse;\ntype SystemVoiceTranscriptionResult = SystemVoiceTranscriptionResponse;\ntype SystemUpdateExperimentsResult = Experiments;\ntype SystemUpdateGeneralSettingsResult = AppSettings;\ntype SystemUpdateKeyboardSettingsResult = AppKeybindingOverrides;\ntype SystemUsageLimitsResult = ProviderUsageResponse;\ninterface SystemOnboardingArgs extends SystemOnboardingReposQuery {\n signal?: AbortSignal;\n}\ntype SystemOnboardingAgentsResult = OnboardingAgentOverview;\ntype SystemOnboardingReposResult = DiscoverReposResult;\ntype SystemVersionResult = SystemVersionResponse;\ninterface SystemArea {\n attention(args?: SystemAttentionArgs): Promise<SystemAttentionResult>;\n config(args?: SystemConfigArgs): Promise<SystemConfigResult>;\n executionOptions(args?: SystemExecutionOptionsArgs): Promise<SystemExecutionOptionsResult>;\n /**\n * Copy bb's built-in CLI skills into each named machine's global agent skill\n * roots (`~/.agents/skills` and `~/.claude/skills`). Machines install\n * independently; the result reports each machine's outcome.\n */\n /** Per-machine install state of bb's built-in CLI skills. */\n cliSkillsStatus(args?: SystemCliSkillsStatusArgs): Promise<SystemCliSkillsStatusResult>;\n installCliSkills(args: SystemInstallCliSkillsArgs): Promise<SystemInstallCliSkillsResult>;\n reloadConfig(): Promise<SystemReloadConfigResult>;\n transcribeVoice(args: SystemVoiceTranscriptionArgs): Promise<SystemVoiceTranscriptionResult>;\n updateExperiments(args: Experiments): Promise<SystemUpdateExperimentsResult>;\n updateGeneralSettings(args: AppSettings): Promise<SystemUpdateGeneralSettingsResult>;\n updateKeyboardSettings(args: AppKeybindingOverrides): Promise<SystemUpdateKeyboardSettingsResult>;\n /** Report one onboarding funnel event to anonymous telemetry. */\n onboardingEvent(args: OnboardingTelemetryEvent): Promise<{\n ok: true;\n }>;\n /** Live agent state for onboarding: install, auth, and plan per provider. */\n onboardingAgents(args?: SystemOnboardingArgs): Promise<SystemOnboardingAgentsResult>;\n /** Candidate projects discovered on the host, ranked for onboarding. */\n onboardingRepos(args?: SystemOnboardingArgs): Promise<SystemOnboardingReposResult>;\n usageLimits(args?: SystemUsageLimitsArgs): Promise<SystemUsageLimitsResult>;\n version(args?: SystemVersionArgs): Promise<SystemVersionResult>;\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<TerminalCloseResult>;\n create(args: TerminalCreateArgs): Promise<TerminalCreateResult>;\n get(args: TerminalGetArgs): Promise<TerminalGetResult>;\n input(args: TerminalInputArgs): Promise<TerminalInputResult>;\n list(args: TerminalListArgs): Promise<TerminalListResult>;\n output(args: TerminalOutputArgs): Promise<TerminalOutputResult>;\n rename(args: TerminalRenameArgs): Promise<TerminalRenameResult>;\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<TerminalRestartResult>;\n resize(args: TerminalResizeArgs): Promise<TerminalResizeResult>;\n}\n\ninterface ThreadListArgs {\n archived?: boolean;\n sectionId?: string;\n hasParent?: boolean;\n includeHidden?: boolean;\n limit?: number;\n offset?: number;\n originKind?: ThreadListQuery[\"originKind\"];\n originPluginId?: string;\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<CreateThreadRequest, \"childOrigin\" | \"input\" | \"origin\" | \"originKind\" | \"startedOnBehalfOf\"> {\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<ForkThreadRequest, \"origin\" | \"visibility\" | \"workspace\"> {\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$1;\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<ThreadEventWaitResult>;\n matched: true;\n target: Extract<ThreadWaitTarget, {\n kind: \"event\";\n }>;\n threadId: string;\n} | {\n matched: true;\n target: Extract<ThreadWaitTarget, {\n kind: \"status\";\n }>;\n thread: ThreadGetResult;\n threadId: string;\n};\ninterface ThreadInteractionsArea {\n cancel(args: ThreadInteractionTargetArgs): Promise<ThreadInteractionCancelResult>;\n get(args: ThreadInteractionGetArgs): Promise<ThreadInteractionGetResult>;\n list(args: ThreadInteractionListArgs): Promise<ThreadInteractionListResult>;\n resolve(args: ThreadInteractionResolveArgs): Promise<ThreadInteractionResolveResult>;\n respond(args: ThreadInteractionRespondArgs): Promise<ThreadInteractionRespondResult>;\n}\ninterface ThreadEventsArea {\n list(args: ThreadEventsListArgs): Promise<ThreadEventsListResult>;\n wait(args: ThreadEventWaitArgs): Promise<ThreadEventWaitResult>;\n}\ninterface ThreadQueuedMessagesArea {\n create(args: ThreadQueuedMessageCreateArgs): Promise<ThreadQueuedMessageCreateResult>;\n delete(args: ThreadQueuedMessageTargetArgs): Promise<ThreadQueuedMessageDeleteResult>;\n list(args: ThreadQueuedMessageArgs): Promise<ThreadQueuedMessagesResult>;\n reorder(args: ThreadQueuedMessageReorderArgs): Promise<ThreadQueuedMessageReorderResult>;\n send(args: ThreadQueuedMessageSendArgs): Promise<ThreadQueuedMessageSendResult>;\n setGroupBoundary(args: ThreadQueuedMessageGroupBoundaryArgs): Promise<ThreadQueuedMessageGroupBoundaryResult>;\n update(args: ThreadQueuedMessageUpdateArgs): Promise<ThreadQueuedMessageUpdateResult>;\n}\ninterface ThreadTabsArea {\n get(args: ThreadStatusArgs): Promise<ThreadTabsResult>;\n update(args: ThreadTabsUpdateArgs): Promise<ThreadTabsUpdateResult>;\n}\ninterface ThreadsArea {\n archive(args: ThreadActionArgs): Promise<ThreadArchiveResult>;\n archiveAll(args: ThreadActionArgs): Promise<ThreadArchiveAllResult>;\n childSummary(args: ThreadStatusArgs): Promise<ThreadChildSummaryResult>;\n cancelPlan(args: ThreadActionArgs): Promise<ThreadBannerActionResult>;\n clearGoal(args: ThreadActionArgs): Promise<ThreadBannerActionResult>;\n conversationOutline(args: ThreadStatusArgs): Promise<ThreadConversationOutlineResult>;\n defaultExecutionOptions(args: ThreadStatusArgs): Promise<ThreadDefaultExecutionOptionsResult>;\n delete(args: ThreadDeleteArgs): Promise<ThreadDeleteResult>;\n events: ThreadEventsArea;\n fork(args: ThreadForkArgs): Promise<ThreadForkResult>;\n get(args: ThreadGetArgs): Promise<ThreadGetResult>;\n interactions: ThreadInteractionsArea;\n list(args?: ThreadListArgs): Promise<ThreadListResult>;\n markRead(args: ThreadActionArgs): Promise<ThreadReadStateResult>;\n markUnread(args: ThreadActionArgs): Promise<ThreadReadStateResult>;\n open(args: ThreadOpenArgs): Promise<ThreadOpenResult>;\n paneAction(args: ThreadPaneActionArgs): Promise<ThreadPaneActionResult>;\n output(args: ThreadOutputArgs): Promise<ThreadOutputResponse>;\n pin(args: ThreadActionArgs): Promise<ThreadMutationResult>;\n promptHistory(args: ThreadPromptHistoryArgs): Promise<ThreadPromptHistoryResult>;\n queuedMessages: ThreadQueuedMessagesArea;\n reorderPinned(args: ThreadPinOrderArgs): Promise<ThreadPinOrderResult>;\n search(args: ThreadSearchArgs): Promise<ThreadSearchResult>;\n send(args: ThreadSendArgs): Promise<ThreadSendResult>;\n spawn(args: ThreadSpawnArgs): Promise<ThreadSpawnResult>;\n stop(args: ThreadActionArgs): Promise<ThreadStopResult>;\n tabs: ThreadTabsArea;\n timeline(args: ThreadTimelineArgs): Promise<ThreadTimelineResult>;\n timelineTurnSummaryDetails(args: ThreadTimelineTurnSummaryDetailsArgs): Promise<ThreadTimelineTurnSummaryDetailsResult>;\n storageFiles(args: ThreadStorageFilesArgs): Promise<ThreadStorageFilesResult>;\n storagePaths(args: ThreadStoragePathsArgs): Promise<ThreadStoragePathsResult>;\n unarchive(args: ThreadActionArgs): Promise<ThreadUnarchiveResult>;\n unpin(args: ThreadActionArgs): Promise<ThreadMutationResult>;\n update(args: ThreadUpdateArgs): Promise<ThreadMutationResult>;\n wait(args: ThreadWaitArgs): Promise<ThreadWaitResult>;\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<ThreadSectionCreateResult>;\n delete(args: DeleteThreadSectionRequest): Promise<ThreadSectionDeleteResult>;\n list(args?: ThreadSectionListArgs): Promise<ThreadSectionListResult>;\n update(args: UpdateThreadSectionRequest): Promise<ThreadSectionUpdateResult>;\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 <dataDir>/plugins/<id>/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<string, PluginSettingDescriptor>;\ntype PluginSettingValue = string | boolean;\n/** `default` present → non-optional value; absent → `T | undefined`. */\ntype PluginSettingsValues<Ds extends Record<string, PluginSettingDescriptor>> = {\n [K in keyof Ds]: Ds[K] extends {\n default: string | boolean;\n } ? PluginSettingValueOf<Ds[K]> : PluginSettingValueOf<Ds[K]> | undefined;\n};\ntype PluginSettingValueOf<D extends PluginSettingDescriptor> = D extends {\n type: \"boolean\";\n} ? boolean : string;\ninterface PluginSettingsHandle<Ds extends Record<string, PluginSettingDescriptor>> {\n /** Load-safe: callable inside the factory. */\n get(): Promise<PluginSettingsValues<Ds>>;\n /** Fires after values change through the settings route/CLI. */\n onChange(listener: (next: PluginSettingsValues<Ds>, prev: PluginSettingsValues<Ds>) => void): void;\n}\ninterface PluginSettings {\n define<Ds extends Record<string, PluginSettingDescriptor>>(descriptors: Ds): PluginSettingsHandle<Ds>;\n}\ninterface PluginKvStorage {\n get<T>(key: string): Promise<T | undefined>;\n set(key: string, value: unknown): Promise<void>;\n delete(key: string): Promise<void>;\n list(prefix?: string): Promise<string[]>;\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 * <dataDir>/plugins/<id>/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<E extends PluginThreadEventName> = (payload: PluginThreadEventPayloads[E]) => void | Promise<void>;\ntype PluginHttpAuthMode = \"local\" | \"token\" | \"none\";\ntype PluginHttpHandler = (context: Context) => Response | Promise<Response>;\ninterface PluginHttp {\n /**\n * Register an HTTP route, mounted at\n * `/api/v1/plugins/<id>/http/<path>`. 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 <id>`) 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/<id>/rpc/<method>` 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 extends PluginRpcContract>(contract: Contract, handlers: PluginRpcHandlers<Contract>): 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<void>;\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>): 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;\n} | {\n outcome: \"cancelled\";\n reason: PluginInteractionCancelReason;\n};\ninterface PluginInteractionRequest {\n threadId: string;\n rendererId: string;\n title: string;\n payload: JsonValue;\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 <name> …`): 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<PluginCliResult>;\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}\n/**\n * Native timeline labels for a plugin tool, keyed by BB's own timeline row\n * status. This is experimental: BB may refine its presentation contract\n * before the field is stabilized.\n */\ninterface PluginAgentToolExperimentalStatusLabels {\n /** Label shown while the tool call is pending. */\n pending: string;\n /** Label shown after the tool call completes successfully. */\n completed: string;\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 * Optional native timeline labels. When omitted, BB shows the standard\n * tool name and arguments (for example, `Ran tool search_docs …`). Labels\n * apply only while the call is pending and after successful completion;\n * approval, error, and interruption states keep BB's standard rendering.\n */\n experimental_statusLabels?: PluginAgentToolExperimentalStatusLabels;\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 /** How the thread was spawned. A side chat is the builtin side-chat\n * plugin's fork: `{ kind: \"fork\", pluginId: \"side-chat\" }`. */\n origin: {\n kind: \"fork\" | 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<string, unknown>;\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<string | PluginAgentToolSelection>;\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 chats\n * are ordinary plugin-owned forks here — read `origin` to detect them — and\n * their returned tool, skill, and dynamic-instruction selections apply at the\n * same boundaries.\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<Schema extends z.ZodType>(tool: PluginAgentToolRegistrationBase & {\n parameters: Schema;\n execute(params: z.output<Schema>, ctx: PluginAgentToolContext): PluginAgentToolResult | Promise<PluginAgentToolResult>;\n }): void;\n registerTool(tool: PluginAgentToolRegistrationBase & {\n /** Raw JSON-schema escape hatch; params arrive unvalidated. */\n parameters: Record<string, unknown>;\n execute(params: unknown, ctx: PluginAgentToolContext): PluginAgentToolResult | Promise<PluginAgentToolResult>;\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 */\n contributeInstructions(provider: (ctx: {\n threadId: string;\n projectId: string;\n }) => string | null): void;\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 \"<providerId>:<itemId>\"). */\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<PluginMentionItem[]>;\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<PluginInteractionResult>;\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<E extends PluginThreadEventName>(event: E, handler: PluginThreadEventHandler<E>): 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<PluginSharedPortTunnelIdentity>;\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 <id>` 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/<id>/http/* (design §4.6). */\n readonly http: PluginHttp;\n /** RPC methods under /api/v1/plugins/<id>/rpc/<method> (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>): void;\n}\n\nexport { PLUGIN_CLI_OUTPUT_MAX_BYTES, defineRpcContract };\nexport type { BbContext, BbNavigate, BbPluginApi, ComposerCustomization, ComposerPlusMenuItem, ComposerRichTextSpec, ComposerStructuredDraft, ComposerView, JsonValue, MarkdownProps, NewThreadComposerProps, NewThreadRequest, PluginAgentConfiguration, PluginAgentConfigurationContext, PluginAgentToolContentPart, PluginAgentToolContext, PluginAgentToolExperimentalStatusLabels, 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, PluginSidebarProject, PluginSidebarPullRequest, PluginSidebarSplitPane, PluginSidebarThread, PluginSidebarThreadActions, PluginSidebarThreadActivity, PluginSidebarThreadIndicator, PluginSidebarThreadPullRequestState, PluginSidebarThreadSplit, PluginSidebarThreadsState, PluginSidebarWorkspaceKind, PluginStatusApi, PluginStorage, PluginThreadEventHandler, PluginThreadEventName, PluginThreadEventPayloads, PluginThreadHeaderActionProps, PluginThreadHeaderActionRegistration, PluginThreadListProps, PluginThreadListRegistration, 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/get-bb/bb\n\nimport * as react from 'react';\nimport { ComponentType, ReactNode } from 'react';\nimport * as z from 'zod';\nimport { z as z$1 } from 'zod';\nimport Database from 'better-sqlite3';\nimport { Context } from 'hono';\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 steerActiveThreadOnEnter: 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 onboardingCompletedAt: z$1.ZodNullable<z$1.ZodString>;\n}, z$1.core.$strict>;\ntype AppSettings = z$1.infer<typeof appSettingsSchema>;\n\ndeclare const appKeybindingOverridesSchema: z$1.ZodArray<z$1.ZodObject<{\n command: z$1.ZodEnum<{\n \"thread.jump.1\": \"thread.jump.1\";\n \"thread.jump.2\": \"thread.jump.2\";\n \"thread.jump.3\": \"thread.jump.3\";\n \"thread.jump.4\": \"thread.jump.4\";\n \"thread.jump.5\": \"thread.jump.5\";\n \"thread.jump.6\": \"thread.jump.6\";\n \"thread.jump.7\": \"thread.jump.7\";\n \"thread.jump.8\": \"thread.jump.8\";\n \"thread.jump.9\": \"thread.jump.9\";\n \"question.select.1\": \"question.select.1\";\n \"question.select.2\": \"question.select.2\";\n \"question.select.3\": \"question.select.3\";\n \"question.select.4\": \"question.select.4\";\n \"question.select.5\": \"question.select.5\";\n \"question.select.6\": \"question.select.6\";\n \"question.select.7\": \"question.select.7\";\n \"question.select.8\": \"question.select.8\";\n \"question.select.9\": \"question.select.9\";\n \"pane.focus.1\": \"pane.focus.1\";\n \"pane.focus.2\": \"pane.focus.2\";\n \"pane.focus.3\": \"pane.focus.3\";\n \"pane.focus.4\": \"pane.focus.4\";\n \"pane.focus.5\": \"pane.focus.5\";\n \"pane.focus.6\": \"pane.focus.6\";\n \"pane.focus.7\": \"pane.focus.7\";\n \"pane.focus.8\": \"pane.focus.8\";\n \"thread.new\": \"thread.new\";\n \"thread.search\": \"thread.search\";\n \"thread.previous\": \"thread.previous\";\n \"thread.next\": \"thread.next\";\n \"pane.focus.previous\": \"pane.focus.previous\";\n \"pane.focus.next\": \"pane.focus.next\";\n \"pane.maximize.toggle\": \"pane.maximize.toggle\";\n \"pane.close\": \"pane.close\";\n \"window.new\": \"window.new\";\n \"settings.open\": \"settings.open\";\n \"settings.openServers\": \"settings.openServers\";\n \"sidebar.toggle\": \"sidebar.toggle\";\n \"panel.newTab\": \"panel.newTab\";\n \"panel.close\": \"panel.close\";\n \"panel.toggle\": \"panel.toggle\";\n \"file.quickOpen\": \"file.quickOpen\";\n \"diff.toggle\": \"diff.toggle\";\n \"terminal.open\": \"terminal.open\";\n \"composer.focus\": \"composer.focus\";\n \"modelPicker.toggle\": \"modelPicker.toggle\";\n \"modelPicker.cycleModel\": \"modelPicker.cycleModel\";\n \"modelPicker.cycleReasoning\": \"modelPicker.cycleReasoning\";\n \"browser.focusLocation\": \"browser.focusLocation\";\n \"browser.reload\": \"browser.reload\";\n \"workspace.openPreferred\": \"workspace.openPreferred\";\n }>;\n shortcut: z$1.ZodNullable<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}, z$1.core.$strict>>;\ntype AppKeybindingOverrides = z$1.infer<typeof appKeybindingOverridesSchema>;\n\ndeclare const appThemeSchema: z$1.ZodObject<{\n themeId: z$1.ZodString;\n customCss: z$1.ZodNullable<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 AppTheme = z$1.infer<typeof appThemeSchema>;\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<typeof appThemeSelectionSchema>;\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<z$1.ZodString>;\n metadata: z$1.ZodOptional<z$1.ZodObject<{\n backgroundActivityChanged: z$1.ZodOptional<z$1.ZodBoolean>;\n eventTypes: z$1.ZodOptional<z$1.ZodReadonly<z$1.ZodArray<z$1.ZodString & z$1.ZodType<\"thread/started\" | \"thread/identity\" | \"turn/started\" | \"turn/completed\" | \"turn/input/accepted\" | \"thread/name/updated\" | \"thread/compacted\" | \"thread/goal/updated\" | \"thread/goal/cleared\" | \"item/started\" | \"item/completed\" | \"item/agentMessage/delta\" | \"item/commandExecution/outputDelta\" | \"item/fileChange/outputDelta\" | \"item/reasoning/summaryTextDelta\" | \"item/reasoning/textDelta\" | \"item/plan/delta\" | \"item/mcpToolCall/progress\" | \"item/toolCall/progress\" | \"item/backgroundTask/progress\" | \"item/backgroundTask/completed\" | \"thread/tokenUsage/updated\" | \"thread/contextWindowUsage/updated\" | \"turn/plan/updated\" | \"turn/diff/updated\" | \"provider/error\" | \"provider/warning\" | \"provider/modelFallback\" | \"provider/unhandled\" | \"client/thread/start\" | \"client/turn/requested\" | \"client/turn/start\" | \"system/error\" | \"system/manager/user_message\" | \"system/thread/interrupted\" | \"system/operation\" | \"system/permissionGrant/lifecycle\" | \"system/userQuestion/lifecycle\" | \"system/thread-provisioning\" | \"system/provider-turn-watchdog\", string, z$1.core.$ZodTypeInternals<\"thread/started\" | \"thread/identity\" | \"turn/started\" | \"turn/completed\" | \"turn/input/accepted\" | \"thread/name/updated\" | \"thread/compacted\" | \"thread/goal/updated\" | \"thread/goal/cleared\" | \"item/started\" | \"item/completed\" | \"item/agentMessage/delta\" | \"item/commandExecution/outputDelta\" | \"item/fileChange/outputDelta\" | \"item/reasoning/summaryTextDelta\" | \"item/reasoning/textDelta\" | \"item/plan/delta\" | \"item/mcpToolCall/progress\" | \"item/toolCall/progress\" | \"item/backgroundTask/progress\" | \"item/backgroundTask/completed\" | \"thread/tokenUsage/updated\" | \"thread/contextWindowUsage/updated\" | \"turn/plan/updated\" | \"turn/diff/updated\" | \"provider/error\" | \"provider/warning\" | \"provider/modelFallback\" | \"provider/unhandled\" | \"client/thread/start\" | \"client/turn/requested\" | \"client/turn/start\" | \"system/error\" | \"system/manager/user_message\" | \"system/thread/interrupted\" | \"system/operation\" | \"system/permissionGrant/lifecycle\" | \"system/userQuestion/lifecycle\" | \"system/thread-provisioning\" | \"system/provider-turn-watchdog\", string>>>>>;\n hasPendingInteraction: z$1.ZodOptional<z$1.ZodBoolean>;\n projectId: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strict>>;\n changes: z$1.ZodReadonly<z$1.ZodArray<z$1.ZodEnum<{\n \"thread-created\": \"thread-created\";\n \"thread-deleted\": \"thread-deleted\";\n \"events-appended\": \"events-appended\";\n \"interactions-changed\": \"interactions-changed\";\n \"status-changed\": \"status-changed\";\n \"title-changed\": \"title-changed\";\n \"queue-changed\": \"queue-changed\";\n \"archived-changed\": \"archived-changed\";\n \"pin-state-changed\": \"pin-state-changed\";\n \"parent-changed\": \"parent-changed\";\n \"environment-changed\": \"environment-changed\";\n \"read-state-changed\": \"read-state-changed\";\n \"order-changed\": \"order-changed\";\n \"tabs-changed\": \"tabs-changed\";\n \"terminals-changed\": \"terminals-changed\";\n }>>>;\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<z$1.ZodString>;\n changes: z$1.ZodReadonly<z$1.ZodArray<z$1.ZodEnum<{\n \"project-created\": \"project-created\";\n \"project-updated\": \"project-updated\";\n \"project-deleted\": \"project-deleted\";\n \"project-sources-changed\": \"project-sources-changed\";\n \"threads-changed\": \"threads-changed\";\n \"project-order-changed\": \"project-order-changed\";\n }>>>;\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<z$1.ZodString>;\n changes: z$1.ZodReadonly<z$1.ZodArray<z$1.ZodEnum<{\n \"status-changed\": \"status-changed\";\n \"environment-created\": \"environment-created\";\n \"environment-deleted\": \"environment-deleted\";\n \"metadata-changed\": \"metadata-changed\";\n \"work-status-changed\": \"work-status-changed\";\n \"git-refs-changed\": \"git-refs-changed\";\n \"thread-storage-changed\": \"thread-storage-changed\";\n }>>>;\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<z$1.ZodString>;\n changes: z$1.ZodReadonly<z$1.ZodArray<z$1.ZodEnum<{\n \"host-connected\": \"host-connected\";\n \"host-disconnected\": \"host-disconnected\";\n }>>>;\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<z$1.ZodArray<z$1.ZodEnum<{\n \"config-changed\": \"config-changed\";\n \"plugins-changed\": \"plugins-changed\";\n }>>>;\n}, z$1.core.$strict>], \"entity\">;\ntype ChangedMessage = z$1.infer<typeof changedMessageSchema>;\n\ndeclare const environmentSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n name: z$1.ZodNullable<z$1.ZodString>;\n projectId: z$1.ZodString;\n hostId: z$1.ZodString;\n path: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n baseBranch: z$1.ZodNullable<z$1.ZodString>;\n defaultBranch: z$1.ZodNullable<z$1.ZodString>;\n mergeBaseBranch: z$1.ZodNullable<z$1.ZodString>;\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<typeof environmentSchema>;\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 newOnboarding: z$1.ZodBoolean;\n toolsHub: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype Experiments = z$1.infer<typeof experimentsSchema>;\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 maxPermissionMode: z$1.ZodEnum<{\n full: \"full\";\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n }>;\n lastSeenAt: z$1.ZodNullable<z$1.ZodNumber>;\n lastRejectedProtocolVersion: z$1.ZodNullable<z$1.ZodNumber>;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype Host = z$1.infer<typeof hostSchema>;\n\ninterface JsonObject {\n [key: string]: JsonValue$1;\n}\ntype JsonValue$1 = string | number | boolean | null | JsonValue$1[] | JsonObject;\n\ndeclare const pendingInteractionResolutionSchema: z$1.ZodUnion<readonly [z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"allow_once\">;\n grantedPermissions: z$1.ZodNullable<z$1.ZodObject<{\n network: z$1.ZodNullable<z$1.ZodObject<{\n enabled: z$1.ZodNullable<z$1.ZodBoolean>;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable<z$1.ZodObject<{\n read: z$1.ZodArray<z$1.ZodString>;\n write: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodObject<{\n network: z$1.ZodNullable<z$1.ZodObject<{\n enabled: z$1.ZodNullable<z$1.ZodBoolean>;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable<z$1.ZodObject<{\n read: z$1.ZodArray<z$1.ZodString>;\n write: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodString, z$1.ZodObject<{\n selected: z$1.ZodArray<z$1.ZodString>;\n freeText: z$1.ZodOptional<z$1.ZodString>;\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<typeof pendingInteractionResolutionSchema>;\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<z$1.ZodString>;\n createdAt: z$1.ZodNumber;\n expiresAt: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;\n resolvedAt: z$1.ZodNullable<z$1.ZodNumber>;\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<z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"provider\">;\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<readonly [z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"approval\">;\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<z$1.ZodString>;\n actions: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"read\">;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"search\">;\n command: z$1.ZodString;\n query: z$1.ZodNullable<z$1.ZodString>;\n path: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodObject<{\n network: z$1.ZodNullable<z$1.ZodObject<{\n enabled: z$1.ZodNullable<z$1.ZodBoolean>;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable<z$1.ZodObject<{\n read: z$1.ZodArray<z$1.ZodString>;\n write: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodString>;\n sessionGrant: z$1.ZodNullable<z$1.ZodObject<{\n network: z$1.ZodNullable<z$1.ZodObject<{\n enabled: z$1.ZodNullable<z$1.ZodBoolean>;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable<z$1.ZodObject<{\n read: z$1.ZodArray<z$1.ZodString>;\n write: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodString>;\n permissions: z$1.ZodObject<{\n network: z$1.ZodNullable<z$1.ZodObject<{\n enabled: z$1.ZodNullable<z$1.ZodBoolean>;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable<z$1.ZodObject<{\n read: z$1.ZodArray<z$1.ZodString>;\n write: z$1.ZodArray<z$1.ZodString>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>;\n }, z$1.core.$strip>], \"kind\">;\n reason: z$1.ZodNullable<z$1.ZodString>;\n availableDecisions: z$1.ZodArray<z$1.ZodEnum<{\n allow_once: \"allow_once\";\n allow_for_session: \"allow_for_session\";\n deny: \"deny\";\n }>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"user_question\">;\n questions: z$1.ZodArray<z$1.ZodObject<{\n id: z$1.ZodString;\n prompt: z$1.ZodString;\n shortLabel: z$1.ZodOptional<z$1.ZodString>;\n multiSelect: z$1.ZodBoolean;\n options: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{\n value: z$1.ZodString;\n label: z$1.ZodString;\n description: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodUnion<readonly [z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"allow_once\">;\n grantedPermissions: z$1.ZodNullable<z$1.ZodObject<{\n network: z$1.ZodNullable<z$1.ZodObject<{\n enabled: z$1.ZodNullable<z$1.ZodBoolean>;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable<z$1.ZodObject<{\n read: z$1.ZodArray<z$1.ZodString>;\n write: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodObject<{\n network: z$1.ZodNullable<z$1.ZodObject<{\n enabled: z$1.ZodNullable<z$1.ZodBoolean>;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable<z$1.ZodObject<{\n read: z$1.ZodArray<z$1.ZodString>;\n write: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodString, z$1.ZodObject<{\n selected: z$1.ZodArray<z$1.ZodString>;\n freeText: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>]>>;\n}, z$1.core.$strip>;\ntype ProviderPendingInteraction = z$1.infer<typeof providerPendingInteractionSchema>;\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<z$1.ZodString>;\n createdAt: z$1.ZodNumber;\n expiresAt: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;\n resolvedAt: z$1.ZodNullable<z$1.ZodNumber>;\n turnId: z$1.ZodNullable<z$1.ZodString>;\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<JsonValue$1, unknown, z$1.core.$ZodTypeInternals<JsonValue$1, unknown>>;\n }, z$1.core.$strip>;\n resolution: z$1.ZodNullable<z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin_submitted\">;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype PluginPendingInteraction = z$1.infer<typeof pluginPendingInteractionSchema>;\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<typeof projectSourceSchema>;\n\ndeclare const reasoningLevelSchema: 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}>;\ntype ReasoningLevel = z$1.infer<typeof reasoningLevelSchema>;\ndeclare const serviceTierSchema: z$1.ZodEnum<{\n default: \"default\";\n fast: \"fast\";\n}>;\ntype ServiceTier = z$1.infer<typeof serviceTierSchema>;\ndeclare const permissionModeSchema: z$1.ZodEnum<{\n full: \"full\";\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n}>;\ntype PermissionMode = z$1.infer<typeof permissionModeSchema>;\ndeclare const promptInputSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{\n start: z$1.ZodNumber;\n end: z$1.ZodNumber;\n resource: z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\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<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n}, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n}, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional<z$1.ZodString>;\n sizeBytes: z$1.ZodOptional<z$1.ZodNumber>;\n mimeType: z$1.ZodOptional<z$1.ZodString>;\n}, z$1.core.$strip>], \"type\">;\ntype PromptInput = z$1.infer<typeof promptInputSchema>;\ndeclare const resolvedThreadExecutionOptionsSchema: z$1.ZodObject<{\n seq: z$1.ZodOptional<z$1.ZodNumber>;\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<typeof resolvedThreadExecutionOptionsSchema>;\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<typeof projectExecutionDefaultsSchema>;\n\n/** All thread events — provider-originated or system-originated. */\ndeclare const threadEventSchema: z$1.ZodPipe<z$1.ZodUnknown, z$1.ZodUnion<readonly [z$1.ZodIntersection<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"thread/started\">;\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<z$1.ZodString>;\n historical: z$1.ZodOptional<z$1.ZodBoolean>;\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<z$1.ZodString>;\n status: z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n }>;\n error: z$1.ZodOptional<z$1.ZodObject<{\n message: z$1.ZodString;\n }, z$1.core.$strip>>;\n historical: z$1.ZodOptional<z$1.ZodBoolean>;\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<z$1.ZodNumber>;\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<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"text\">;\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<z$1.ZodString>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodEnum<{\n waiting_for_approval: \"waiting_for_approval\";\n denied: \"denied\";\n }>>;\n aggregatedOutput: z$1.ZodOptional<z$1.ZodString>;\n exitCode: z$1.ZodOptional<z$1.ZodNumber>;\n durationMs: z$1.ZodOptional<z$1.ZodNumber>;\n truncation: z$1.ZodOptional<z$1.ZodObject<{\n aggregatedOutput: z$1.ZodOptional<z$1.ZodObject<{\n originalLength: z$1.ZodNumber;\n retainedHeadLength: z$1.ZodNumber;\n retainedTailLength: z$1.ZodNumber;\n truncatedAt: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n result: z$1.ZodOptional<z$1.ZodObject<{\n originalLength: z$1.ZodNumber;\n retainedHeadLength: z$1.ZodNumber;\n retainedTailLength: z$1.ZodNumber;\n truncatedAt: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n resultText: z$1.ZodOptional<z$1.ZodObject<{\n originalLength: z$1.ZodNumber;\n retainedHeadLength: z$1.ZodNumber;\n retainedTailLength: z$1.ZodNumber;\n truncatedAt: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"fileChange\">;\n id: z$1.ZodString;\n changes: z$1.ZodArray<z$1.ZodObject<{\n path: z$1.ZodString;\n kind: z$1.ZodEnum<{\n add: \"add\";\n delete: \"delete\";\n update: \"update\";\n }>;\n movePath: z$1.ZodOptional<z$1.ZodString>;\n diff: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodEnum<{\n waiting_for_approval: \"waiting_for_approval\";\n denied: \"denied\";\n }>>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"webSearch\">;\n id: z$1.ZodString;\n queries: z$1.ZodArray<z$1.ZodString>;\n resultText: z$1.ZodNullable<z$1.ZodString>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n pattern: z$1.ZodNullable<z$1.ZodString>;\n resultText: z$1.ZodNullable<z$1.ZodString>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"toolCall\">;\n id: z$1.ZodString;\n server: z$1.ZodOptional<z$1.ZodString>;\n tool: z$1.ZodString;\n arguments: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;\n statusLabels: z$1.ZodOptional<z$1.ZodObject<{\n pending: z$1.ZodString;\n completed: z$1.ZodString;\n }, z$1.core.$strip>>;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n }>;\n result: z$1.ZodOptional<z$1.ZodUnknown>;\n error: z$1.ZodOptional<z$1.ZodString>;\n durationMs: z$1.ZodOptional<z$1.ZodNumber>;\n truncation: z$1.ZodOptional<z$1.ZodObject<{\n aggregatedOutput: z$1.ZodOptional<z$1.ZodObject<{\n originalLength: z$1.ZodNumber;\n retainedHeadLength: z$1.ZodNumber;\n retainedTailLength: z$1.ZodNumber;\n truncatedAt: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n result: z$1.ZodOptional<z$1.ZodObject<{\n originalLength: z$1.ZodNumber;\n retainedHeadLength: z$1.ZodNumber;\n retainedTailLength: z$1.ZodNumber;\n truncatedAt: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n resultText: z$1.ZodOptional<z$1.ZodObject<{\n originalLength: z$1.ZodNumber;\n retainedHeadLength: z$1.ZodNumber;\n retainedTailLength: z$1.ZodNumber;\n truncatedAt: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"reasoning\">;\n id: z$1.ZodString;\n summary: z$1.ZodArray<z$1.ZodString>;\n content: z$1.ZodArray<z$1.ZodString>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"contextCompaction\">;\n id: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n workflow: z$1.ZodOptional<z$1.ZodObject<{\n phases: z$1.ZodArray<z$1.ZodObject<{\n index: z$1.ZodNumber;\n title: z$1.ZodString;\n kind: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>>;\n agents: z$1.ZodArray<z$1.ZodObject<{\n index: z$1.ZodNumber;\n label: z$1.ZodString;\n state: z$1.ZodEnum<{\n running: \"running\";\n failed: \"failed\";\n queued: \"queued\";\n done: \"done\";\n skipped: \"skipped\";\n }>;\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<z$1.ZodNumber>;\n phaseTitle: z$1.ZodOptional<z$1.ZodString>;\n agentType: z$1.ZodOptional<z$1.ZodString>;\n isolation: z$1.ZodOptional<z$1.ZodString>;\n queuedAt: z$1.ZodOptional<z$1.ZodNumber>;\n startedAt: z$1.ZodOptional<z$1.ZodNumber>;\n lastToolName: z$1.ZodOptional<z$1.ZodString>;\n lastToolSummary: z$1.ZodOptional<z$1.ZodString>;\n promptPreview: z$1.ZodOptional<z$1.ZodString>;\n resultPreview: z$1.ZodOptional<z$1.ZodString>;\n error: z$1.ZodOptional<z$1.ZodString>;\n tokens: z$1.ZodOptional<z$1.ZodNumber>;\n toolCalls: z$1.ZodOptional<z$1.ZodNumber>;\n durationMs: z$1.ZodOptional<z$1.ZodNumber>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n usage: z$1.ZodOptional<z$1.ZodObject<{\n totalTokens: z$1.ZodNumber;\n toolUses: z$1.ZodNumber;\n durationMs: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n summary: z$1.ZodOptional<z$1.ZodString>;\n error: z$1.ZodOptional<z$1.ZodString>;\n outputFile: z$1.ZodOptional<z$1.ZodString>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"text\">;\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<z$1.ZodString>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodEnum<{\n waiting_for_approval: \"waiting_for_approval\";\n denied: \"denied\";\n }>>;\n aggregatedOutput: z$1.ZodOptional<z$1.ZodString>;\n exitCode: z$1.ZodOptional<z$1.ZodNumber>;\n durationMs: z$1.ZodOptional<z$1.ZodNumber>;\n truncation: z$1.ZodOptional<z$1.ZodObject<{\n aggregatedOutput: z$1.ZodOptional<z$1.ZodObject<{\n originalLength: z$1.ZodNumber;\n retainedHeadLength: z$1.ZodNumber;\n retainedTailLength: z$1.ZodNumber;\n truncatedAt: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n result: z$1.ZodOptional<z$1.ZodObject<{\n originalLength: z$1.ZodNumber;\n retainedHeadLength: z$1.ZodNumber;\n retainedTailLength: z$1.ZodNumber;\n truncatedAt: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n resultText: z$1.ZodOptional<z$1.ZodObject<{\n originalLength: z$1.ZodNumber;\n retainedHeadLength: z$1.ZodNumber;\n retainedTailLength: z$1.ZodNumber;\n truncatedAt: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"fileChange\">;\n id: z$1.ZodString;\n changes: z$1.ZodArray<z$1.ZodObject<{\n path: z$1.ZodString;\n kind: z$1.ZodEnum<{\n add: \"add\";\n delete: \"delete\";\n update: \"update\";\n }>;\n movePath: z$1.ZodOptional<z$1.ZodString>;\n diff: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodEnum<{\n waiting_for_approval: \"waiting_for_approval\";\n denied: \"denied\";\n }>>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"webSearch\">;\n id: z$1.ZodString;\n queries: z$1.ZodArray<z$1.ZodString>;\n resultText: z$1.ZodNullable<z$1.ZodString>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n pattern: z$1.ZodNullable<z$1.ZodString>;\n resultText: z$1.ZodNullable<z$1.ZodString>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"toolCall\">;\n id: z$1.ZodString;\n server: z$1.ZodOptional<z$1.ZodString>;\n tool: z$1.ZodString;\n arguments: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;\n statusLabels: z$1.ZodOptional<z$1.ZodObject<{\n pending: z$1.ZodString;\n completed: z$1.ZodString;\n }, z$1.core.$strip>>;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n failed: \"failed\";\n interrupted: \"interrupted\";\n }>;\n result: z$1.ZodOptional<z$1.ZodUnknown>;\n error: z$1.ZodOptional<z$1.ZodString>;\n durationMs: z$1.ZodOptional<z$1.ZodNumber>;\n truncation: z$1.ZodOptional<z$1.ZodObject<{\n aggregatedOutput: z$1.ZodOptional<z$1.ZodObject<{\n originalLength: z$1.ZodNumber;\n retainedHeadLength: z$1.ZodNumber;\n retainedTailLength: z$1.ZodNumber;\n truncatedAt: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n result: z$1.ZodOptional<z$1.ZodObject<{\n originalLength: z$1.ZodNumber;\n retainedHeadLength: z$1.ZodNumber;\n retainedTailLength: z$1.ZodNumber;\n truncatedAt: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n resultText: z$1.ZodOptional<z$1.ZodObject<{\n originalLength: z$1.ZodNumber;\n retainedHeadLength: z$1.ZodNumber;\n retainedTailLength: z$1.ZodNumber;\n truncatedAt: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"reasoning\">;\n id: z$1.ZodString;\n summary: z$1.ZodArray<z$1.ZodString>;\n content: z$1.ZodArray<z$1.ZodString>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"contextCompaction\">;\n id: z$1.ZodString;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n workflow: z$1.ZodOptional<z$1.ZodObject<{\n phases: z$1.ZodArray<z$1.ZodObject<{\n index: z$1.ZodNumber;\n title: z$1.ZodString;\n kind: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>>;\n agents: z$1.ZodArray<z$1.ZodObject<{\n index: z$1.ZodNumber;\n label: z$1.ZodString;\n state: z$1.ZodEnum<{\n running: \"running\";\n failed: \"failed\";\n queued: \"queued\";\n done: \"done\";\n skipped: \"skipped\";\n }>;\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<z$1.ZodNumber>;\n phaseTitle: z$1.ZodOptional<z$1.ZodString>;\n agentType: z$1.ZodOptional<z$1.ZodString>;\n isolation: z$1.ZodOptional<z$1.ZodString>;\n queuedAt: z$1.ZodOptional<z$1.ZodNumber>;\n startedAt: z$1.ZodOptional<z$1.ZodNumber>;\n lastToolName: z$1.ZodOptional<z$1.ZodString>;\n lastToolSummary: z$1.ZodOptional<z$1.ZodString>;\n promptPreview: z$1.ZodOptional<z$1.ZodString>;\n resultPreview: z$1.ZodOptional<z$1.ZodString>;\n error: z$1.ZodOptional<z$1.ZodString>;\n tokens: z$1.ZodOptional<z$1.ZodNumber>;\n toolCalls: z$1.ZodOptional<z$1.ZodNumber>;\n durationMs: z$1.ZodOptional<z$1.ZodNumber>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n usage: z$1.ZodOptional<z$1.ZodObject<{\n totalTokens: z$1.ZodNumber;\n toolUses: z$1.ZodNumber;\n durationMs: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n summary: z$1.ZodOptional<z$1.ZodString>;\n error: z$1.ZodOptional<z$1.ZodString>;\n outputFile: z$1.ZodOptional<z$1.ZodString>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodBoolean>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodString>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n workflow: z$1.ZodOptional<z$1.ZodObject<{\n phases: z$1.ZodArray<z$1.ZodObject<{\n index: z$1.ZodNumber;\n title: z$1.ZodString;\n kind: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>>;\n agents: z$1.ZodArray<z$1.ZodObject<{\n index: z$1.ZodNumber;\n label: z$1.ZodString;\n state: z$1.ZodEnum<{\n running: \"running\";\n failed: \"failed\";\n queued: \"queued\";\n done: \"done\";\n skipped: \"skipped\";\n }>;\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<z$1.ZodNumber>;\n phaseTitle: z$1.ZodOptional<z$1.ZodString>;\n agentType: z$1.ZodOptional<z$1.ZodString>;\n isolation: z$1.ZodOptional<z$1.ZodString>;\n queuedAt: z$1.ZodOptional<z$1.ZodNumber>;\n startedAt: z$1.ZodOptional<z$1.ZodNumber>;\n lastToolName: z$1.ZodOptional<z$1.ZodString>;\n lastToolSummary: z$1.ZodOptional<z$1.ZodString>;\n promptPreview: z$1.ZodOptional<z$1.ZodString>;\n resultPreview: z$1.ZodOptional<z$1.ZodString>;\n error: z$1.ZodOptional<z$1.ZodString>;\n tokens: z$1.ZodOptional<z$1.ZodNumber>;\n toolCalls: z$1.ZodOptional<z$1.ZodNumber>;\n durationMs: z$1.ZodOptional<z$1.ZodNumber>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n usage: z$1.ZodOptional<z$1.ZodObject<{\n totalTokens: z$1.ZodNumber;\n toolUses: z$1.ZodNumber;\n durationMs: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n summary: z$1.ZodOptional<z$1.ZodString>;\n error: z$1.ZodOptional<z$1.ZodString>;\n outputFile: z$1.ZodOptional<z$1.ZodString>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n workflow: z$1.ZodOptional<z$1.ZodObject<{\n phases: z$1.ZodArray<z$1.ZodObject<{\n index: z$1.ZodNumber;\n title: z$1.ZodString;\n kind: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>>;\n agents: z$1.ZodArray<z$1.ZodObject<{\n index: z$1.ZodNumber;\n label: z$1.ZodString;\n state: z$1.ZodEnum<{\n running: \"running\";\n failed: \"failed\";\n queued: \"queued\";\n done: \"done\";\n skipped: \"skipped\";\n }>;\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<z$1.ZodNumber>;\n phaseTitle: z$1.ZodOptional<z$1.ZodString>;\n agentType: z$1.ZodOptional<z$1.ZodString>;\n isolation: z$1.ZodOptional<z$1.ZodString>;\n queuedAt: z$1.ZodOptional<z$1.ZodNumber>;\n startedAt: z$1.ZodOptional<z$1.ZodNumber>;\n lastToolName: z$1.ZodOptional<z$1.ZodString>;\n lastToolSummary: z$1.ZodOptional<z$1.ZodString>;\n promptPreview: z$1.ZodOptional<z$1.ZodString>;\n resultPreview: z$1.ZodOptional<z$1.ZodString>;\n error: z$1.ZodOptional<z$1.ZodString>;\n tokens: z$1.ZodOptional<z$1.ZodNumber>;\n toolCalls: z$1.ZodOptional<z$1.ZodNumber>;\n durationMs: z$1.ZodOptional<z$1.ZodNumber>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n usage: z$1.ZodOptional<z$1.ZodObject<{\n totalTokens: z$1.ZodNumber;\n toolUses: z$1.ZodNumber;\n durationMs: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n summary: z$1.ZodOptional<z$1.ZodString>;\n error: z$1.ZodOptional<z$1.ZodString>;\n outputFile: z$1.ZodOptional<z$1.ZodString>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodNumber>;\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<z$1.ZodNumber>;\n modelContextWindow: z$1.ZodNullable<z$1.ZodNumber>;\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<z$1.ZodObject<{\n step: z$1.ZodString;\n status: z$1.ZodOptional<z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n failed: \"failed\";\n active: \"active\";\n }>>;\n }, z$1.core.$strip>>;\n explanation: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodString>;\n willRetry: z$1.ZodOptional<z$1.ZodBoolean>;\n errorInfo: z$1.ZodOptional<z$1.ZodObject<{\n category: z$1.ZodEnum<{\n unknown: \"unknown\";\n \"active-turn-not-steerable\": \"active-turn-not-steerable\";\n \"bad-request\": \"bad-request\";\n \"connection-failed\": \"connection-failed\";\n \"context-window-exceeded\": \"context-window-exceeded\";\n billing: \"billing\";\n \"budget-exceeded\": \"budget-exceeded\";\n internal: \"internal\";\n \"max-output-tokens\": \"max-output-tokens\";\n \"max-turns\": \"max-turns\";\n overloaded: \"overloaded\";\n policy: \"policy\";\n \"rate-limit\": \"rate-limit\";\n sandbox: \"sandbox\";\n \"stream-disconnected\": \"stream-disconnected\";\n \"structured-output-retries\": \"structured-output-retries\";\n \"thread-rollback-failed\": \"thread-rollback-failed\";\n \"too-many-failed-attempts\": \"too-many-failed-attempts\";\n unauthorized: \"unauthorized\";\n }>;\n providerCode: z$1.ZodNullable<z$1.ZodString>;\n httpStatusCode: z$1.ZodNullable<z$1.ZodNumber>;\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<z$1.ZodString>;\n details: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodNumber]>>;\n method: z$1.ZodString;\n params: z$1.ZodOptional<z$1.ZodType<JsonValue$1, unknown, z$1.core.$ZodTypeInternals<JsonValue$1, unknown>>>;\n }, z$1.core.$strip>;\n parentToolCallId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodUnion<readonly [z$1.ZodObject<{\n type: z$1.ZodLiteral<\"client/thread/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<z$1.ZodString, z$1.ZodUnknown>;\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<z$1.ZodString>;\n systemMessageKind: z$1.ZodOptional<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.ZodOptional<z$1.ZodNullable<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\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<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{\n start: z$1.ZodNumber;\n end: z$1.ZodNumber;\n resource: z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\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<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional<z$1.ZodString>;\n sizeBytes: z$1.ZodOptional<z$1.ZodNumber>;\n mimeType: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>], \"type\">>;\n inputGroups: z$1.ZodOptional<z$1.ZodArray<z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{\n start: z$1.ZodNumber;\n end: z$1.ZodNumber;\n resource: z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\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<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional<z$1.ZodString>;\n sizeBytes: z$1.ZodOptional<z$1.ZodNumber>;\n mimeType: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"steer\">;\n expectedTurnId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString, z$1.ZodUnknown>;\n }, z$1.core.$strip>;\n execution: z$1.ZodObject<{\n seq: z$1.ZodOptional<z$1.ZodNumber>;\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<z$1.ZodString, z$1.ZodUnknown>;\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<z$1.ZodString>;\n message: z$1.ZodString;\n detail: z$1.ZodOptional<z$1.ZodString>;\n reconnectAttempt: z$1.ZodOptional<z$1.ZodNumber>;\n reconnectTotal: z$1.ZodOptional<z$1.ZodNumber>;\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<z$1.ZodString>;\n turnId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodRecord<z$1.ZodString, z$1.ZodType<JsonValue$1, unknown, z$1.core.$ZodTypeInternals<JsonValue$1, unknown>>>>;\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<z$1.ZodNullable<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"allow_once\">;\n grantedPermissions: z$1.ZodNullable<z$1.ZodObject<{\n network: z$1.ZodNullable<z$1.ZodObject<{\n enabled: z$1.ZodNullable<z$1.ZodBoolean>;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable<z$1.ZodObject<{\n read: z$1.ZodArray<z$1.ZodString>;\n write: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodObject<{\n network: z$1.ZodNullable<z$1.ZodObject<{\n enabled: z$1.ZodNullable<z$1.ZodBoolean>;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable<z$1.ZodObject<{\n read: z$1.ZodArray<z$1.ZodString>;\n write: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodNullable<z$1.ZodString>>;\n subject: z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"permission_grant\">;\n itemId: z$1.ZodString;\n toolName: z$1.ZodNullable<z$1.ZodString>;\n permissions: z$1.ZodObject<{\n network: z$1.ZodNullable<z$1.ZodObject<{\n enabled: z$1.ZodNullable<z$1.ZodBoolean>;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable<z$1.ZodObject<{\n read: z$1.ZodArray<z$1.ZodString>;\n write: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodNullable<z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"user_answer\">;\n answers: z$1.ZodRecord<z$1.ZodString, z$1.ZodObject<{\n selected: z$1.ZodArray<z$1.ZodString>;\n freeText: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>>;\n statusReason: z$1.ZodDefault<z$1.ZodNullable<z$1.ZodString>>;\n payload: z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"user_question\">;\n questions: z$1.ZodArray<z$1.ZodObject<{\n id: z$1.ZodString;\n prompt: z$1.ZodString;\n shortLabel: z$1.ZodOptional<z$1.ZodString>;\n multiSelect: z$1.ZodBoolean;\n options: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{\n value: z$1.ZodString;\n label: z$1.ZodString;\n description: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodObject<{\n type: z$1.ZodEnum<{\n output: \"output\";\n step: \"step\";\n }>;\n key: z$1.ZodString;\n text: z$1.ZodString;\n startedAt: z$1.ZodOptional<z$1.ZodNumber>;\n status: z$1.ZodOptional<z$1.ZodEnum<{\n completed: \"completed\";\n failed: \"failed\";\n started: \"started\";\n }>>;\n metadata: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;\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<z$1.ZodString>;\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<typeof threadEventSchema>;\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<z$1.ZodString>;\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 supportsSessionImport: z$1.ZodBoolean;\n supportedPermissionModes: z$1.ZodArray<z$1.ZodEnum<{\n full: \"full\";\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n }>>;\n }, z$1.core.$strip>;\n composerActions: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"skills\">;\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<typeof providerInfoSchema>;\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<typeof threadEventScopeSchema>;\n\ntype ThreadEventByType = {\n [TType in ThreadEventType]: Extract<ThreadEvent, {\n type: TType;\n }>;\n};\ntype ThreadEventForType<TType extends ThreadEventType> = ThreadEventByType[TType];\ntype StoredThreadEventDataFromEvent<TEvent extends ThreadEvent> = Omit<TEvent, \"threadId\" | \"type\" | \"scope\">;\ninterface ThreadEventRowBase {\n id: string;\n scope: ThreadEventScope;\n threadId: string;\n seq: number;\n createdAt: number;\n}\ntype ThreadEventRowFromEvent<TEvent extends ThreadEvent> = ThreadEventRowBase & {\n type: TEvent[\"type\"];\n data: StoredThreadEventDataFromEvent<TEvent>;\n};\ntype ThreadEventRowOfType<TType extends ThreadEventType> = ThreadEventRowFromEvent<ThreadEventForType<TType>>;\ntype ThreadEventRow = {\n [TType in ThreadEventType]: ThreadEventRowOfType<TType>;\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<typeof threadStatusSchema>;\n\ndeclare const threadTimelinePendingTodosSchema: z$1.ZodObject<{\n sourceSeq: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n items: z$1.ZodArray<z$1.ZodObject<{\n id: z$1.ZodString;\n text: z$1.ZodString;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n in_progress: \"in_progress\";\n }>;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype ThreadTimelinePendingTodos = z$1.infer<typeof threadTimelinePendingTodosSchema>;\n\ndeclare const threadQueuedMessageSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n content: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{\n start: z$1.ZodNumber;\n end: z$1.ZodNumber;\n resource: z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\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<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional<z$1.ZodString>;\n sizeBytes: z$1.ZodOptional<z$1.ZodNumber>;\n mimeType: z$1.ZodOptional<z$1.ZodString>;\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<typeof threadQueuedMessageSchema>;\n\ndeclare const createThreadEnvironmentArgsSchema: 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<z$1.ZodString>;\n workspace: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"unmanaged\">;\n path: z$1.ZodNullable<z$1.ZodString>;\n branch: z$1.ZodOptional<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"existing\">;\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\">;\ntype CreateThreadEnvironmentArgs = z$1.infer<typeof createThreadEnvironmentArgsSchema>;\ndeclare const workspaceFileListResponseSchema: z$1.ZodObject<{\n files: z$1.ZodArray<z$1.ZodObject<{\n path: z$1.ZodString;\n name: z$1.ZodString;\n }, z$1.core.$strip>>;\n truncated: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype WorkspaceFileListResponse = z$1.infer<typeof workspaceFileListResponseSchema>;\ndeclare const workspacePathListResponseSchema: z$1.ZodObject<{\n paths: z$1.ZodArray<z$1.ZodObject<{\n kind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n name: z$1.ZodString;\n score: z$1.ZodNumber;\n positions: z$1.ZodArray<z$1.ZodNumber>;\n }, z$1.core.$strip>>;\n truncated: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype WorkspacePathListResponse = z$1.infer<typeof workspacePathListResponseSchema>;\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<z$1.ZodString, z$1.ZodTransform<string, string>>;\n}, z$1.core.$strict>, z$1.ZodObject<{\n hostId: z$1.ZodString;\n type: z$1.ZodLiteral<\"clone\">;\n targetPath: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<string, string>>>;\n remoteUrl: z$1.ZodOptional<z$1.ZodString>;\n}, z$1.core.$strict>], \"type\">;\ntype CreateProjectSourceRequest = z$1.infer<typeof createProjectSourceRequestSchema>;\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<z$1.ZodString, z$1.ZodTransform<string, string>>;\n }, z$1.core.$strict>;\n}, z$1.core.$strip>;\ntype CreateProjectRequest = z$1.infer<typeof createProjectRequestSchema>;\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<typeof threadSectionSchema>;\ndeclare const createThreadSectionRequestSchema: z$1.ZodObject<{\n name: z$1.ZodString;\n}, z$1.core.$strict>;\ntype CreateThreadSectionRequest = z$1.infer<typeof createThreadSectionRequestSchema>;\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<typeof updateThreadSectionRequestSchema>;\ndeclare const deleteThreadSectionRequestSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n}, z$1.core.$strict>;\ntype DeleteThreadSectionRequest = z$1.infer<typeof deleteThreadSectionRequestSchema>;\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<typeof threadSectionMutationResponseSchema>;\ndeclare const reorderProjectRequestSchema: z$1.ZodObject<{\n previousProjectId: z$1.ZodNullable<z$1.ZodString>;\n nextProjectId: z$1.ZodNullable<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype ReorderProjectRequest = z$1.infer<typeof reorderProjectRequestSchema>;\ndeclare const projectListQuerySchema: z$1.ZodObject<{\n include: z$1.ZodOptional<z$1.ZodString>;\n includePersonal: z$1.ZodOptional<z$1.ZodEnum<{\n true: \"true\";\n false: \"false\";\n }>>;\n}, z$1.core.$strip>;\ntype ProjectListQuery = z$1.infer<typeof projectListQuerySchema>;\ndeclare const projectFilesQuerySchema: z$1.ZodObject<{\n query: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;\n limit: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;\n hostId: z$1.ZodOptional<z$1.ZodString>;\n environmentId: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodOptional<z$1.ZodString>>>;\n}, z$1.core.$strip>;\ntype ProjectFilesQuery = z$1.infer<typeof projectFilesQuerySchema>;\ndeclare const projectPathsQuerySchema: z$1.ZodObject<{\n query: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;\n limit: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;\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<z$1.ZodString>;\n environmentId: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodOptional<z$1.ZodString>>>;\n}, z$1.core.$strip>;\ntype ProjectPathsQuery = z$1.infer<typeof projectPathsQuerySchema>;\ndeclare const projectFileContentQuerySchema: z$1.ZodObject<{\n path: z$1.ZodString;\n hostId: z$1.ZodOptional<z$1.ZodString>;\n environmentId: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodOptional<z$1.ZodString>>>;\n}, z$1.core.$strip>;\ntype ProjectFileContentQuery = z$1.infer<typeof projectFileContentQuerySchema>;\ndeclare const projectBranchesQuerySchema: z$1.ZodObject<{\n query: z$1.ZodOptional<z$1.ZodString>;\n limit: z$1.ZodOptional<z$1.ZodString>;\n hostId: z$1.ZodString;\n selectedBranch: z$1.ZodOptional<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype ProjectBranchesQuery = z$1.infer<typeof projectBranchesQuerySchema>;\ndeclare const projectBranchesResponseSchema: z$1.ZodObject<{\n branches: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"detached\">;\n headSha: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unborn\">;\n branchName: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n defaultBranchRelation: z$1.ZodNullable<z$1.ZodEnum<{\n unknown: \"unknown\";\n equal: \"equal\";\n \"local-behind\": \"local-behind\";\n \"local-ahead\": \"local-ahead\";\n diverged: \"diverged\";\n }>>;\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<z$1.ZodString>;\n remoteBranches: z$1.ZodArray<z$1.ZodString>;\n remoteBranchesTruncated: z$1.ZodBoolean;\n selectedBranch: z$1.ZodNullable<z$1.ZodObject<{\n name: z$1.ZodString;\n kind: z$1.ZodEnum<{\n local: \"local\";\n remote: \"remote\";\n missing: \"missing\";\n }>;\n }, z$1.core.$strip>>;\n defaultWorktreeBaseBranch: z$1.ZodNullable<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype ProjectBranchesResponse = z$1.infer<typeof projectBranchesResponseSchema>;\ndeclare const promptHistoryQuerySchema: z$1.ZodObject<{\n limit: z$1.ZodOptional<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype PromptHistoryQuery = z$1.infer<typeof promptHistoryQuerySchema>;\ndeclare const promptHistoryResponseSchema: z$1.ZodArray<z$1.ZodObject<{\n id: z$1.ZodString;\n createdAt: z$1.ZodNumber;\n input: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{\n start: z$1.ZodNumber;\n end: z$1.ZodNumber;\n resource: z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\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<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional<z$1.ZodString>;\n sizeBytes: z$1.ZodOptional<z$1.ZodNumber>;\n mimeType: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>], \"type\">>;\n}, z$1.core.$strip>>;\ntype PromptHistoryResponse = z$1.infer<typeof promptHistoryResponseSchema>;\ndeclare const updateProjectRequestSchema: z$1.ZodObject<{\n name: z$1.ZodOptional<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype UpdateProjectRequest = z$1.infer<typeof updateProjectRequestSchema>;\ndeclare const updateProjectSourceRequestSchema: z$1.ZodObject<{\n type: z$1.ZodLiteral<\"local_path\">;\n path: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<string, string>>>;\n isDefault: z$1.ZodOptional<z$1.ZodLiteral<true>>;\n}, z$1.core.$strict>;\ntype UpdateProjectSourceRequest = z$1.infer<typeof updateProjectSourceRequestSchema>;\ndeclare const commandListResponseSchema: z$1.ZodObject<{\n commands: z$1.ZodArray<z$1.ZodObject<{\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 description: z$1.ZodNullable<z$1.ZodString>;\n argumentHint: z$1.ZodNullable<z$1.ZodString>;\n pluginId: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype CommandListResponse = z$1.infer<typeof commandListResponseSchema>;\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<z$1.ZodString>;\n environmentId: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodOptional<z$1.ZodString>>>;\n}, z$1.core.$strict>;\ntype ProjectCommandsQuery = z$1.infer<typeof projectCommandsQuerySchema>;\ndeclare const skillListResponseSchema: z$1.ZodObject<{\n skills: z$1.ZodArray<z$1.ZodObject<{\n id: z$1.ZodString;\n name: z$1.ZodString;\n description: z$1.ZodNullable<z$1.ZodString>;\n provider: z$1.ZodNullable<z$1.ZodEnum<{\n \"claude-code\": \"claude-code\";\n codex: \"codex\";\n }>>;\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<z$1.ZodString>;\n filePath: z$1.ZodString;\n manageable: z$1.ZodBoolean;\n registrySkillId: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype SkillListResponse = z$1.infer<typeof skillListResponseSchema>;\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<typeof skillContentResponseSchema>;\ndeclare const skillFilesResponseSchema: z$1.ZodObject<{\n files: z$1.ZodArray<z$1.ZodString>;\n truncated: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype SkillFilesResponse = z$1.infer<typeof skillFilesResponseSchema>;\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<z$1.ZodString>;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n sources: z$1.ZodArray<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>>;\n}, z$1.core.$strip>;\ntype ProjectResponse = z$1.infer<typeof projectResponseSchema>;\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<z$1.ZodString>;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n sources: z$1.ZodArray<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>>;\n threads: z$1.ZodArray<z$1.ZodObject<{\n id: z$1.ZodString;\n projectId: z$1.ZodString;\n environmentId: z$1.ZodNullable<z$1.ZodString>;\n providerId: z$1.ZodString;\n title: z$1.ZodNullable<z$1.ZodString>;\n titleFallback: z$1.ZodNullable<z$1.ZodString>;\n sectionId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n sourceThreadId: z$1.ZodNullable<z$1.ZodString>;\n originKind: z$1.ZodNullable<z$1.ZodEnum<{\n fork: \"fork\";\n }>>;\n childOrigin: z$1.ZodNullable<z$1.ZodEnum<{\n fork: \"fork\";\n }>>;\n originPluginId: z$1.ZodNullable<z$1.ZodString>;\n visibility: z$1.ZodEnum<{\n visible: \"visible\";\n hidden: \"hidden\";\n }>;\n archivedAt: z$1.ZodNullable<z$1.ZodNumber>;\n pinnedAt: z$1.ZodNullable<z$1.ZodNumber>;\n deletedAt: z$1.ZodNullable<z$1.ZodNumber>;\n lastReadAt: z$1.ZodNullable<z$1.ZodNumber>;\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<z$1.ZodNumber>;\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<z$1.ZodString>;\n hasPendingInteraction: z$1.ZodBoolean;\n environmentHostId: z$1.ZodNullable<z$1.ZodString>;\n environmentName: z$1.ZodNullable<z$1.ZodString>;\n environmentBranchName: z$1.ZodNullable<z$1.ZodString>;\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<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 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<typeof projectWithThreadsResponseSchema>;\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<z$1.ZodString>;\n sizeBytes: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype UploadedPromptAttachment = z$1.infer<typeof uploadedPromptAttachmentSchema>;\ndeclare const copyProjectAttachmentsRequestSchema: z$1.ZodObject<{\n sourceProjectId: z$1.ZodString;\n paths: z$1.ZodArray<z$1.ZodString>;\n}, z$1.core.$strict>;\ntype CopyProjectAttachmentsRequest = z$1.infer<typeof copyProjectAttachmentsRequestSchema>;\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<z$1.ZodNumber>;\n installUrl: z$1.ZodNullable<z$1.ZodString>;\n url: z$1.ZodString;\n topic: z$1.ZodNullable<z$1.ZodString>;\n summary: z$1.ZodNullable<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype RegistrySkill = z$1.infer<typeof registrySkillSchema>;\ndeclare const registrySkillsPageSchema: z$1.ZodObject<{\n skills: z$1.ZodArray<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<z$1.ZodNumber>;\n installUrl: z$1.ZodNullable<z$1.ZodString>;\n url: z$1.ZodString;\n topic: z$1.ZodNullable<z$1.ZodString>;\n summary: z$1.ZodNullable<z$1.ZodString>;\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<typeof registrySkillsPageSchema>;\ndeclare const registryRepositoryStarsSchema: z$1.ZodObject<{\n stars: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype RegistryRepositoryStars = z$1.infer<typeof registryRepositoryStarsSchema>;\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<z$1.ZodString>;\n files: z$1.ZodNullable<z$1.ZodArray<z$1.ZodObject<{\n path: z$1.ZodString;\n contents: z$1.ZodString;\n }, z$1.core.$strip>>>;\n}, z$1.core.$strip>;\ntype RegistrySkillDetail = z$1.infer<typeof registrySkillDetailSchema>;\ndeclare const registrySkillInstallResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral<true>;\n filePath: z$1.ZodString;\n}, z$1.core.$strip>;\ntype RegistrySkillInstallResponse = z$1.infer<typeof registrySkillInstallResponseSchema>;\n\ndeclare const updateEnvironmentRequestSchema: z$1.ZodObject<{\n mergeBaseBranch: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\n name: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\n}, z$1.core.$strip>;\ntype UpdateEnvironmentRequest = z$1.infer<typeof updateEnvironmentRequestSchema>;\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<z$1.ZodString>;\n limit: z$1.ZodOptional<z$1.ZodString>;\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<typeof environmentPathsQuerySchema>;\ndeclare const environmentDiffBranchesQuerySchema: z$1.ZodObject<{\n query: z$1.ZodOptional<z$1.ZodString>;\n limit: z$1.ZodOptional<z$1.ZodString>;\n selectedBranch: z$1.ZodOptional<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype EnvironmentDiffBranchesQuery = z$1.infer<typeof environmentDiffBranchesQuerySchema>;\ndeclare const environmentDiffBranchesResponseSchema: z$1.ZodObject<{\n branches: z$1.ZodArray<z$1.ZodString>;\n branchesTruncated: z$1.ZodBoolean;\n remoteBranches: z$1.ZodArray<z$1.ZodString>;\n remoteBranchesTruncated: z$1.ZodBoolean;\n selectedBranch: z$1.ZodNullable<z$1.ZodObject<{\n name: z$1.ZodString;\n kind: z$1.ZodEnum<{\n local: \"local\";\n remote: \"remote\";\n missing: \"missing\";\n }>;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype EnvironmentDiffBranchesResponse = z$1.infer<typeof environmentDiffBranchesResponseSchema>;\ndeclare const environmentStatusQuerySchema: z$1.ZodObject<{\n mergeBaseBranch: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodString, z$1.ZodString>>;\n}, z$1.core.$strip>;\ntype EnvironmentStatusQuery = z$1.infer<typeof environmentStatusQuerySchema>;\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<z$1.ZodString, z$1.ZodString>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n target: z$1.ZodLiteral<\"all\">;\n mergeBaseBranch: z$1.ZodPipe<z$1.ZodString, z$1.ZodString>;\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<typeof environmentDiffQuerySchema>;\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<typeof environmentDiffFileQuerySchema>;\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<z$1.ZodString>;\n sizeBytes: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype EnvironmentDiffFileResponse = z$1.infer<typeof environmentDiffFileResponseSchema>;\ndeclare const environmentArchiveThreadsResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral<true>;\n archivedThreadIds: z$1.ZodArray<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype EnvironmentArchiveThreadsResponse = z$1.infer<typeof environmentArchiveThreadsResponseSchema>;\ndeclare const pullRequestMergeMethodSchema: z$1.ZodEnum<{\n merge: \"merge\";\n rebase: \"rebase\";\n squash: \"squash\";\n}>;\ntype PullRequestMergeMethod = z$1.infer<typeof pullRequestMergeMethodSchema>;\ndeclare const commitActionResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral<true>;\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<typeof commitActionResponseSchema>;\ndeclare const squashMergeActionResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral<true>;\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<typeof squashMergeActionResponseSchema>;\ndeclare const pullRequestReadyActionResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral<true>;\n action: z$1.ZodLiteral<\"pull_request_ready\">;\n message: z$1.ZodString;\n}, z$1.core.$strip>;\ntype PullRequestReadyActionResponse = z$1.infer<typeof pullRequestReadyActionResponseSchema>;\ndeclare const pullRequestMergeActionResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral<true>;\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<typeof pullRequestMergeActionResponseSchema>;\ndeclare const pullRequestDraftActionResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral<true>;\n action: z$1.ZodLiteral<\"pull_request_draft\">;\n message: z$1.ZodString;\n}, z$1.core.$strip>;\ntype PullRequestDraftActionResponse = z$1.infer<typeof pullRequestDraftActionResponseSchema>;\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<z$1.ZodObject<{\n path: z$1.ZodString;\n status: z$1.ZodEnum<{\n M: \"M\";\n A: \"A\";\n D: \"D\";\n R: \"R\";\n C: \"C\";\n U: \"U\";\n \"??\": \"??\";\n \"?\": \"?\";\n }>;\n insertions: z$1.ZodNullable<z$1.ZodNumber>;\n deletions: z$1.ZodNullable<z$1.ZodNumber>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"detached\">;\n headSha: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unborn\">;\n branchName: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n defaultBranch: z$1.ZodString;\n }, z$1.core.$strip>;\n mergeBase: z$1.ZodNullable<z$1.ZodObject<{\n insertions: z$1.ZodNumber;\n deletions: z$1.ZodNumber;\n files: z$1.ZodArray<z$1.ZodObject<{\n path: z$1.ZodString;\n status: z$1.ZodEnum<{\n M: \"M\";\n A: \"A\";\n D: \"D\";\n R: \"R\";\n C: \"C\";\n U: \"U\";\n \"??\": \"??\";\n \"?\": \"?\";\n }>;\n insertions: z$1.ZodNullable<z$1.ZodNumber>;\n deletions: z$1.ZodNullable<z$1.ZodNumber>;\n }, z$1.core.$strip>>;\n mergeBaseBranch: z$1.ZodString;\n baseRef: z$1.ZodNullable<z$1.ZodString>;\n aheadCount: z$1.ZodNumber;\n behindCount: z$1.ZodNumber;\n hasCommittedUnmergedChanges: z$1.ZodBoolean;\n commits: z$1.ZodArray<z$1.ZodObject<{\n sha: z$1.ZodString;\n shortSha: z$1.ZodString;\n subject: z$1.ZodString;\n authorName: z$1.ZodString;\n authoredAt: z$1.ZodNumber;\n }, z$1.core.$strip>>;\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<z$1.ZodEnum<{\n BEHIND: \"BEHIND\";\n BLOCKED: \"BLOCKED\";\n CLEAN: \"CLEAN\";\n DIRTY: \"DIRTY\";\n DRAFT: \"DRAFT\";\n HAS_HOOKS: \"HAS_HOOKS\";\n UNKNOWN: \"UNKNOWN\";\n UNSTABLE: \"UNSTABLE\";\n }>>;\n mergeable: z$1.ZodNullable<z$1.ZodEnum<{\n UNKNOWN: \"UNKNOWN\";\n CONFLICTING: \"CONFLICTING\";\n MERGEABLE: \"MERGEABLE\";\n }>>;\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<typeof environmentPullRequestResponseSchema>;\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<z$1.ZodString>;\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<typeof environmentDiffResponseSchema>;\ndeclare const environmentDiffFilesResponseSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n files: z$1.ZodArray<z$1.ZodObject<{\n path: z$1.ZodString;\n previousPath: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n initialPatches: z$1.ZodArray<z$1.ZodObject<{\n path: z$1.ZodString;\n patch: z$1.ZodString;\n truncated: z$1.ZodBoolean;\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 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<typeof environmentDiffFilesResponseSchema>;\ndeclare const environmentDiffPatchResponseSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n outcome: z$1.ZodLiteral<\"available\">;\n patches: z$1.ZodArray<z$1.ZodObject<{\n path: z$1.ZodString;\n patch: z$1.ZodString;\n truncated: z$1.ZodBoolean;\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 EnvironmentDiffPatchResponse = z$1.infer<typeof environmentDiffPatchResponseSchema>;\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<z$1.ZodString>;\n}, z$1.core.$strict>;\ntype EnvironmentDiffPatchRequest = z$1.infer<typeof environmentDiffPatchRequestSchema>;\ntype EnvironmentStatusResponse = z$1.infer<typeof environmentStatusResponseSchema>;\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<z$1.ZodString>;\n planLabel: z$1.ZodNullable<z$1.ZodString>;\n windows: z$1.ZodArray<z$1.ZodObject<{\n label: z$1.ZodString;\n usedPercent: z$1.ZodNumber;\n resetsAt: z$1.ZodNullable<z$1.ZodString>;\n cost: z$1.ZodOptional<z$1.ZodObject<{\n usedUsdCents: z$1.ZodNumber;\n limitUsdCents: z$1.ZodNumber;\n }, z$1.core.$strip>>;\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 planLabel: z$1.ZodDefault<z$1.ZodNullable<z$1.ZodString>>;\n accountEmail: z$1.ZodDefault<z$1.ZodNullable<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<z$1.ZodString>;\n planLabel: z$1.ZodNullable<z$1.ZodString>;\n windows: z$1.ZodArray<z$1.ZodObject<{\n label: z$1.ZodString;\n usedPercent: z$1.ZodNumber;\n resetsAt: z$1.ZodNullable<z$1.ZodString>;\n cost: z$1.ZodOptional<z$1.ZodObject<{\n usedUsdCents: z$1.ZodNumber;\n limitUsdCents: z$1.ZodNumber;\n }, z$1.core.$strip>>;\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 planLabel: z$1.ZodDefault<z$1.ZodNullable<z$1.ZodString>>;\n accountEmail: z$1.ZodDefault<z$1.ZodNullable<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<z$1.ZodString>;\n planLabel: z$1.ZodNullable<z$1.ZodString>;\n windows: z$1.ZodArray<z$1.ZodObject<{\n label: z$1.ZodString;\n usedPercent: z$1.ZodNumber;\n resetsAt: z$1.ZodNullable<z$1.ZodString>;\n cost: z$1.ZodOptional<z$1.ZodObject<{\n usedUsdCents: z$1.ZodNumber;\n limitUsdCents: z$1.ZodNumber;\n }, z$1.core.$strip>>;\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 planLabel: z$1.ZodDefault<z$1.ZodNullable<z$1.ZodString>>;\n accountEmail: z$1.ZodDefault<z$1.ZodNullable<z$1.ZodString>>;\n }, z$1.core.$strip>], \"status\">;\n}, z$1.core.$strip>;\ntype ProviderUsageResponse = z$1.infer<typeof providerUsageResponseSchema>;\ndeclare const discoverReposResultSchema: z$1.ZodObject<{\n repos: z$1.ZodArray<z$1.ZodObject<{\n path: z$1.ZodString;\n name: z$1.ZodString;\n lastActivityAt: z$1.ZodString;\n originUrl: z$1.ZodNullable<z$1.ZodString>;\n agentSeen: z$1.ZodBoolean;\n agentSeenAt: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strict>>;\n truncated: z$1.ZodBoolean;\n}, z$1.core.$strict>;\ntype DiscoverReposResult = z$1.infer<typeof discoverReposResultSchema>;\ntype HostDaemonCommandTransport = \"settled\" | \"onlineRpc\";\ntype HostDaemonCommandEnvironmentLane = \"read\" | \"write\";\ntype HostDaemonFlushEventsBeforeResult = boolean | \"when-initiated\";\ninterface HostDaemonCommandDescriptor<Type extends string, Schema extends z$1.ZodTypeAny, ResultSchema extends z$1.ZodTypeAny, Transport extends HostDaemonCommandTransport, Retryable extends boolean> {\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<z$1.ZodObject<{\n displayName: z$1.ZodString;\n command: z$1.ZodString;\n args: z$1.ZodArray<z$1.ZodString>;\n env: z$1.ZodRecord<z$1.ZodString, z$1.ZodString>;\n cwd: z$1.ZodOptional<z$1.ZodString>;\n modelCli: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodObject<{\n listArgs: z$1.ZodArray<z$1.ZodString>;\n selectFlag: z$1.ZodOptional<z$1.ZodString>;\n primaryModels: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodObject<{\n flag: z$1.ZodString;\n supportedLevels: z$1.ZodArray<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 levelValues: z$1.ZodOptional<z$1.ZodRecord<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 }> & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional<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 }, z$1.core.$strict>>;\n nativeReasoning: z$1.ZodOptional<z$1.ZodObject<{\n configId: z$1.ZodString;\n supportedLevels: z$1.ZodArray<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 levelValues: z$1.ZodOptional<z$1.ZodRecord<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 }> & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional<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 }, z$1.core.$strict>>;\n permissionCli: z$1.ZodOptional<z$1.ZodObject<{\n full: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n workspaceWrite: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n readonly: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n insertAfterArgs: z$1.ZodOptional<z$1.ZodNumber>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>>;\n options: z$1.ZodIntersection<z$1.ZodObject<{\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 claudeCodePermissionMode: z$1.ZodOptional<z$1.ZodLiteral<\"plan\">>;\n claudeCodeMockCliTraffic: z$1.ZodOptional<z$1.ZodObject<{\n enabled: z$1.ZodBoolean;\n endpoint: z$1.ZodString;\n }, z$1.core.$strict>>;\n workflowsEnabled: z$1.ZodBoolean;\n memoryEnabled: z$1.ZodOptional<z$1.ZodBoolean>;\n providerSubagentsEnabled: z$1.ZodOptional<z$1.ZodBoolean>;\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<z$1.ZodObject<{\n name: z$1.ZodString;\n description: z$1.ZodString;\n inputSchema: z$1.ZodUnknown;\n }, z$1.core.$strip>>;\n injectedSkillSources: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n name: z$1.ZodString;\n description: z$1.ZodString;\n kind: z$1.ZodLiteral<\"tree\">;\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<z$1.ZodArray<z$1.ZodString>>;\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<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{\n start: z$1.ZodNumber;\n end: z$1.ZodNumber;\n resource: z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\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<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional<z$1.ZodString>;\n sizeBytes: z$1.ZodOptional<z$1.ZodNumber>;\n mimeType: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>], \"type\">>;\n inputGroups: z$1.ZodOptional<z$1.ZodArray<z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{\n start: z$1.ZodNumber;\n end: z$1.ZodNumber;\n resource: z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\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<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional<z$1.ZodString>;\n sizeBytes: z$1.ZodOptional<z$1.ZodNumber>;\n mimeType: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>], \"type\">>>>;\n threadStoragePath: z$1.ZodOptional<z$1.ZodString>;\n fork: z$1.ZodOptional<z$1.ZodObject<{\n sourceProviderThreadId: z$1.ZodString;\n }, z$1.core.$strip>>;\n sessionImport: z$1.ZodOptional<z$1.ZodObject<{\n providerThreadId: z$1.ZodString;\n }, z$1.core.$strip>>;\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<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{\n start: z$1.ZodNumber;\n end: z$1.ZodNumber;\n resource: z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\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<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional<z$1.ZodString>;\n sizeBytes: z$1.ZodOptional<z$1.ZodNumber>;\n mimeType: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>], \"type\">>;\n inputGroups: z$1.ZodOptional<z$1.ZodArray<z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{\n start: z$1.ZodNumber;\n end: z$1.ZodNumber;\n resource: z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\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<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional<z$1.ZodString>;\n sizeBytes: z$1.ZodOptional<z$1.ZodNumber>;\n mimeType: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>], \"type\">>>>;\n options: z$1.ZodIntersection<z$1.ZodObject<{\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 claudeCodePermissionMode: z$1.ZodOptional<z$1.ZodLiteral<\"plan\">>;\n claudeCodeMockCliTraffic: z$1.ZodOptional<z$1.ZodObject<{\n enabled: z$1.ZodBoolean;\n endpoint: z$1.ZodString;\n }, z$1.core.$strict>>;\n workflowsEnabled: z$1.ZodBoolean;\n memoryEnabled: z$1.ZodOptional<z$1.ZodBoolean>;\n providerSubagentsEnabled: z$1.ZodOptional<z$1.ZodBoolean>;\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<z$1.ZodObject<{\n displayName: z$1.ZodString;\n command: z$1.ZodString;\n args: z$1.ZodArray<z$1.ZodString>;\n env: z$1.ZodRecord<z$1.ZodString, z$1.ZodString>;\n cwd: z$1.ZodOptional<z$1.ZodString>;\n modelCli: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodObject<{\n listArgs: z$1.ZodArray<z$1.ZodString>;\n selectFlag: z$1.ZodOptional<z$1.ZodString>;\n primaryModels: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodObject<{\n flag: z$1.ZodString;\n supportedLevels: z$1.ZodArray<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 levelValues: z$1.ZodOptional<z$1.ZodRecord<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 }> & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional<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 }, z$1.core.$strict>>;\n nativeReasoning: z$1.ZodOptional<z$1.ZodObject<{\n configId: z$1.ZodString;\n supportedLevels: z$1.ZodArray<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 levelValues: z$1.ZodOptional<z$1.ZodRecord<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 }> & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional<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 }, z$1.core.$strict>>;\n permissionCli: z$1.ZodOptional<z$1.ZodObject<{\n full: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n workspaceWrite: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n readonly: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n insertAfterArgs: z$1.ZodOptional<z$1.ZodNumber>;\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<z$1.ZodObject<{\n displayName: z$1.ZodString;\n command: z$1.ZodString;\n args: z$1.ZodArray<z$1.ZodString>;\n env: z$1.ZodRecord<z$1.ZodString, z$1.ZodString>;\n cwd: z$1.ZodOptional<z$1.ZodString>;\n modelCli: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodObject<{\n listArgs: z$1.ZodArray<z$1.ZodString>;\n selectFlag: z$1.ZodOptional<z$1.ZodString>;\n primaryModels: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodObject<{\n flag: z$1.ZodString;\n supportedLevels: z$1.ZodArray<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 levelValues: z$1.ZodOptional<z$1.ZodRecord<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 }> & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional<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 }, z$1.core.$strict>>;\n nativeReasoning: z$1.ZodOptional<z$1.ZodObject<{\n configId: z$1.ZodString;\n supportedLevels: z$1.ZodArray<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 levelValues: z$1.ZodOptional<z$1.ZodRecord<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 }> & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional<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 }, z$1.core.$strict>>;\n permissionCli: z$1.ZodOptional<z$1.ZodObject<{\n full: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n workspaceWrite: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n readonly: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n insertAfterArgs: z$1.ZodOptional<z$1.ZodNumber>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>>;\n instructions: z$1.ZodString;\n dynamicTools: z$1.ZodArray<z$1.ZodObject<{\n name: z$1.ZodString;\n description: z$1.ZodString;\n inputSchema: z$1.ZodUnknown;\n }, z$1.core.$strip>>;\n injectedSkillSources: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n name: z$1.ZodString;\n description: z$1.ZodString;\n kind: z$1.ZodLiteral<\"tree\">;\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<z$1.ZodArray<z$1.ZodString>>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n mode: z$1.ZodLiteral<\"steer\">;\n expectedTurnId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodObject<{\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 claudeCodePermissionMode: z$1.ZodOptional<z$1.ZodLiteral<\"plan\">>;\n claudeCodeMockCliTraffic: z$1.ZodOptional<z$1.ZodObject<{\n enabled: z$1.ZodBoolean;\n endpoint: z$1.ZodString;\n }, z$1.core.$strict>>;\n workflowsEnabled: z$1.ZodBoolean;\n memoryEnabled: z$1.ZodOptional<z$1.ZodBoolean>;\n providerSubagentsEnabled: z$1.ZodOptional<z$1.ZodBoolean>;\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<z$1.ZodObject<{\n displayName: z$1.ZodString;\n command: z$1.ZodString;\n args: z$1.ZodArray<z$1.ZodString>;\n env: z$1.ZodRecord<z$1.ZodString, z$1.ZodString>;\n cwd: z$1.ZodOptional<z$1.ZodString>;\n modelCli: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodObject<{\n listArgs: z$1.ZodArray<z$1.ZodString>;\n selectFlag: z$1.ZodOptional<z$1.ZodString>;\n primaryModels: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodObject<{\n flag: z$1.ZodString;\n supportedLevels: z$1.ZodArray<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 levelValues: z$1.ZodOptional<z$1.ZodRecord<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 }> & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional<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 }, z$1.core.$strict>>;\n nativeReasoning: z$1.ZodOptional<z$1.ZodObject<{\n configId: z$1.ZodString;\n supportedLevels: z$1.ZodArray<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 levelValues: z$1.ZodOptional<z$1.ZodRecord<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 }> & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional<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 }, z$1.core.$strict>>;\n permissionCli: z$1.ZodOptional<z$1.ZodObject<{\n full: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n workspaceWrite: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n readonly: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n insertAfterArgs: z$1.ZodOptional<z$1.ZodNumber>;\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<z$1.ZodObject<{\n displayName: z$1.ZodString;\n command: z$1.ZodString;\n args: z$1.ZodArray<z$1.ZodString>;\n env: z$1.ZodRecord<z$1.ZodString, z$1.ZodString>;\n cwd: z$1.ZodOptional<z$1.ZodString>;\n modelCli: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodObject<{\n listArgs: z$1.ZodArray<z$1.ZodString>;\n selectFlag: z$1.ZodOptional<z$1.ZodString>;\n primaryModels: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodObject<{\n flag: z$1.ZodString;\n supportedLevels: z$1.ZodArray<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 levelValues: z$1.ZodOptional<z$1.ZodRecord<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 }> & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional<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 }, z$1.core.$strict>>;\n nativeReasoning: z$1.ZodOptional<z$1.ZodObject<{\n configId: z$1.ZodString;\n supportedLevels: z$1.ZodArray<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 levelValues: z$1.ZodOptional<z$1.ZodRecord<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 }> & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional<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 }, z$1.core.$strict>>;\n permissionCli: z$1.ZodOptional<z$1.ZodObject<{\n full: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n workspaceWrite: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n readonly: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n insertAfterArgs: z$1.ZodOptional<z$1.ZodNumber>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>>;\n instructions: z$1.ZodString;\n dynamicTools: z$1.ZodArray<z$1.ZodObject<{\n name: z$1.ZodString;\n description: z$1.ZodString;\n inputSchema: z$1.ZodUnknown;\n }, z$1.core.$strip>>;\n injectedSkillSources: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n name: z$1.ZodString;\n description: z$1.ZodString;\n kind: z$1.ZodLiteral<\"tree\">;\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<z$1.ZodArray<z$1.ZodString>>;\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<readonly [z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"allow_once\">;\n grantedPermissions: z$1.ZodNullable<z$1.ZodObject<{\n network: z$1.ZodNullable<z$1.ZodObject<{\n enabled: z$1.ZodNullable<z$1.ZodBoolean>;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable<z$1.ZodObject<{\n read: z$1.ZodArray<z$1.ZodString>;\n write: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodObject<{\n network: z$1.ZodNullable<z$1.ZodObject<{\n enabled: z$1.ZodNullable<z$1.ZodBoolean>;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable<z$1.ZodObject<{\n read: z$1.ZodArray<z$1.ZodString>;\n write: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodString, z$1.ZodObject<{\n selected: z$1.ZodArray<z$1.ZodString>;\n freeText: z$1.ZodOptional<z$1.ZodString>;\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 reasoningEffort: z$1.ZodLiteral<\"none\">;\n prompt: z$1.ZodString;\n outputSchema: z$1.ZodType<JsonObject, unknown, z$1.core.$ZodTypeInternals<JsonObject, unknown>>;\n timeoutMs: z$1.ZodNumber;\n }, z$1.core.$strict>, z$1.ZodObject<{\n model: z$1.ZodString;\n value: z$1.ZodType<JsonObject, unknown, z$1.core.$ZodTypeInternals<JsonObject, unknown>>;\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<z$1.ZodString>;\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<z$1.ZodObject<{\n threadId: z$1.ZodString;\n provisioningId: z$1.ZodString;\n }, z$1.core.$strict>>;\n workspaceProvisionType: z$1.ZodLiteral<\"unmanaged\">;\n path: z$1.ZodString;\n checkout: z$1.ZodOptional<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"existing\">;\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<z$1.ZodObject<{\n threadId: z$1.ZodString;\n provisioningId: z$1.ZodString;\n }, z$1.core.$strict>>;\n sourcePath: z$1.ZodString;\n targetPath: z$1.ZodString;\n branchName: z$1.ZodString;\n baseBranch: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodObject<{\n threadId: z$1.ZodString;\n provisioningId: z$1.ZodString;\n }, z$1.core.$strict>>;\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<z$1.ZodString>;\n defaultBranch: z$1.ZodNullable<z$1.ZodString>;\n transcript: z$1.ZodArray<z$1.ZodObject<{\n type: z$1.ZodEnum<{\n output: \"output\";\n step: \"step\";\n }>;\n key: z$1.ZodString;\n text: z$1.ZodString;\n startedAt: z$1.ZodOptional<z$1.ZodNumber>;\n status: z$1.ZodOptional<z$1.ZodEnum<{\n started: \"started\";\n completed: \"completed\";\n failed: \"failed\";\n }>>;\n metadata: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;\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<z$1.ZodString>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n path: z$1.ZodString;\n gitRemoteUrl: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n limit: z$1.ZodNumber;\n }, z$1.core.$strip>, z$1.ZodObject<{\n files: z$1.ZodArray<z$1.ZodObject<{\n path: z$1.ZodString;\n name: z$1.ZodString;\n }, z$1.core.$strip>>;\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<z$1.ZodString>;\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<z$1.ZodObject<{\n kind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n name: z$1.ZodString;\n score: z$1.ZodNumber;\n positions: z$1.ZodArray<z$1.ZodNumber>;\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<z$1.ZodString>;\n recursive: z$1.ZodBoolean;\n }, z$1.core.$strict>, z$1.ZodObject<{\n ok: z$1.ZodLiteral<true>;\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<z$1.ZodString>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n ok: z$1.ZodLiteral<true>;\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<z$1.ZodString>;\n recursive: z$1.ZodBoolean;\n }, z$1.core.$strict>, z$1.ZodObject<{\n ok: z$1.ZodLiteral<true>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n directory: z$1.ZodString;\n parent: z$1.ZodNullable<z$1.ZodString>;\n entries: z$1.ZodArray<z$1.ZodObject<{\n kind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\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.ZodArray<z$1.ZodString>, z$1.ZodTransform<string[], string[]>>;\n type: z$1.ZodLiteral<\"host.paths_exist\">;\n }, z$1.core.$strict>, z$1.ZodObject<{\n existence: z$1.ZodRecord<z$1.ZodString, z$1.ZodBoolean>;\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<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n commands: z$1.ZodArray<z$1.ZodObject<{\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 user: \"user\";\n }>;\n description: z$1.ZodNullable<z$1.ZodString>;\n argumentHint: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n skills: z$1.ZodArray<z$1.ZodObject<{\n id: z$1.ZodString;\n name: z$1.ZodString;\n description: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n rootPath: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>], \"outcome\">, \"onlineRpc\", false>;\n \"host.install_global_skills\": HostDaemonCommandDescriptor<\"host.install_global_skills\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.install_global_skills\">;\n skills: z$1.ZodArray<z$1.ZodObject<{\n name: z$1.ZodString;\n treeHash: z$1.ZodString;\n entryPath: z$1.ZodString;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n installations: z$1.ZodArray<z$1.ZodObject<{\n name: z$1.ZodString;\n path: z$1.ZodString;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>, \"onlineRpc\", false>;\n \"host.global_skills_status\": HostDaemonCommandDescriptor<\"host.global_skills_status\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"host.global_skills_status\">;\n names: z$1.ZodArray<z$1.ZodString>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n entries: z$1.ZodArray<z$1.ZodObject<{\n name: z$1.ZodString;\n path: z$1.ZodString;\n treeHash: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>, \"onlineRpc\", true>;\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<z$1.ZodString>;\n selectedBranch: z$1.ZodOptional<z$1.ZodString>;\n limit: z$1.ZodNumber;\n }, z$1.core.$strip>, z$1.ZodObject<{\n branches: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"detached\">;\n headSha: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unborn\">;\n branchName: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n defaultBranchRelation: z$1.ZodNullable<z$1.ZodEnum<{\n unknown: \"unknown\";\n equal: \"equal\";\n \"local-behind\": \"local-behind\";\n \"local-ahead\": \"local-ahead\";\n diverged: \"diverged\";\n }>>;\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<z$1.ZodString>;\n remoteBranches: z$1.ZodArray<z$1.ZodString>;\n remoteBranchesTruncated: z$1.ZodBoolean;\n selectedBranch: z$1.ZodNullable<z$1.ZodObject<{\n name: z$1.ZodString;\n kind: z$1.ZodEnum<{\n local: \"local\";\n remote: \"remote\";\n missing: \"missing\";\n }>;\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<z$1.ZodString>;\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<z$1.ZodString>;\n ref: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n sizeBytes: z$1.ZodNumber;\n modifiedAtMs: z$1.ZodOptional<z$1.ZodNumber>;\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<z$1.ZodString>;\n sizeBytes: z$1.ZodNumber;\n modifiedAtMs: z$1.ZodOptional<z$1.ZodNumber>;\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<z$1.ZodString>;\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<z$1.ZodNullable<z$1.ZodString>>;\n mode: z$1.ZodOptional<z$1.ZodNumber>;\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<z$1.ZodString>;\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<z$1.ZodObject<{\n displayName: z$1.ZodString;\n command: z$1.ZodString;\n args: z$1.ZodArray<z$1.ZodString>;\n env: z$1.ZodRecord<z$1.ZodString, z$1.ZodString>;\n cwd: z$1.ZodOptional<z$1.ZodString>;\n modelCli: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodObject<{\n listArgs: z$1.ZodArray<z$1.ZodString>;\n selectFlag: z$1.ZodOptional<z$1.ZodString>;\n primaryModels: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodObject<{\n flag: z$1.ZodString;\n supportedLevels: z$1.ZodArray<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 levelValues: z$1.ZodOptional<z$1.ZodRecord<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 }> & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional<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 }, z$1.core.$strict>>;\n nativeReasoning: z$1.ZodOptional<z$1.ZodObject<{\n configId: z$1.ZodString;\n supportedLevels: z$1.ZodArray<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 levelValues: z$1.ZodOptional<z$1.ZodRecord<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 }> & z$1.core.$partial, z$1.ZodString>>;\n defaultLevel: z$1.ZodOptional<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 }, z$1.core.$strict>>;\n permissionCli: z$1.ZodOptional<z$1.ZodObject<{\n full: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n workspaceWrite: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n readonly: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n insertAfterArgs: z$1.ZodOptional<z$1.ZodNumber>;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>>;\n cwd: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n models: z$1.ZodArray<z$1.ZodObject<{\n id: z$1.ZodString;\n model: z$1.ZodString;\n displayName: z$1.ZodString;\n description: z$1.ZodString;\n supportedReasoningEfforts: z$1.ZodArray<z$1.ZodObject<{\n reasoningEffort: 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 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<z$1.ZodObject<{\n id: z$1.ZodString;\n model: z$1.ZodString;\n displayName: z$1.ZodString;\n description: z$1.ZodString;\n supportedReasoningEfforts: z$1.ZodArray<z$1.ZodObject<{\n reasoningEffort: 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 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 supportsSessionImport: z$1.ZodOptional<z$1.ZodBoolean>;\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<z$1.ZodObject<{\n id: z$1.ZodString;\n executableName: z$1.ZodString;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n agents: z$1.ZodArray<z$1.ZodObject<{\n id: z$1.ZodString;\n executableName: z$1.ZodString;\n installed: z$1.ZodBoolean;\n executablePath: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n planLabel: z$1.ZodNullable<z$1.ZodString>;\n windows: z$1.ZodArray<z$1.ZodObject<{\n label: z$1.ZodString;\n usedPercent: z$1.ZodNumber;\n resetsAt: z$1.ZodNullable<z$1.ZodString>;\n cost: z$1.ZodOptional<z$1.ZodObject<{\n usedUsdCents: z$1.ZodNumber;\n limitUsdCents: z$1.ZodNumber;\n }, z$1.core.$strip>>;\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 planLabel: z$1.ZodDefault<z$1.ZodNullable<z$1.ZodString>>;\n accountEmail: z$1.ZodDefault<z$1.ZodNullable<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<z$1.ZodString>;\n planLabel: z$1.ZodNullable<z$1.ZodString>;\n windows: z$1.ZodArray<z$1.ZodObject<{\n label: z$1.ZodString;\n usedPercent: z$1.ZodNumber;\n resetsAt: z$1.ZodNullable<z$1.ZodString>;\n cost: z$1.ZodOptional<z$1.ZodObject<{\n usedUsdCents: z$1.ZodNumber;\n limitUsdCents: z$1.ZodNumber;\n }, z$1.core.$strip>>;\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 planLabel: z$1.ZodDefault<z$1.ZodNullable<z$1.ZodString>>;\n accountEmail: z$1.ZodDefault<z$1.ZodNullable<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<z$1.ZodString>;\n planLabel: z$1.ZodNullable<z$1.ZodString>;\n windows: z$1.ZodArray<z$1.ZodObject<{\n label: z$1.ZodString;\n usedPercent: z$1.ZodNumber;\n resetsAt: z$1.ZodNullable<z$1.ZodString>;\n cost: z$1.ZodOptional<z$1.ZodObject<{\n usedUsdCents: z$1.ZodNumber;\n limitUsdCents: z$1.ZodNumber;\n }, z$1.core.$strip>>;\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 planLabel: z$1.ZodDefault<z$1.ZodNullable<z$1.ZodString>>;\n accountEmail: z$1.ZodDefault<z$1.ZodNullable<z$1.ZodString>>;\n }, z$1.core.$strip>], \"status\">;\n }, z$1.core.$strip>, \"onlineRpc\", true>;\n \"workspace.discover_repos\": HostDaemonCommandDescriptor<\"workspace.discover_repos\", z$1.ZodObject<{\n type: z$1.ZodLiteral<\"workspace.discover_repos\">;\n maxDepth: z$1.ZodNumber;\n sinceDays: z$1.ZodNumber;\n limit: z$1.ZodNumber;\n }, z$1.core.$strict>, z$1.ZodObject<{\n repos: z$1.ZodArray<z$1.ZodObject<{\n path: z$1.ZodString;\n name: z$1.ZodString;\n lastActivityAt: z$1.ZodString;\n originUrl: z$1.ZodNullable<z$1.ZodString>;\n agentSeen: z$1.ZodBoolean;\n agentSeenAt: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strict>>;\n truncated: z$1.ZodBoolean;\n }, z$1.core.$strict>, \"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.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n }>, z$1.ZodObject<{\n displayName: z$1.ZodString;\n executableName: z$1.ZodString;\n executablePath: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n latestVersion: z$1.ZodNullable<z$1.ZodString>;\n minimumSupportedVersion: z$1.ZodNullable<z$1.ZodString>;\n npmPackageName: z$1.ZodNullable<z$1.ZodString>;\n npmGlobalPackageVersion: z$1.ZodNullable<z$1.ZodString>;\n installAction: z$1.ZodNullable<z$1.ZodObject<{\n kind: z$1.ZodEnum<{\n install: \"install\";\n update: \"update\";\n }>;\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<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<z$1.ZodNumber>;\n signal: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodObject<{\n path: z$1.ZodString;\n status: z$1.ZodEnum<{\n M: \"M\";\n A: \"A\";\n D: \"D\";\n R: \"R\";\n C: \"C\";\n U: \"U\";\n \"??\": \"??\";\n \"?\": \"?\";\n }>;\n insertions: z$1.ZodNullable<z$1.ZodNumber>;\n deletions: z$1.ZodNullable<z$1.ZodNumber>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"detached\">;\n headSha: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"unborn\">;\n branchName: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n defaultBranch: z$1.ZodString;\n }, z$1.core.$strip>;\n mergeBase: z$1.ZodNullable<z$1.ZodObject<{\n insertions: z$1.ZodNumber;\n deletions: z$1.ZodNumber;\n files: z$1.ZodArray<z$1.ZodObject<{\n path: z$1.ZodString;\n status: z$1.ZodEnum<{\n M: \"M\";\n A: \"A\";\n D: \"D\";\n R: \"R\";\n C: \"C\";\n U: \"U\";\n \"??\": \"??\";\n \"?\": \"?\";\n }>;\n insertions: z$1.ZodNullable<z$1.ZodNumber>;\n deletions: z$1.ZodNullable<z$1.ZodNumber>;\n }, z$1.core.$strip>>;\n mergeBaseBranch: z$1.ZodString;\n baseRef: z$1.ZodNullable<z$1.ZodString>;\n aheadCount: z$1.ZodNumber;\n behindCount: z$1.ZodNumber;\n hasCommittedUnmergedChanges: z$1.ZodBoolean;\n commits: z$1.ZodArray<z$1.ZodObject<{\n sha: z$1.ZodString;\n shortSha: z$1.ZodString;\n subject: z$1.ZodString;\n authorName: z$1.ZodString;\n authoredAt: z$1.ZodNumber;\n }, z$1.core.$strip>>;\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<z$1.ZodString>;\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<z$1.ZodObject<{\n path: z$1.ZodString;\n previousPath: z$1.ZodNullable<z$1.ZodString>;\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<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 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<z$1.ZodString>;\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<z$1.ZodObject<{\n path: z$1.ZodString;\n patch: z$1.ZodString;\n truncated: z$1.ZodBoolean;\n }, z$1.core.$strict>>;\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<z$1.ZodObject<{\n name: z$1.ZodString;\n status: z$1.ZodEnum<{\n unknown: \"unknown\";\n completed: \"completed\";\n queued: \"queued\";\n in_progress: \"in_progress\";\n }>;\n conclusion: z$1.ZodNullable<z$1.ZodEnum<{\n unknown: \"unknown\";\n success: \"success\";\n cancelled: \"cancelled\";\n failure: \"failure\";\n skipped: \"skipped\";\n neutral: \"neutral\";\n timed_out: \"timed_out\";\n action_required: \"action_required\";\n startup_failure: \"startup_failure\";\n stale: \"stale\";\n }>>;\n url: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strict>>;\n reviewDecision: z$1.ZodNullable<z$1.ZodEnum<{\n APPROVED: \"APPROVED\";\n CHANGES_REQUESTED: \"CHANGES_REQUESTED\";\n REVIEW_REQUIRED: \"REVIEW_REQUIRED\";\n }>>;\n reviewRequestCount: z$1.ZodNumber;\n mergeStateStatus: z$1.ZodNullable<z$1.ZodEnum<{\n BEHIND: \"BEHIND\";\n BLOCKED: \"BLOCKED\";\n CLEAN: \"CLEAN\";\n DIRTY: \"DIRTY\";\n DRAFT: \"DRAFT\";\n HAS_HOOKS: \"HAS_HOOKS\";\n UNKNOWN: \"UNKNOWN\";\n UNSTABLE: \"UNSTABLE\";\n }>>;\n mergeable: z$1.ZodNullable<z$1.ZodEnum<{\n UNKNOWN: \"UNKNOWN\";\n CONFLICTING: \"CONFLICTING\";\n MERGEABLE: \"MERGEABLE\";\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\">, \"onlineRpc\", true>;\n};\ntype HostDaemonCommandRegistry = typeof hostDaemonCommandRegistry;\ntype AnyHostDaemonCommandDescriptor = HostDaemonCommandRegistry[keyof HostDaemonCommandRegistry];\ntype HostDaemonCommandDescriptorForTransport<Transport extends HostDaemonCommandTransport> = Extract<AnyHostDaemonCommandDescriptor, {\n transport: Transport;\n}>;\ntype HostDaemonResultSchemaMapForTransport<Transport extends HostDaemonCommandTransport> = {\n [Descriptor in HostDaemonCommandDescriptorForTransport<Transport> as Descriptor[\"type\"]]: Descriptor[\"resultSchema\"];\n};\ntype HostDaemonOnlineRpcResultSchemaMap = HostDaemonResultSchemaMapForTransport<\"onlineRpc\">;\ntype HostDaemonOnlineRpcResultByType = {\n [K in keyof HostDaemonOnlineRpcResultSchemaMap]: z$1.infer<HostDaemonOnlineRpcResultSchemaMap[K]>;\n};\n\ndeclare const pickFolderResponseSchema: z$1.ZodObject<{\n path: z$1.ZodNullable<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype PickFolderResponse = z$1.infer<typeof pickFolderResponseSchema>;\ndeclare const pathsExistRequestSchema: z$1.ZodObject<{\n paths: z$1.ZodPipe<z$1.ZodArray<z$1.ZodString>, z$1.ZodTransform<string[], string[]>>;\n}, z$1.core.$strip>;\ntype PathsExistRequest = z$1.infer<typeof pathsExistRequestSchema>;\ndeclare const pathsExistResponseSchema: z$1.ZodObject<{\n existence: z$1.ZodRecord<z$1.ZodString, z$1.ZodBoolean>;\n}, z$1.core.$strip>;\ntype PathsExistResponse = z$1.infer<typeof pathsExistResponseSchema>;\ndeclare const providerCliStatusResponseSchema: z$1.ZodRecord<z$1.ZodEnum<{\n codex: \"codex\";\n claudeCode: \"claudeCode\";\n cursor: \"cursor\";\n}>, z$1.ZodObject<{\n displayName: z$1.ZodString;\n executableName: z$1.ZodString;\n executablePath: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n latestVersion: z$1.ZodNullable<z$1.ZodString>;\n minimumSupportedVersion: z$1.ZodNullable<z$1.ZodString>;\n npmPackageName: z$1.ZodNullable<z$1.ZodString>;\n npmGlobalPackageVersion: z$1.ZodNullable<z$1.ZodString>;\n installAction: z$1.ZodNullable<z$1.ZodObject<{\n kind: z$1.ZodEnum<{\n install: \"install\";\n update: \"update\";\n }>;\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<typeof providerCliStatusResponseSchema>;\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<typeof providerCliInstallRequestSchema>;\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<z$1.ZodNumber>;\n signal: z$1.ZodNullable<z$1.ZodString>;\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<typeof providerCliInstallEventSchema>;\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<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype HostDirectoryQuery = z$1.infer<typeof hostDirectoryQuerySchema>;\ndeclare const hostDirectoryListingSchema: z$1.ZodObject<{\n directory: z$1.ZodString;\n parent: z$1.ZodNullable<z$1.ZodString>;\n entries: z$1.ZodArray<z$1.ZodObject<{\n kind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\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<typeof hostDirectoryListingSchema>;\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<typeof hostCloneDefaultPathQuerySchema>;\ndeclare const hostCloneDefaultPathResponseSchema: z$1.ZodObject<{\n path: z$1.ZodString;\n}, z$1.core.$strict>;\ntype HostCloneDefaultPathResponse = z$1.infer<typeof hostCloneDefaultPathResponseSchema>;\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<typeof createHostJoinCodeResponseSchema>;\ndeclare const updateHostRequestSchema: z$1.ZodObject<{\n name: z$1.ZodString;\n}, z$1.core.$strict>;\ntype UpdateHostRequest = z$1.infer<typeof updateHostRequestSchema>;\ndeclare const hostRetryUpdateResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral<true>;\n}, z$1.core.$strict>;\ntype HostRetryUpdateResponse = z$1.infer<typeof hostRetryUpdateResponseSchema>;\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<typeof hostPickFolderRequestSchema>;\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<z$1.ZodLiteral<true>>;\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<z$1.ZodObject<{\n version: z$1.ZodString;\n display: z$1.ZodString;\n }, z$1.core.$strip>>;\n blocked: z$1.ZodOptional<z$1.ZodObject<{\n version: z$1.ZodString;\n reasons: z$1.ZodArray<z$1.ZodString>;\n }, z$1.core.$strip>>;\n detail: z$1.ZodOptional<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype PluginUpdateCheckEntry = z$1.infer<typeof pluginUpdateCheckEntrySchema>;\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<z$1.ZodObject<{\n version: z$1.ZodString;\n display: z$1.ZodString;\n }, z$1.core.$strip>>;\n outcome: z$1.ZodEnum<{\n current: \"current\";\n updated: \"updated\";\n \"rolled-back\": \"rolled-back\";\n }>;\n detail: z$1.ZodOptional<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype PluginApplyUpdateResult$1 = z$1.infer<typeof pluginApplyUpdateResultSchema>;\ndeclare const pluginSourceDetailSchema: z$1.ZodObject<{\n requested: z$1.ZodString;\n resolved: z$1.ZodString;\n integrity: z$1.ZodOptional<z$1.ZodString>;\n registry: z$1.ZodOptional<z$1.ZodString>;\n engines: z$1.ZodObject<{\n bb: z$1.ZodOptional<z$1.ZodString>;\n bbPluginSdk: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>;\n installedAt: z$1.ZodOptional<z$1.ZodNumber>;\n history: z$1.ZodArray<z$1.ZodObject<{\n version: z$1.ZodString;\n activatedAt: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype PluginSourceDetail = z$1.infer<typeof pluginSourceDetailSchema>;\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<z$1.ZodString>;\n sourceDisplay: z$1.ZodString;\n updateState: z$1.ZodObject<{\n outcome: z$1.ZodOptional<z$1.ZodEnum<{\n unavailable: \"unavailable\";\n incompatible: \"incompatible\";\n current: \"current\";\n \"update-available\": \"update-available\";\n pinned: \"pinned\";\n }>>;\n availableVersion: z$1.ZodOptional<z$1.ZodString>;\n blockedVersion: z$1.ZodOptional<z$1.ZodString>;\n blockedReasons: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n lastCheckAt: z$1.ZodOptional<z$1.ZodNumber>;\n lastFailure: z$1.ZodOptional<z$1.ZodObject<{\n version: z$1.ZodString;\n at: z$1.ZodNumber;\n detail: z$1.ZodString;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>;\n enabled: z$1.ZodBoolean;\n description: z$1.ZodNullable<z$1.ZodString>;\n name: z$1.ZodNullable<z$1.ZodString>;\n icon: z$1.ZodNullable<z$1.ZodString>;\n iconUrl: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodObject<{\n name: z$1.ZodString;\n state: z$1.ZodEnum<{\n running: \"running\";\n stopped: \"stopped\";\n backoff: \"backoff\";\n }>;\n }, z$1.core.$strip>>;\n schedules: z$1.ZodArray<z$1.ZodObject<{\n name: z$1.ZodString;\n cron: z$1.ZodString;\n nextRunAt: z$1.ZodNumber;\n lastRunAt: z$1.ZodNullable<z$1.ZodNumber>;\n lastStatus: z$1.ZodNullable<z$1.ZodEnum<{\n error: \"error\";\n running: \"running\";\n ok: \"ok\";\n }>>;\n lastError: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strip>>;\n cliCommand: z$1.ZodNullable<z$1.ZodObject<{\n name: z$1.ZodString;\n summary: z$1.ZodString;\n }, z$1.core.$strip>>;\n capabilities: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{\n kind: z$1.ZodEnum<{\n skill: \"skill\";\n theme: \"theme\";\n \"agent-tool\": \"agent-tool\";\n \"thread-integration\": \"thread-integration\";\n }>;\n id: z$1.ZodString;\n label: z$1.ZodString;\n detail: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strip>>>;\n hasSettings: z$1.ZodBoolean;\n app: z$1.ZodObject<{\n hasApp: z$1.ZodBoolean;\n bundle: z$1.ZodNullable<z$1.ZodObject<{\n jsUrl: z$1.ZodString;\n cssUrl: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n logoDarkUrl: z$1.ZodNullable<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype InstalledPlugin = z$1.infer<typeof installedPluginSchema>;\ndeclare const pluginListResponseSchema: z$1.ZodObject<{\n plugins: z$1.ZodArray<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<z$1.ZodString>;\n sourceDisplay: z$1.ZodString;\n updateState: z$1.ZodObject<{\n outcome: z$1.ZodOptional<z$1.ZodEnum<{\n unavailable: \"unavailable\";\n incompatible: \"incompatible\";\n current: \"current\";\n \"update-available\": \"update-available\";\n pinned: \"pinned\";\n }>>;\n availableVersion: z$1.ZodOptional<z$1.ZodString>;\n blockedVersion: z$1.ZodOptional<z$1.ZodString>;\n blockedReasons: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n lastCheckAt: z$1.ZodOptional<z$1.ZodNumber>;\n lastFailure: z$1.ZodOptional<z$1.ZodObject<{\n version: z$1.ZodString;\n at: z$1.ZodNumber;\n detail: z$1.ZodString;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>;\n enabled: z$1.ZodBoolean;\n description: z$1.ZodNullable<z$1.ZodString>;\n name: z$1.ZodNullable<z$1.ZodString>;\n icon: z$1.ZodNullable<z$1.ZodString>;\n iconUrl: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodObject<{\n name: z$1.ZodString;\n state: z$1.ZodEnum<{\n running: \"running\";\n stopped: \"stopped\";\n backoff: \"backoff\";\n }>;\n }, z$1.core.$strip>>;\n schedules: z$1.ZodArray<z$1.ZodObject<{\n name: z$1.ZodString;\n cron: z$1.ZodString;\n nextRunAt: z$1.ZodNumber;\n lastRunAt: z$1.ZodNullable<z$1.ZodNumber>;\n lastStatus: z$1.ZodNullable<z$1.ZodEnum<{\n error: \"error\";\n running: \"running\";\n ok: \"ok\";\n }>>;\n lastError: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strip>>;\n cliCommand: z$1.ZodNullable<z$1.ZodObject<{\n name: z$1.ZodString;\n summary: z$1.ZodString;\n }, z$1.core.$strip>>;\n capabilities: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{\n kind: z$1.ZodEnum<{\n skill: \"skill\";\n theme: \"theme\";\n \"agent-tool\": \"agent-tool\";\n \"thread-integration\": \"thread-integration\";\n }>;\n id: z$1.ZodString;\n label: z$1.ZodString;\n detail: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strip>>>;\n hasSettings: z$1.ZodBoolean;\n app: z$1.ZodObject<{\n hasApp: z$1.ZodBoolean;\n bundle: z$1.ZodNullable<z$1.ZodObject<{\n jsUrl: z$1.ZodString;\n cssUrl: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n logoDarkUrl: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype PluginListResponse = z$1.infer<typeof pluginListResponseSchema>;\ndeclare const pluginReloadResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral<true>;\n plugins: z$1.ZodArray<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<z$1.ZodString>;\n sourceDisplay: z$1.ZodString;\n updateState: z$1.ZodObject<{\n outcome: z$1.ZodOptional<z$1.ZodEnum<{\n unavailable: \"unavailable\";\n incompatible: \"incompatible\";\n current: \"current\";\n \"update-available\": \"update-available\";\n pinned: \"pinned\";\n }>>;\n availableVersion: z$1.ZodOptional<z$1.ZodString>;\n blockedVersion: z$1.ZodOptional<z$1.ZodString>;\n blockedReasons: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n lastCheckAt: z$1.ZodOptional<z$1.ZodNumber>;\n lastFailure: z$1.ZodOptional<z$1.ZodObject<{\n version: z$1.ZodString;\n at: z$1.ZodNumber;\n detail: z$1.ZodString;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>;\n enabled: z$1.ZodBoolean;\n description: z$1.ZodNullable<z$1.ZodString>;\n name: z$1.ZodNullable<z$1.ZodString>;\n icon: z$1.ZodNullable<z$1.ZodString>;\n iconUrl: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodObject<{\n name: z$1.ZodString;\n state: z$1.ZodEnum<{\n running: \"running\";\n stopped: \"stopped\";\n backoff: \"backoff\";\n }>;\n }, z$1.core.$strip>>;\n schedules: z$1.ZodArray<z$1.ZodObject<{\n name: z$1.ZodString;\n cron: z$1.ZodString;\n nextRunAt: z$1.ZodNumber;\n lastRunAt: z$1.ZodNullable<z$1.ZodNumber>;\n lastStatus: z$1.ZodNullable<z$1.ZodEnum<{\n error: \"error\";\n running: \"running\";\n ok: \"ok\";\n }>>;\n lastError: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strip>>;\n cliCommand: z$1.ZodNullable<z$1.ZodObject<{\n name: z$1.ZodString;\n summary: z$1.ZodString;\n }, z$1.core.$strip>>;\n capabilities: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{\n kind: z$1.ZodEnum<{\n skill: \"skill\";\n theme: \"theme\";\n \"agent-tool\": \"agent-tool\";\n \"thread-integration\": \"thread-integration\";\n }>;\n id: z$1.ZodString;\n label: z$1.ZodString;\n detail: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strip>>>;\n hasSettings: z$1.ZodBoolean;\n app: z$1.ZodObject<{\n hasApp: z$1.ZodBoolean;\n bundle: z$1.ZodNullable<z$1.ZodObject<{\n jsUrl: z$1.ZodString;\n cssUrl: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n logoDarkUrl: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype PluginReloadResponse = z$1.infer<typeof pluginReloadResponseSchema>;\ndeclare const pluginRemoveResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral<true>;\n}, z$1.core.$strip>;\ntype PluginRemoveResponse = z$1.infer<typeof pluginRemoveResponseSchema>;\ndeclare const pluginSettingsResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral<true>;\n schema: z$1.ZodRecord<z$1.ZodString, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"string\">;\n secret: z$1.ZodOptional<z$1.ZodLiteral<true>>;\n default: z$1.ZodOptional<z$1.ZodString>;\n label: z$1.ZodString;\n description: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"boolean\">;\n default: z$1.ZodOptional<z$1.ZodBoolean>;\n label: z$1.ZodString;\n description: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"select\">;\n options: z$1.ZodArray<z$1.ZodString>;\n default: z$1.ZodOptional<z$1.ZodString>;\n label: z$1.ZodString;\n description: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"project\">;\n default: z$1.ZodOptional<z$1.ZodString>;\n label: z$1.ZodString;\n description: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strict>], \"type\">>;\n values: z$1.ZodRecord<z$1.ZodString, z$1.ZodType<JsonValue$1, unknown, z$1.core.$ZodTypeInternals<JsonValue$1, unknown>>>;\n}, z$1.core.$strip>;\ntype PluginSettingsResponse = z$1.infer<typeof pluginSettingsResponseSchema>;\ndeclare const pluginTokenResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral<true>;\n token: z$1.ZodString;\n}, z$1.core.$strip>;\ntype PluginTokenResponse = z$1.infer<typeof pluginTokenResponseSchema>;\ndeclare const pluginCatalogStatusSchema: z$1.ZodObject<{\n pluginCount: z$1.ZodNumber;\n includedPluginCount: z$1.ZodNumber;\n optionalPluginCount: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype PluginCatalogStatus = z$1.infer<typeof pluginCatalogStatusSchema>;\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<z$1.ZodString>;\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<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype PluginCatalogSearchResult$1 = z$1.infer<typeof pluginCatalogSearchResultSchema>;\n\ndeclare const systemExecutionOptionsResponseSchema: z$1.ZodObject<{\n providers: z$1.ZodArray<z$1.ZodObject<{\n id: z$1.ZodString;\n displayName: z$1.ZodString;\n logoUrl: z$1.ZodNullable<z$1.ZodString>;\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 supportsSessionImport: z$1.ZodBoolean;\n supportedPermissionModes: z$1.ZodArray<z$1.ZodEnum<{\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n full: \"full\";\n }>>;\n }, z$1.core.$strip>;\n composerActions: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"skills\">;\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 permissionCeiling: z$1.ZodEnum<{\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n full: \"full\";\n }>;\n models: z$1.ZodArray<z$1.ZodObject<{\n id: z$1.ZodString;\n model: z$1.ZodString;\n displayName: z$1.ZodString;\n description: z$1.ZodString;\n supportedReasoningEfforts: z$1.ZodArray<z$1.ZodObject<{\n reasoningEffort: 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 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<z$1.ZodObject<{\n id: z$1.ZodString;\n model: z$1.ZodString;\n displayName: z$1.ZodString;\n description: z$1.ZodString;\n supportedReasoningEfforts: z$1.ZodArray<z$1.ZodObject<{\n reasoningEffort: 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 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<z$1.ZodObject<{\n providerId: z$1.ZodString;\n code: z$1.ZodEnum<{\n failed: \"failed\";\n missing_executable: \"missing_executable\";\n auth_required: \"auth_required\";\n timeout: \"timeout\";\n }>;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype SystemExecutionOptionsResponse = z$1.infer<typeof systemExecutionOptionsResponseSchema>;\ndeclare const systemExecutionOptionsQuerySchema: z$1.ZodObject<{\n providerId: z$1.ZodOptional<z$1.ZodString>;\n hostId: z$1.ZodOptional<z$1.ZodString>;\n environmentId: z$1.ZodOptional<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype SystemExecutionOptionsQuery = z$1.infer<typeof systemExecutionOptionsQuerySchema>;\n/** Omission preserves the existing behavior of reading the primary machine. */\ndeclare const systemUsageLimitsQuerySchema: z$1.ZodObject<{\n hostId: z$1.ZodOptional<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype SystemUsageLimitsQuery = z$1.infer<typeof systemUsageLimitsQuerySchema>;\ndeclare const systemVoiceTranscriptionResponseSchema: z$1.ZodObject<{\n text: z$1.ZodString;\n}, z$1.core.$strip>;\ntype SystemVoiceTranscriptionResponse = z$1.infer<typeof systemVoiceTranscriptionResponseSchema>;\ndeclare const onboardingAgentOverviewSchema: z$1.ZodObject<{\n agents: z$1.ZodArray<z$1.ZodObject<{\n providerId: z$1.ZodString;\n displayName: z$1.ZodString;\n status: z$1.ZodEnum<{\n connected: \"connected\";\n unauthenticated: \"unauthenticated\";\n expired: \"expired\";\n not_installed: \"not_installed\";\n }>;\n planLabel: z$1.ZodNullable<z$1.ZodString>;\n accountEmail: z$1.ZodNullable<z$1.ZodString>;\n canInstall: z$1.ZodBoolean;\n loginCommand: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype OnboardingAgentOverview = z$1.infer<typeof onboardingAgentOverviewSchema>;\n/** Omission reads the primary machine, matching the usage-limits route. */\ndeclare const systemOnboardingReposQuerySchema: z$1.ZodObject<{\n hostId: z$1.ZodOptional<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype SystemOnboardingReposQuery = z$1.infer<typeof systemOnboardingReposQuerySchema>;\n/**\n * Onboarding funnel events, reported by the app and forwarded to the server's\n * anonymous telemetry. Categorical or counts only — never paths, project names,\n * or account emails.\n */\ndeclare const onboardingTelemetryEventSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n name: z$1.ZodLiteral<\"onboarding_started\">;\n agentState: z$1.ZodEnum<{\n connected: \"connected\";\n none: \"none\";\n signed_out: \"signed_out\";\n }>;\n detectedAgentCount: z$1.ZodNumber;\n}, z$1.core.$strip>, z$1.ZodObject<{\n name: z$1.ZodLiteral<\"onboarding_step_completed\">;\n step: z$1.ZodEnum<{\n agents: \"agents\";\n projects: \"projects\";\n }>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n name: z$1.ZodLiteral<\"onboarding_step_skipped\">;\n step: z$1.ZodEnum<{\n agents: \"agents\";\n projects: \"projects\";\n }>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n name: z$1.ZodLiteral<\"onboarding_completed\">;\n agentState: z$1.ZodEnum<{\n connected: \"connected\";\n none: \"none\";\n signed_out: \"signed_out\";\n }>;\n projectsAdded: z$1.ZodNumber;\n durationMs: z$1.ZodNumber;\n}, z$1.core.$strip>, z$1.ZodObject<{\n name: z$1.ZodLiteral<\"onboarding_dismissed\">;\n step: z$1.ZodEnum<{\n agents: \"agents\";\n projects: \"projects\";\n }>;\n}, z$1.core.$strip>], \"name\">;\ntype OnboardingTelemetryEvent = z$1.infer<typeof onboardingTelemetryEventSchema>;\ndeclare const systemConfigResponseSchema: z$1.ZodObject<{\n generalSettings: z$1.ZodObject<{\n caffeinate: z$1.ZodBoolean;\n showKeyboardHints: z$1.ZodBoolean;\n steerActiveThreadOnEnter: 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 onboardingCompletedAt: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strict>;\n keybindings: z$1.ZodArray<z$1.ZodObject<{\n command: z$1.ZodEnum<{\n \"thread.new\": \"thread.new\";\n \"thread.search\": \"thread.search\";\n \"thread.previous\": \"thread.previous\";\n \"thread.next\": \"thread.next\";\n \"thread.jump.1\": \"thread.jump.1\";\n \"thread.jump.2\": \"thread.jump.2\";\n \"thread.jump.3\": \"thread.jump.3\";\n \"thread.jump.4\": \"thread.jump.4\";\n \"thread.jump.5\": \"thread.jump.5\";\n \"thread.jump.6\": \"thread.jump.6\";\n \"thread.jump.7\": \"thread.jump.7\";\n \"thread.jump.8\": \"thread.jump.8\";\n \"thread.jump.9\": \"thread.jump.9\";\n \"pane.focus.previous\": \"pane.focus.previous\";\n \"pane.focus.next\": \"pane.focus.next\";\n \"pane.focus.1\": \"pane.focus.1\";\n \"pane.focus.2\": \"pane.focus.2\";\n \"pane.focus.3\": \"pane.focus.3\";\n \"pane.focus.4\": \"pane.focus.4\";\n \"pane.focus.5\": \"pane.focus.5\";\n \"pane.focus.6\": \"pane.focus.6\";\n \"pane.focus.7\": \"pane.focus.7\";\n \"pane.focus.8\": \"pane.focus.8\";\n \"pane.maximize.toggle\": \"pane.maximize.toggle\";\n \"pane.close\": \"pane.close\";\n \"window.new\": \"window.new\";\n \"settings.open\": \"settings.open\";\n \"settings.openServers\": \"settings.openServers\";\n \"sidebar.toggle\": \"sidebar.toggle\";\n \"panel.newTab\": \"panel.newTab\";\n \"panel.close\": \"panel.close\";\n \"panel.toggle\": \"panel.toggle\";\n \"file.quickOpen\": \"file.quickOpen\";\n \"diff.toggle\": \"diff.toggle\";\n \"terminal.open\": \"terminal.open\";\n \"composer.focus\": \"composer.focus\";\n \"modelPicker.toggle\": \"modelPicker.toggle\";\n \"modelPicker.cycleModel\": \"modelPicker.cycleModel\";\n \"modelPicker.cycleReasoning\": \"modelPicker.cycleReasoning\";\n \"browser.focusLocation\": \"browser.focusLocation\";\n \"browser.reload\": \"browser.reload\";\n \"workspace.openPreferred\": \"workspace.openPreferred\";\n \"question.select.1\": \"question.select.1\";\n \"question.select.2\": \"question.select.2\";\n \"question.select.3\": \"question.select.3\";\n \"question.select.4\": \"question.select.4\";\n \"question.select.5\": \"question.select.5\";\n \"question.select.6\": \"question.select.6\";\n \"question.select.7\": \"question.select.7\";\n \"question.select.8\": \"question.select.8\";\n \"question.select.9\": \"question.select.9\";\n }>;\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<z$1.ZodEnum<{\n mainSurface: \"mainSurface\";\n modalOpen: \"modalOpen\";\n editableFocus: \"editableFocus\";\n terminalFocus: \"terminalFocus\";\n browserFocus: \"browserFocus\";\n modelPickerOpen: \"modelPickerOpen\";\n questionOpen: \"questionOpen\";\n promptAvailable: \"promptAvailable\";\n splitActive: \"splitActive\";\n webSurface: \"webSurface\";\n macPlatform: \"macPlatform\";\n }>>;\n none: z$1.ZodArray<z$1.ZodEnum<{\n mainSurface: \"mainSurface\";\n modalOpen: \"modalOpen\";\n editableFocus: \"editableFocus\";\n terminalFocus: \"terminalFocus\";\n browserFocus: \"browserFocus\";\n modelPickerOpen: \"modelPickerOpen\";\n questionOpen: \"questionOpen\";\n promptAvailable: \"promptAvailable\";\n splitActive: \"splitActive\";\n webSurface: \"webSurface\";\n macPlatform: \"macPlatform\";\n }>>;\n }, z$1.core.$strict>;\n }, z$1.core.$strict>>;\n defaultKeybindings: z$1.ZodArray<z$1.ZodObject<{\n command: z$1.ZodEnum<{\n \"thread.new\": \"thread.new\";\n \"thread.search\": \"thread.search\";\n \"thread.previous\": \"thread.previous\";\n \"thread.next\": \"thread.next\";\n \"thread.jump.1\": \"thread.jump.1\";\n \"thread.jump.2\": \"thread.jump.2\";\n \"thread.jump.3\": \"thread.jump.3\";\n \"thread.jump.4\": \"thread.jump.4\";\n \"thread.jump.5\": \"thread.jump.5\";\n \"thread.jump.6\": \"thread.jump.6\";\n \"thread.jump.7\": \"thread.jump.7\";\n \"thread.jump.8\": \"thread.jump.8\";\n \"thread.jump.9\": \"thread.jump.9\";\n \"pane.focus.previous\": \"pane.focus.previous\";\n \"pane.focus.next\": \"pane.focus.next\";\n \"pane.focus.1\": \"pane.focus.1\";\n \"pane.focus.2\": \"pane.focus.2\";\n \"pane.focus.3\": \"pane.focus.3\";\n \"pane.focus.4\": \"pane.focus.4\";\n \"pane.focus.5\": \"pane.focus.5\";\n \"pane.focus.6\": \"pane.focus.6\";\n \"pane.focus.7\": \"pane.focus.7\";\n \"pane.focus.8\": \"pane.focus.8\";\n \"pane.maximize.toggle\": \"pane.maximize.toggle\";\n \"pane.close\": \"pane.close\";\n \"window.new\": \"window.new\";\n \"settings.open\": \"settings.open\";\n \"settings.openServers\": \"settings.openServers\";\n \"sidebar.toggle\": \"sidebar.toggle\";\n \"panel.newTab\": \"panel.newTab\";\n \"panel.close\": \"panel.close\";\n \"panel.toggle\": \"panel.toggle\";\n \"file.quickOpen\": \"file.quickOpen\";\n \"diff.toggle\": \"diff.toggle\";\n \"terminal.open\": \"terminal.open\";\n \"composer.focus\": \"composer.focus\";\n \"modelPicker.toggle\": \"modelPicker.toggle\";\n \"modelPicker.cycleModel\": \"modelPicker.cycleModel\";\n \"modelPicker.cycleReasoning\": \"modelPicker.cycleReasoning\";\n \"browser.focusLocation\": \"browser.focusLocation\";\n \"browser.reload\": \"browser.reload\";\n \"workspace.openPreferred\": \"workspace.openPreferred\";\n \"question.select.1\": \"question.select.1\";\n \"question.select.2\": \"question.select.2\";\n \"question.select.3\": \"question.select.3\";\n \"question.select.4\": \"question.select.4\";\n \"question.select.5\": \"question.select.5\";\n \"question.select.6\": \"question.select.6\";\n \"question.select.7\": \"question.select.7\";\n \"question.select.8\": \"question.select.8\";\n \"question.select.9\": \"question.select.9\";\n }>;\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<z$1.ZodEnum<{\n mainSurface: \"mainSurface\";\n modalOpen: \"modalOpen\";\n editableFocus: \"editableFocus\";\n terminalFocus: \"terminalFocus\";\n browserFocus: \"browserFocus\";\n modelPickerOpen: \"modelPickerOpen\";\n questionOpen: \"questionOpen\";\n promptAvailable: \"promptAvailable\";\n splitActive: \"splitActive\";\n webSurface: \"webSurface\";\n macPlatform: \"macPlatform\";\n }>>;\n none: z$1.ZodArray<z$1.ZodEnum<{\n mainSurface: \"mainSurface\";\n modalOpen: \"modalOpen\";\n editableFocus: \"editableFocus\";\n terminalFocus: \"terminalFocus\";\n browserFocus: \"browserFocus\";\n modelPickerOpen: \"modelPickerOpen\";\n questionOpen: \"questionOpen\";\n promptAvailable: \"promptAvailable\";\n splitActive: \"splitActive\";\n webSurface: \"webSurface\";\n macPlatform: \"macPlatform\";\n }>>;\n }, z$1.core.$strict>;\n }, z$1.core.$strict>>;\n keybindingOverrides: z$1.ZodArray<z$1.ZodObject<{\n command: z$1.ZodEnum<{\n \"thread.new\": \"thread.new\";\n \"thread.search\": \"thread.search\";\n \"thread.previous\": \"thread.previous\";\n \"thread.next\": \"thread.next\";\n \"thread.jump.1\": \"thread.jump.1\";\n \"thread.jump.2\": \"thread.jump.2\";\n \"thread.jump.3\": \"thread.jump.3\";\n \"thread.jump.4\": \"thread.jump.4\";\n \"thread.jump.5\": \"thread.jump.5\";\n \"thread.jump.6\": \"thread.jump.6\";\n \"thread.jump.7\": \"thread.jump.7\";\n \"thread.jump.8\": \"thread.jump.8\";\n \"thread.jump.9\": \"thread.jump.9\";\n \"pane.focus.previous\": \"pane.focus.previous\";\n \"pane.focus.next\": \"pane.focus.next\";\n \"pane.focus.1\": \"pane.focus.1\";\n \"pane.focus.2\": \"pane.focus.2\";\n \"pane.focus.3\": \"pane.focus.3\";\n \"pane.focus.4\": \"pane.focus.4\";\n \"pane.focus.5\": \"pane.focus.5\";\n \"pane.focus.6\": \"pane.focus.6\";\n \"pane.focus.7\": \"pane.focus.7\";\n \"pane.focus.8\": \"pane.focus.8\";\n \"pane.maximize.toggle\": \"pane.maximize.toggle\";\n \"pane.close\": \"pane.close\";\n \"window.new\": \"window.new\";\n \"settings.open\": \"settings.open\";\n \"settings.openServers\": \"settings.openServers\";\n \"sidebar.toggle\": \"sidebar.toggle\";\n \"panel.newTab\": \"panel.newTab\";\n \"panel.close\": \"panel.close\";\n \"panel.toggle\": \"panel.toggle\";\n \"file.quickOpen\": \"file.quickOpen\";\n \"diff.toggle\": \"diff.toggle\";\n \"terminal.open\": \"terminal.open\";\n \"composer.focus\": \"composer.focus\";\n \"modelPicker.toggle\": \"modelPicker.toggle\";\n \"modelPicker.cycleModel\": \"modelPicker.cycleModel\";\n \"modelPicker.cycleReasoning\": \"modelPicker.cycleReasoning\";\n \"browser.focusLocation\": \"browser.focusLocation\";\n \"browser.reload\": \"browser.reload\";\n \"workspace.openPreferred\": \"workspace.openPreferred\";\n \"question.select.1\": \"question.select.1\";\n \"question.select.2\": \"question.select.2\";\n \"question.select.3\": \"question.select.3\";\n \"question.select.4\": \"question.select.4\";\n \"question.select.5\": \"question.select.5\";\n \"question.select.6\": \"question.select.6\";\n \"question.select.7\": \"question.select.7\";\n \"question.select.8\": \"question.select.8\";\n \"question.select.9\": \"question.select.9\";\n }>;\n shortcut: z$1.ZodNullable<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 }, z$1.core.$strict>>;\n experiments: z$1.ZodObject<{\n claudeCodeMockCliTraffic: z$1.ZodBoolean;\n newOnboarding: z$1.ZodBoolean;\n toolsHub: z$1.ZodBoolean;\n }, z$1.core.$strip>;\n appearance: z$1.ZodObject<{\n themeId: z$1.ZodString;\n customCss: z$1.ZodNullable<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>;\n customThemes: z$1.ZodArray<z$1.ZodString>;\n pluginThemes: z$1.ZodArray<z$1.ZodObject<{\n id: z$1.ZodString;\n pluginId: z$1.ZodString;\n name: z$1.ZodString;\n description: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strip>>;\n featureFlags: z$1.ZodObject<{\n placeholder: z$1.ZodBoolean;\n timelineWindowEventBudget: z$1.ZodNumber;\n }, z$1.core.$strip>;\n hostDaemonPort: z$1.ZodNullable<z$1.ZodNumber>;\n primaryHostId: z$1.ZodNullable<z$1.ZodString>;\n primaryHostPlatform: z$1.ZodNullable<z$1.ZodEnum<{\n unknown: \"unknown\";\n darwin: \"darwin\";\n linux: \"linux\";\n wsl: \"wsl\";\n }>>;\n voiceTranscriptionEnabled: z$1.ZodBoolean;\n dataDir: z$1.ZodString;\n}, z$1.core.$strip>;\ntype SystemConfigResponse = z$1.infer<typeof systemConfigResponseSchema>;\ndeclare const systemAttentionResponseSchema: z$1.ZodObject<{\n hasAttention: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype SystemAttentionResponse = z$1.infer<typeof systemAttentionResponseSchema>;\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<z$1.ZodString>;\n plugins: z$1.ZodArray<z$1.ZodObject<{\n id: z$1.ZodString;\n pluginId: z$1.ZodString;\n name: z$1.ZodString;\n description: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strip>>;\n active: z$1.ZodObject<{\n themeId: z$1.ZodString;\n customCss: z$1.ZodNullable<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>;\n}, z$1.core.$strip>;\ntype ThemeCatalogResponse = z$1.infer<typeof themeCatalogResponseSchema>;\ndeclare const systemVersionResponseSchema: z$1.ZodObject<{\n currentVersion: z$1.ZodString;\n latestVersion: z$1.ZodNullable<z$1.ZodString>;\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<typeof systemVersionResponseSchema>;\ndeclare const systemConfigReloadResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral<true>;\n}, z$1.core.$strip>;\ndeclare const systemCliSkillsStatusResponseSchema: z$1.ZodObject<{\n machines: z$1.ZodArray<z$1.ZodObject<{\n hostId: z$1.ZodString;\n hostName: z$1.ZodString;\n status: z$1.ZodEnum<{\n unknown: \"unknown\";\n missing: \"missing\";\n installed: \"installed\";\n outdated: \"outdated\";\n }>;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype SystemCliSkillsStatusResponse = z$1.infer<typeof systemCliSkillsStatusResponseSchema>;\n/** The machines to copy the built-in bb CLI skills onto. */\ndeclare const systemInstallCliSkillsRequestSchema: z$1.ZodObject<{\n hostIds: z$1.ZodArray<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype SystemInstallCliSkillsRequest = z$1.infer<typeof systemInstallCliSkillsRequestSchema>;\n/**\n * One entry per requested machine. A machine that is offline or otherwise\n * refuses the install fails on its own without taking the others down, so the\n * caller can report exactly which machines got the skills.\n */\ndeclare const systemInstallCliSkillsResponseSchema: z$1.ZodObject<{\n results: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n ok: z$1.ZodLiteral<true>;\n hostId: z$1.ZodString;\n hostName: z$1.ZodString;\n installations: z$1.ZodArray<z$1.ZodObject<{\n name: z$1.ZodString;\n path: z$1.ZodString;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n ok: z$1.ZodLiteral<false>;\n hostId: z$1.ZodString;\n hostName: z$1.ZodString;\n errorMessage: z$1.ZodString;\n }, z$1.core.$strip>], \"ok\">>;\n}, z$1.core.$strip>;\ntype SystemInstallCliSkillsResponse = z$1.infer<typeof systemInstallCliSkillsResponseSchema>;\ntype SystemConfigReloadResponse = z$1.infer<typeof systemConfigReloadResponseSchema>;\n\ndeclare const terminalSessionSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodNullable<z$1.ZodString>;\n environmentId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodNumber>;\n closeReason: z$1.ZodNullable<z$1.ZodEnum<{\n user: \"user\";\n \"thread-deleted\": \"thread-deleted\";\n \"process-exit\": \"process-exit\";\n \"daemon-disconnect\": \"daemon-disconnect\";\n \"environment-destroyed\": \"environment-destroyed\";\n \"thread-archived\": \"thread-archived\";\n \"open-timeout\": \"open-timeout\";\n }>>;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n lastUserInputAt: z$1.ZodNullable<z$1.ZodNumber>;\n}, z$1.core.$strip>;\ntype TerminalSession = z$1.infer<typeof terminalSessionSchema>;\ndeclare const terminalListResponseSchema: z$1.ZodObject<{\n sessions: z$1.ZodArray<z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodNullable<z$1.ZodString>;\n environmentId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodNumber>;\n closeReason: z$1.ZodNullable<z$1.ZodEnum<{\n user: \"user\";\n \"thread-deleted\": \"thread-deleted\";\n \"process-exit\": \"process-exit\";\n \"daemon-disconnect\": \"daemon-disconnect\";\n \"environment-destroyed\": \"environment-destroyed\";\n \"thread-archived\": \"thread-archived\";\n \"open-timeout\": \"open-timeout\";\n }>>;\n createdAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n lastUserInputAt: z$1.ZodNullable<z$1.ZodNumber>;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype TerminalListResponse = z$1.infer<typeof terminalListResponseSchema>;\ndeclare const createTerminalRequestSchema: z$1.ZodObject<{\n cols: z$1.ZodNumber;\n rows: z$1.ZodNumber;\n start: z$1.ZodOptional<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n mode: z$1.ZodLiteral<\"shell\">;\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<z$1.ZodString>;\n }, z$1.core.$strict>], \"kind\">;\n title: z$1.ZodOptional<z$1.ZodString>;\n}, z$1.core.$strict>;\ntype CreateTerminalRequest = z$1.infer<typeof createTerminalRequestSchema>;\ndeclare const updateTerminalRequestSchema: z$1.ZodObject<{\n title: z$1.ZodString;\n}, z$1.core.$strict>;\ntype UpdateTerminalRequest = z$1.infer<typeof updateTerminalRequestSchema>;\ndeclare const terminalInputRequestSchema: z$1.ZodObject<{\n dataBase64: z$1.ZodString;\n}, z$1.core.$strict>;\ntype TerminalInputRequest = z$1.infer<typeof terminalInputRequestSchema>;\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<typeof terminalResizeRequestSchema>;\ndeclare const terminalOutputQuerySchema: z$1.ZodObject<{\n sinceSeq: z$1.ZodOptional<z$1.ZodCoercedNumber<unknown>>;\n tailBytes: z$1.ZodOptional<z$1.ZodCoercedNumber<unknown>>;\n limitChunks: z$1.ZodOptional<z$1.ZodCoercedNumber<unknown>>;\n}, z$1.core.$strict>;\ntype TerminalOutputQuery = z$1.infer<typeof terminalOutputQuerySchema>;\ndeclare const terminalOutputResponseSchema: z$1.ZodObject<{\n chunks: z$1.ZodArray<z$1.ZodObject<{\n seq: z$1.ZodNumber;\n dataBase64: z$1.ZodString;\n }, z$1.core.$strict>>;\n nextSeq: z$1.ZodNumber;\n truncated: z$1.ZodBoolean;\n}, z$1.core.$strict>;\ntype TerminalOutputResponse = z$1.infer<typeof terminalOutputResponseSchema>;\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<typeof timelineRowStatusSchema>;\ndeclare const timelineRowBaseSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable<z$1.ZodString>;\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<typeof timelineRowBaseSchema>;\ndeclare const timelineConversationRowSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodObject<{\n webImages: z$1.ZodNumber;\n localImages: z$1.ZodNumber;\n localFiles: z$1.ZodNumber;\n imageUrls: z$1.ZodArray<z$1.ZodString>;\n localImagePaths: z$1.ZodArray<z$1.ZodString>;\n localFilePaths: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\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.ZodObject<{\n start: z$1.ZodNumber;\n end: z$1.ZodNumber;\n resource: z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\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<z$1.ZodString>;\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<z$1.ZodObject<{\n webImages: z$1.ZodNumber;\n localImages: z$1.ZodNumber;\n localFiles: z$1.ZodNumber;\n imageUrls: z$1.ZodArray<z$1.ZodString>;\n localImagePaths: z$1.ZodArray<z$1.ZodString>;\n localFilePaths: z$1.ZodArray<z$1.ZodString>;\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<typeof timelineConversationRowSchema>;\ndeclare const timelineSystemRowSchema: z$1.ZodUnion<readonly [z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n status: z$1.ZodNullable<z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>>;\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<z$1.ZodString>;\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<z$1.ZodString>;\n status: z$1.ZodNullable<z$1.ZodEnum<{\n error: \"error\";\n pending: \"pending\";\n completed: \"completed\";\n interrupted: \"interrupted\";\n }>>;\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<z$1.ZodNumber>;\n}, z$1.core.$strip>, z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodString>;\n previousParentThreadTitle: z$1.ZodNullable<z$1.ZodString>;\n nextParentThreadId: z$1.ZodNullable<z$1.ZodString>;\n nextParentThreadTitle: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strip>;\n completedAt: z$1.ZodNullable<z$1.ZodNumber>;\n}, z$1.core.$strip>], \"operationKind\">]>;\ntype TimelineSystemRow = z$1.infer<typeof timelineSystemRowSchema>;\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<z$1.ZodString>;\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<z$1.ZodString>;\n source: z$1.ZodNullable<z$1.ZodString>;\n output: z$1.ZodString;\n exitCode: z$1.ZodNullable<z$1.ZodNumber>;\n completedAt: z$1.ZodNullable<z$1.ZodNumber>;\n approvalStatus: z$1.ZodNullable<z$1.ZodEnum<{\n waiting_for_approval: \"waiting_for_approval\";\n denied: \"denied\";\n }>>;\n activityIntents: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"read\">;\n command: z$1.ZodString;\n name: z$1.ZodString;\n path: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"search\">;\n command: z$1.ZodString;\n query: z$1.ZodNullable<z$1.ZodString>;\n path: z$1.ZodNullable<z$1.ZodString>;\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<typeof timelineCommandWorkRowSchema>;\ndeclare const timelineToolWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodRecord<z$1.ZodString, z$1.ZodType<JsonValue$1, unknown, z$1.core.$ZodTypeInternals<JsonValue$1, unknown>>>>;\n statusLabels: z$1.ZodOptional<z$1.ZodObject<{\n pending: z$1.ZodString;\n completed: z$1.ZodString;\n }, z$1.core.$strip>>;\n output: z$1.ZodString;\n completedAt: z$1.ZodNullable<z$1.ZodNumber>;\n approvalStatus: z$1.ZodNullable<z$1.ZodEnum<{\n waiting_for_approval: \"waiting_for_approval\";\n denied: \"denied\";\n }>>;\n activityIntents: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"read\">;\n command: z$1.ZodString;\n name: z$1.ZodString;\n path: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"search\">;\n command: z$1.ZodString;\n query: z$1.ZodNullable<z$1.ZodString>;\n path: z$1.ZodNullable<z$1.ZodString>;\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<typeof timelineToolWorkRowSchema>;\ndeclare const timelineFileChangeWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n movePath: z$1.ZodNullable<z$1.ZodString>;\n diff: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n stderr: z$1.ZodNullable<z$1.ZodString>;\n approvalStatus: z$1.ZodNullable<z$1.ZodEnum<{\n waiting_for_approval: \"waiting_for_approval\";\n denied: \"denied\";\n }>>;\n}, z$1.core.$strip>;\ntype TimelineFileChangeWorkRow = z$1.infer<typeof timelineFileChangeWorkRowSchema>;\ndeclare const timelineWebSearchWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n completedAt: z$1.ZodNullable<z$1.ZodNumber>;\n}, z$1.core.$strip>;\ntype TimelineWebSearchWorkRow = z$1.infer<typeof timelineWebSearchWorkRowSchema>;\ndeclare const timelineWebFetchWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n pattern: z$1.ZodNullable<z$1.ZodString>;\n completedAt: z$1.ZodNullable<z$1.ZodNumber>;\n}, z$1.core.$strip>;\ntype TimelineWebFetchWorkRow = z$1.infer<typeof timelineWebFetchWorkRowSchema>;\ndeclare const timelineImageViewWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodNumber>;\n}, z$1.core.$strip>;\ntype TimelineImageViewWorkRow = z$1.infer<typeof timelineImageViewWorkRowSchema>;\ndeclare const timelineApprovalWorkRowSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodEnum<{\n turn: \"turn\";\n session: \"session\";\n }>>;\n statusReason: z$1.ZodNullable<z$1.ZodString>;\n}, z$1.core.$strip>], \"approvalKind\">;\ntype TimelineApprovalWorkRow = z$1.infer<typeof timelineApprovalWorkRowSchema>;\ndeclare const timelineQuestionWorkRowSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodObject<{\n id: z$1.ZodString;\n prompt: z$1.ZodString;\n shortLabel: z$1.ZodOptional<z$1.ZodString>;\n multiSelect: z$1.ZodBoolean;\n options: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{\n value: z$1.ZodString;\n label: z$1.ZodString;\n description: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>>>;\n allowFreeText: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\n answers: z$1.ZodNullable<z$1.ZodRecord<z$1.ZodString, z$1.ZodObject<{\n selected: z$1.ZodArray<z$1.ZodString>;\n freeText: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>>>;\n statusReason: z$1.ZodNullable<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype TimelineQuestionWorkRow = z$1.infer<typeof timelineQuestionWorkRowSchema>;\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<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodObject<{\n phases: z$1.ZodArray<z$1.ZodObject<{\n index: z$1.ZodNumber;\n title: z$1.ZodString;\n kind: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>>;\n agents: z$1.ZodArray<z$1.ZodObject<{\n index: z$1.ZodNumber;\n label: z$1.ZodString;\n state: z$1.ZodEnum<{\n running: \"running\";\n failed: \"failed\";\n queued: \"queued\";\n done: \"done\";\n skipped: \"skipped\";\n }>;\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<z$1.ZodNumber>;\n phaseTitle: z$1.ZodOptional<z$1.ZodString>;\n agentType: z$1.ZodOptional<z$1.ZodString>;\n isolation: z$1.ZodOptional<z$1.ZodString>;\n queuedAt: z$1.ZodOptional<z$1.ZodNumber>;\n startedAt: z$1.ZodOptional<z$1.ZodNumber>;\n lastToolName: z$1.ZodOptional<z$1.ZodString>;\n lastToolSummary: z$1.ZodOptional<z$1.ZodString>;\n promptPreview: z$1.ZodOptional<z$1.ZodString>;\n resultPreview: z$1.ZodOptional<z$1.ZodString>;\n error: z$1.ZodOptional<z$1.ZodString>;\n tokens: z$1.ZodOptional<z$1.ZodNumber>;\n toolCalls: z$1.ZodOptional<z$1.ZodNumber>;\n durationMs: z$1.ZodOptional<z$1.ZodNumber>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n usage: z$1.ZodNullable<z$1.ZodObject<{\n totalTokens: z$1.ZodNumber;\n toolUses: z$1.ZodNumber;\n durationMs: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n summary: z$1.ZodNullable<z$1.ZodString>;\n error: z$1.ZodNullable<z$1.ZodString>;\n completedAt: z$1.ZodNullable<z$1.ZodNumber>;\n}, z$1.core.$strip>;\ntype TimelineWorkflowWorkRow = z$1.infer<typeof timelineWorkflowWorkRowSchema>;\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 createExecutionInputSourcesSchema: z$1.ZodObject<{\n providerId: z$1.ZodOptional<z$1.ZodEnum<{\n explicit: \"explicit\";\n \"client-preference\": \"client-preference\";\n }>>;\n model: z$1.ZodOptional<z$1.ZodEnum<{\n explicit: \"explicit\";\n \"client-preference\": \"client-preference\";\n }>>;\n serviceTier: z$1.ZodOptional<z$1.ZodEnum<{\n explicit: \"explicit\";\n \"client-preference\": \"client-preference\";\n }>>;\n reasoningLevel: z$1.ZodOptional<z$1.ZodEnum<{\n explicit: \"explicit\";\n \"client-preference\": \"client-preference\";\n }>>;\n permissionMode: z$1.ZodOptional<z$1.ZodEnum<{\n explicit: \"explicit\";\n \"client-preference\": \"client-preference\";\n }>>;\n}, z$1.core.$strict>;\ntype CreateExecutionInputSources = z$1.infer<typeof createExecutionInputSourcesSchema>;\ndeclare const createThreadRequestSchema: z$1.ZodObject<{\n projectId: z$1.ZodString;\n providerId: z$1.ZodOptional<z$1.ZodString>;\n origin: z$1.ZodEnum<{\n plugin: \"plugin\";\n app: \"app\";\n cli: \"cli\";\n sdk: \"sdk\";\n }>;\n originPluginId: z$1.ZodOptional<z$1.ZodString>;\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n visible: \"visible\";\n hidden: \"hidden\";\n }>>;\n title: z$1.ZodOptional<z$1.ZodString>;\n input: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{\n start: z$1.ZodNumber;\n end: z$1.ZodNumber;\n resource: z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\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<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional<z$1.ZodString>;\n sizeBytes: z$1.ZodOptional<z$1.ZodNumber>;\n mimeType: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>], \"type\">>;\n model: z$1.ZodOptional<z$1.ZodString>;\n serviceTier: z$1.ZodOptional<z$1.ZodEnum<{\n default: \"default\";\n fast: \"fast\";\n }>>;\n reasoningLevel: z$1.ZodOptional<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.ZodOptional<z$1.ZodPipe<z$1.ZodUnion<readonly [z$1.ZodEnum<{\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n full: \"full\";\n }>, z$1.ZodLiteral<\"workspace-write\">]>, z$1.ZodTransform<\"auto\" | \"accept-edits\" | \"full\", \"auto\" | \"accept-edits\" | \"full\" | \"workspace-write\">>>;\n executionInputSources: z$1.ZodOptional<z$1.ZodObject<{\n providerId: z$1.ZodOptional<z$1.ZodEnum<{\n explicit: \"explicit\";\n \"client-preference\": \"client-preference\";\n }>>;\n model: z$1.ZodOptional<z$1.ZodEnum<{\n explicit: \"explicit\";\n \"client-preference\": \"client-preference\";\n }>>;\n serviceTier: z$1.ZodOptional<z$1.ZodEnum<{\n explicit: \"explicit\";\n \"client-preference\": \"client-preference\";\n }>>;\n reasoningLevel: z$1.ZodOptional<z$1.ZodEnum<{\n explicit: \"explicit\";\n \"client-preference\": \"client-preference\";\n }>>;\n permissionMode: z$1.ZodOptional<z$1.ZodEnum<{\n explicit: \"explicit\";\n \"client-preference\": \"client-preference\";\n }>>;\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<z$1.ZodString>;\n workspace: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"unmanaged\">;\n path: z$1.ZodNullable<z$1.ZodString>;\n branch: z$1.ZodOptional<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"existing\">;\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<z$1.ZodString>;\n sectionId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\n sourceThreadId: z$1.ZodOptional<z$1.ZodString>;\n sourceSeqEnd: z$1.ZodOptional<z$1.ZodNumber>;\n startedOnBehalfOf: z$1.ZodDefault<z$1.ZodNullable<z$1.ZodObject<{\n initiator: z$1.ZodEnum<{\n agent: \"agent\";\n system: \"system\";\n }>;\n senderThreadId: z$1.ZodString;\n }, z$1.core.$strip>>>;\n originKind: z$1.ZodDefault<z$1.ZodNullable<z$1.ZodEnum<{\n fork: \"fork\";\n }>>>;\n childOrigin: z$1.ZodDefault<z$1.ZodNullable<z$1.ZodEnum<{\n fork: \"fork\";\n }>>>;\n}, z$1.core.$strip>;\ntype CreateThreadRequest = z$1.infer<typeof createThreadRequestSchema>;\ndeclare const forkThreadRequestSchema: z$1.ZodObject<{\n sourceThreadId: z$1.ZodString;\n sourceSeqEnd: z$1.ZodOptional<z$1.ZodNumber>;\n input: z$1.ZodOptional<z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{\n start: z$1.ZodNumber;\n end: z$1.ZodNumber;\n resource: z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\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<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional<z$1.ZodString>;\n sizeBytes: z$1.ZodOptional<z$1.ZodNumber>;\n mimeType: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>], \"type\">>>;\n agentContextSeed: z$1.ZodOptional<z$1.ZodArray<z$1.ZodIntersection<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{\n start: z$1.ZodNumber;\n end: z$1.ZodNumber;\n resource: z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\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<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional<z$1.ZodString>;\n sizeBytes: z$1.ZodOptional<z$1.ZodNumber>;\n mimeType: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n permissionMode: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodUnion<readonly [z$1.ZodEnum<{\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n full: \"full\";\n }>, z$1.ZodLiteral<\"workspace-write\">]>, z$1.ZodTransform<\"auto\" | \"accept-edits\" | \"full\", \"auto\" | \"accept-edits\" | \"full\" | \"workspace-write\">>>;\n visibility: z$1.ZodDefault<z$1.ZodEnum<{\n visible: \"visible\";\n hidden: \"hidden\";\n }>>;\n workspace: z$1.ZodDefault<z$1.ZodEnum<{\n reuse: \"reuse\";\n isolated: \"isolated\";\n }>>;\n origin: z$1.ZodDefault<z$1.ZodEnum<{\n plugin: \"plugin\";\n app: \"app\";\n cli: \"cli\";\n sdk: \"sdk\";\n }>>;\n originPluginId: z$1.ZodOptional<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype ForkThreadRequest = z$1.infer<typeof forkThreadRequestSchema>;\ndeclare const importThreadRequestSchema: z$1.ZodObject<{\n projectId: z$1.ZodString;\n providerId: z$1.ZodString;\n providerSessionId: z$1.ZodString;\n hostId: z$1.ZodOptional<z$1.ZodString>;\n cwd: z$1.ZodString;\n title: z$1.ZodOptional<z$1.ZodString>;\n permissionMode: z$1.ZodOptional<z$1.ZodPipe<z$1.ZodUnion<readonly [z$1.ZodEnum<{\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n full: \"full\";\n }>, z$1.ZodLiteral<\"workspace-write\">]>, z$1.ZodTransform<\"auto\" | \"accept-edits\" | \"full\", \"auto\" | \"accept-edits\" | \"full\" | \"workspace-write\">>>;\n visibility: z$1.ZodDefault<z$1.ZodEnum<{\n visible: \"visible\";\n hidden: \"hidden\";\n }>>;\n origin: z$1.ZodDefault<z$1.ZodEnum<{\n plugin: \"plugin\";\n app: \"app\";\n cli: \"cli\";\n sdk: \"sdk\";\n }>>;\n originPluginId: z$1.ZodOptional<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype ImportThreadRequest = z$1.infer<typeof importThreadRequestSchema>;\ndeclare const sendMessageRequestSchema: z$1.ZodObject<{\n input: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{\n start: z$1.ZodNumber;\n end: z$1.ZodNumber;\n resource: z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\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<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional<z$1.ZodString>;\n sizeBytes: z$1.ZodOptional<z$1.ZodNumber>;\n mimeType: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>], \"type\">>;\n model: z$1.ZodOptional<z$1.ZodString>;\n serviceTier: z$1.ZodOptional<z$1.ZodEnum<{\n default: \"default\";\n fast: \"fast\";\n }>>;\n reasoningLevel: z$1.ZodOptional<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.ZodOptional<z$1.ZodPipe<z$1.ZodUnion<readonly [z$1.ZodEnum<{\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n full: \"full\";\n }>, z$1.ZodLiteral<\"workspace-write\">]>, z$1.ZodTransform<\"auto\" | \"accept-edits\" | \"full\", \"auto\" | \"accept-edits\" | \"full\" | \"workspace-write\">>>;\n executionInputSources: z$1.ZodOptional<z$1.ZodObject<{\n model: z$1.ZodOptional<z$1.ZodEnum<{\n explicit: \"explicit\";\n \"client-preference\": \"client-preference\";\n }>>;\n serviceTier: z$1.ZodOptional<z$1.ZodEnum<{\n explicit: \"explicit\";\n \"client-preference\": \"client-preference\";\n }>>;\n reasoningLevel: z$1.ZodOptional<z$1.ZodEnum<{\n explicit: \"explicit\";\n \"client-preference\": \"client-preference\";\n }>>;\n permissionMode: z$1.ZodOptional<z$1.ZodEnum<{\n explicit: \"explicit\";\n \"client-preference\": \"client-preference\";\n }>>;\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<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype SendMessageRequest = z$1.infer<typeof sendMessageRequestSchema>;\ndeclare const createQueuedMessageRequestSchema: z$1.ZodObject<{\n input: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{\n start: z$1.ZodNumber;\n end: z$1.ZodNumber;\n resource: z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\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<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional<z$1.ZodString>;\n sizeBytes: z$1.ZodOptional<z$1.ZodNumber>;\n mimeType: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>], \"type\">>;\n model: z$1.ZodOptional<z$1.ZodString>;\n serviceTier: z$1.ZodOptional<z$1.ZodEnum<{\n default: \"default\";\n fast: \"fast\";\n }>>;\n reasoningLevel: z$1.ZodOptional<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.ZodOptional<z$1.ZodPipe<z$1.ZodUnion<readonly [z$1.ZodEnum<{\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n full: \"full\";\n }>, z$1.ZodLiteral<\"workspace-write\">]>, z$1.ZodTransform<\"auto\" | \"accept-edits\" | \"full\", \"auto\" | \"accept-edits\" | \"full\" | \"workspace-write\">>>;\n executionInputSources: z$1.ZodOptional<z$1.ZodObject<{\n model: z$1.ZodOptional<z$1.ZodEnum<{\n explicit: \"explicit\";\n \"client-preference\": \"client-preference\";\n }>>;\n serviceTier: z$1.ZodOptional<z$1.ZodEnum<{\n explicit: \"explicit\";\n \"client-preference\": \"client-preference\";\n }>>;\n reasoningLevel: z$1.ZodOptional<z$1.ZodEnum<{\n explicit: \"explicit\";\n \"client-preference\": \"client-preference\";\n }>>;\n permissionMode: z$1.ZodOptional<z$1.ZodEnum<{\n explicit: \"explicit\";\n \"client-preference\": \"client-preference\";\n }>>;\n }, z$1.core.$strict>>;\n senderThreadId: z$1.ZodOptional<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype CreateQueuedMessageRequest = z$1.infer<typeof createQueuedMessageRequestSchema>;\ndeclare const updateQueuedMessageRequestSchema: z$1.ZodObject<{\n expectedUpdatedAt: z$1.ZodNumber;\n input: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{\n start: z$1.ZodNumber;\n end: z$1.ZodNumber;\n resource: z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\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<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional<z$1.ZodString>;\n sizeBytes: z$1.ZodOptional<z$1.ZodNumber>;\n mimeType: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>], \"type\">>;\n}, z$1.core.$strip>;\ntype UpdateQueuedMessageRequest = z$1.infer<typeof updateQueuedMessageRequestSchema>;\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<typeof sendQueuedMessageRequestSchema>;\ndeclare const reorderQueuedMessageRequestSchema: z$1.ZodObject<{\n previousQueuedMessageId: z$1.ZodNullable<z$1.ZodString>;\n nextQueuedMessageId: z$1.ZodNullable<z$1.ZodString>;\n groupBoundaryQueuedMessageId: z$1.ZodOptional<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype ReorderQueuedMessageRequest = z$1.infer<typeof reorderQueuedMessageRequestSchema>;\ndeclare const setQueuedMessageGroupBoundaryRequestSchema: z$1.ZodObject<{\n expectedGroupedPrefixQueuedMessageIds: z$1.ZodArray<z$1.ZodString>;\n groupBoundaryQueuedMessageId: z$1.ZodString;\n}, z$1.core.$strip>;\ntype SetQueuedMessageGroupBoundaryRequest = z$1.infer<typeof setQueuedMessageGroupBoundaryRequestSchema>;\ndeclare const sendQueuedMessageResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral<true>;\n queuedMessage: z$1.ZodObject<{\n id: z$1.ZodString;\n content: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{\n start: z$1.ZodNumber;\n end: z$1.ZodNumber;\n resource: z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\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<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional<z$1.ZodString>;\n sizeBytes: z$1.ZodOptional<z$1.ZodNumber>;\n mimeType: z$1.ZodOptional<z$1.ZodString>;\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<typeof sendQueuedMessageResponseSchema>;\ndeclare const threadListResponseSchema: z$1.ZodArray<z$1.ZodObject<{\n id: z$1.ZodString;\n projectId: z$1.ZodString;\n environmentId: z$1.ZodNullable<z$1.ZodString>;\n providerId: z$1.ZodString;\n title: z$1.ZodNullable<z$1.ZodString>;\n titleFallback: z$1.ZodNullable<z$1.ZodString>;\n sectionId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n sourceThreadId: z$1.ZodNullable<z$1.ZodString>;\n originKind: z$1.ZodNullable<z$1.ZodEnum<{\n fork: \"fork\";\n }>>;\n childOrigin: z$1.ZodNullable<z$1.ZodEnum<{\n fork: \"fork\";\n }>>;\n originPluginId: z$1.ZodNullable<z$1.ZodString>;\n visibility: z$1.ZodEnum<{\n visible: \"visible\";\n hidden: \"hidden\";\n }>;\n archivedAt: z$1.ZodNullable<z$1.ZodNumber>;\n pinnedAt: z$1.ZodNullable<z$1.ZodNumber>;\n deletedAt: z$1.ZodNullable<z$1.ZodNumber>;\n lastReadAt: z$1.ZodNullable<z$1.ZodNumber>;\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<z$1.ZodNumber>;\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<z$1.ZodString>;\n hasPendingInteraction: z$1.ZodBoolean;\n environmentHostId: z$1.ZodNullable<z$1.ZodString>;\n environmentName: z$1.ZodNullable<z$1.ZodString>;\n environmentBranchName: z$1.ZodNullable<z$1.ZodString>;\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<typeof threadListResponseSchema>;\ndeclare const threadSearchResponseSchema: z$1.ZodObject<{\n active: z$1.ZodObject<{\n total: z$1.ZodNumber;\n results: z$1.ZodArray<z$1.ZodObject<{\n thread: z$1.ZodObject<{\n id: z$1.ZodString;\n projectId: z$1.ZodString;\n environmentId: z$1.ZodNullable<z$1.ZodString>;\n providerId: z$1.ZodString;\n title: z$1.ZodNullable<z$1.ZodString>;\n titleFallback: z$1.ZodNullable<z$1.ZodString>;\n sectionId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n sourceThreadId: z$1.ZodNullable<z$1.ZodString>;\n originKind: z$1.ZodNullable<z$1.ZodEnum<{\n fork: \"fork\";\n }>>;\n childOrigin: z$1.ZodNullable<z$1.ZodEnum<{\n fork: \"fork\";\n }>>;\n originPluginId: z$1.ZodNullable<z$1.ZodString>;\n visibility: z$1.ZodEnum<{\n visible: \"visible\";\n hidden: \"hidden\";\n }>;\n archivedAt: z$1.ZodNullable<z$1.ZodNumber>;\n pinnedAt: z$1.ZodNullable<z$1.ZodNumber>;\n deletedAt: z$1.ZodNullable<z$1.ZodNumber>;\n lastReadAt: z$1.ZodNullable<z$1.ZodNumber>;\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<z$1.ZodNumber>;\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<z$1.ZodString>;\n hasPendingInteraction: z$1.ZodBoolean;\n environmentHostId: z$1.ZodNullable<z$1.ZodString>;\n environmentName: z$1.ZodNullable<z$1.ZodString>;\n environmentBranchName: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodObject<{\n sourceKind: z$1.ZodEnum<{\n title: \"title\";\n title_fallback: \"title_fallback\";\n user_message: \"user_message\";\n assistant_message: \"assistant_message\";\n system_message: \"system_message\";\n }>;\n text: z$1.ZodString;\n highlightRanges: z$1.ZodArray<z$1.ZodObject<{\n start: z$1.ZodNumber;\n end: z$1.ZodNumber;\n }, z$1.core.$strict>>;\n sourceSeq: z$1.ZodNullable<z$1.ZodNumber>;\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<z$1.ZodObject<{\n thread: z$1.ZodObject<{\n id: z$1.ZodString;\n projectId: z$1.ZodString;\n environmentId: z$1.ZodNullable<z$1.ZodString>;\n providerId: z$1.ZodString;\n title: z$1.ZodNullable<z$1.ZodString>;\n titleFallback: z$1.ZodNullable<z$1.ZodString>;\n sectionId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n sourceThreadId: z$1.ZodNullable<z$1.ZodString>;\n originKind: z$1.ZodNullable<z$1.ZodEnum<{\n fork: \"fork\";\n }>>;\n childOrigin: z$1.ZodNullable<z$1.ZodEnum<{\n fork: \"fork\";\n }>>;\n originPluginId: z$1.ZodNullable<z$1.ZodString>;\n visibility: z$1.ZodEnum<{\n visible: \"visible\";\n hidden: \"hidden\";\n }>;\n archivedAt: z$1.ZodNullable<z$1.ZodNumber>;\n pinnedAt: z$1.ZodNullable<z$1.ZodNumber>;\n deletedAt: z$1.ZodNullable<z$1.ZodNumber>;\n lastReadAt: z$1.ZodNullable<z$1.ZodNumber>;\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<z$1.ZodNumber>;\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<z$1.ZodString>;\n hasPendingInteraction: z$1.ZodBoolean;\n environmentHostId: z$1.ZodNullable<z$1.ZodString>;\n environmentName: z$1.ZodNullable<z$1.ZodString>;\n environmentBranchName: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodObject<{\n sourceKind: z$1.ZodEnum<{\n title: \"title\";\n title_fallback: \"title_fallback\";\n user_message: \"user_message\";\n assistant_message: \"assistant_message\";\n system_message: \"system_message\";\n }>;\n text: z$1.ZodString;\n highlightRanges: z$1.ZodArray<z$1.ZodObject<{\n start: z$1.ZodNumber;\n end: z$1.ZodNumber;\n }, z$1.core.$strict>>;\n sourceSeq: z$1.ZodNullable<z$1.ZodNumber>;\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<typeof threadSearchResponseSchema>;\ndeclare const threadResponseSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n projectId: z$1.ZodString;\n environmentId: z$1.ZodNullable<z$1.ZodString>;\n providerId: z$1.ZodString;\n title: z$1.ZodNullable<z$1.ZodString>;\n titleFallback: z$1.ZodNullable<z$1.ZodString>;\n sectionId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n sourceThreadId: z$1.ZodNullable<z$1.ZodString>;\n originKind: z$1.ZodNullable<z$1.ZodEnum<{\n fork: \"fork\";\n }>>;\n childOrigin: z$1.ZodNullable<z$1.ZodEnum<{\n fork: \"fork\";\n }>>;\n originPluginId: z$1.ZodNullable<z$1.ZodString>;\n visibility: z$1.ZodEnum<{\n visible: \"visible\";\n hidden: \"hidden\";\n }>;\n archivedAt: z$1.ZodNullable<z$1.ZodNumber>;\n pinnedAt: z$1.ZodNullable<z$1.ZodNumber>;\n deletedAt: z$1.ZodNullable<z$1.ZodNumber>;\n lastReadAt: z$1.ZodNullable<z$1.ZodNumber>;\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<z$1.ZodNumber>;\n }, z$1.core.$strip>;\n canSpawnChild: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype ThreadResponse = z$1.infer<typeof threadResponseSchema>;\ndeclare const threadGetQuerySchema: z$1.ZodObject<{\n include: z$1.ZodOptional<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype ThreadGetQuery = z$1.infer<typeof threadGetQuerySchema>;\ndeclare const threadWithIncludesResponseSchema: z$1.ZodObject<{\n id: z$1.ZodString;\n projectId: z$1.ZodString;\n environmentId: z$1.ZodNullable<z$1.ZodString>;\n providerId: z$1.ZodString;\n title: z$1.ZodNullable<z$1.ZodString>;\n titleFallback: z$1.ZodNullable<z$1.ZodString>;\n sectionId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n sourceThreadId: z$1.ZodNullable<z$1.ZodString>;\n originKind: z$1.ZodNullable<z$1.ZodEnum<{\n fork: \"fork\";\n }>>;\n childOrigin: z$1.ZodNullable<z$1.ZodEnum<{\n fork: \"fork\";\n }>>;\n originPluginId: z$1.ZodNullable<z$1.ZodString>;\n visibility: z$1.ZodEnum<{\n visible: \"visible\";\n hidden: \"hidden\";\n }>;\n archivedAt: z$1.ZodNullable<z$1.ZodNumber>;\n pinnedAt: z$1.ZodNullable<z$1.ZodNumber>;\n deletedAt: z$1.ZodNullable<z$1.ZodNumber>;\n lastReadAt: z$1.ZodNullable<z$1.ZodNumber>;\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<z$1.ZodNumber>;\n }, z$1.core.$strip>;\n canSpawnChild: z$1.ZodBoolean;\n environment: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodObject<{\n id: z$1.ZodString;\n name: z$1.ZodNullable<z$1.ZodString>;\n projectId: z$1.ZodString;\n hostId: z$1.ZodString;\n path: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\n baseBranch: z$1.ZodNullable<z$1.ZodString>;\n defaultBranch: z$1.ZodNullable<z$1.ZodString>;\n mergeBaseBranch: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodNullable<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 disconnected: \"disconnected\";\n connected: \"connected\";\n }>;\n maxPermissionMode: z$1.ZodEnum<{\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n full: \"full\";\n }>;\n lastSeenAt: z$1.ZodNullable<z$1.ZodNumber>;\n lastRejectedProtocolVersion: z$1.ZodNullable<z$1.ZodNumber>;\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<typeof threadWithIncludesResponseSchema>;\ndeclare const threadPendingInteractionsResponseSchema: z$1.ZodArray<z$1.ZodUnion<readonly [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<z$1.ZodString>;\n createdAt: z$1.ZodNumber;\n expiresAt: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;\n resolvedAt: z$1.ZodNullable<z$1.ZodNumber>;\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<z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"provider\">;\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<readonly [z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"approval\">;\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<z$1.ZodString>;\n actions: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n type: z$1.ZodLiteral<\"read\">;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n type: z$1.ZodLiteral<\"search\">;\n command: z$1.ZodString;\n query: z$1.ZodNullable<z$1.ZodString>;\n path: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodObject<{\n network: z$1.ZodNullable<z$1.ZodObject<{\n enabled: z$1.ZodNullable<z$1.ZodBoolean>;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable<z$1.ZodObject<{\n read: z$1.ZodArray<z$1.ZodString>;\n write: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodString>;\n sessionGrant: z$1.ZodNullable<z$1.ZodObject<{\n network: z$1.ZodNullable<z$1.ZodObject<{\n enabled: z$1.ZodNullable<z$1.ZodBoolean>;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable<z$1.ZodObject<{\n read: z$1.ZodArray<z$1.ZodString>;\n write: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodString>;\n permissions: z$1.ZodObject<{\n network: z$1.ZodNullable<z$1.ZodObject<{\n enabled: z$1.ZodNullable<z$1.ZodBoolean>;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable<z$1.ZodObject<{\n read: z$1.ZodArray<z$1.ZodString>;\n write: z$1.ZodArray<z$1.ZodString>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strict>;\n }, z$1.core.$strip>], \"kind\">;\n reason: z$1.ZodNullable<z$1.ZodString>;\n availableDecisions: z$1.ZodArray<z$1.ZodEnum<{\n allow_once: \"allow_once\";\n allow_for_session: \"allow_for_session\";\n deny: \"deny\";\n }>>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"user_question\">;\n questions: z$1.ZodArray<z$1.ZodObject<{\n id: z$1.ZodString;\n prompt: z$1.ZodString;\n shortLabel: z$1.ZodOptional<z$1.ZodString>;\n multiSelect: z$1.ZodBoolean;\n options: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{\n value: z$1.ZodString;\n label: z$1.ZodString;\n description: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodUnion<readonly [z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n decision: z$1.ZodLiteral<\"allow_once\">;\n grantedPermissions: z$1.ZodNullable<z$1.ZodObject<{\n network: z$1.ZodNullable<z$1.ZodObject<{\n enabled: z$1.ZodNullable<z$1.ZodBoolean>;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable<z$1.ZodObject<{\n read: z$1.ZodArray<z$1.ZodString>;\n write: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodObject<{\n network: z$1.ZodNullable<z$1.ZodObject<{\n enabled: z$1.ZodNullable<z$1.ZodBoolean>;\n }, z$1.core.$strip>>;\n fileSystem: z$1.ZodNullable<z$1.ZodObject<{\n read: z$1.ZodArray<z$1.ZodString>;\n write: z$1.ZodArray<z$1.ZodString>;\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<z$1.ZodString, z$1.ZodObject<{\n selected: z$1.ZodArray<z$1.ZodString>;\n freeText: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n createdAt: z$1.ZodNumber;\n expiresAt: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;\n resolvedAt: z$1.ZodNullable<z$1.ZodNumber>;\n turnId: z$1.ZodNullable<z$1.ZodString>;\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<JsonValue$1, unknown, z$1.core.$ZodTypeInternals<JsonValue$1, unknown>>;\n }, z$1.core.$strip>;\n resolution: z$1.ZodNullable<z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin_submitted\">;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>]>>;\ntype ThreadPendingInteractionsResponse = z$1.infer<typeof threadPendingInteractionsResponseSchema>;\ndeclare const threadQueuedMessageListResponseSchema: z$1.ZodArray<z$1.ZodObject<{\n id: z$1.ZodString;\n content: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"text\">;\n text: z$1.ZodString;\n mentions: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{\n start: z$1.ZodNumber;\n end: z$1.ZodNumber;\n resource: z$1.ZodPipe<z$1.ZodTransform<unknown, unknown>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"thread\">;\n threadId: z$1.ZodString;\n projectId: z$1.ZodOptional<z$1.ZodString>;\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<z$1.ZodString>;\n }, z$1.core.$strip>, z$1.ZodObject<{\n kind: z$1.ZodLiteral<\"plugin\">;\n pluginId: z$1.ZodString;\n icon: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\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<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"image\">;\n url: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localImage\">;\n path: z$1.ZodString;\n }, z$1.core.$strip>, z$1.ZodObject<{\n visibility: z$1.ZodOptional<z$1.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z$1.ZodLiteral<\"localFile\">;\n path: z$1.ZodString;\n name: z$1.ZodOptional<z$1.ZodString>;\n sizeBytes: z$1.ZodOptional<z$1.ZodNumber>;\n mimeType: z$1.ZodOptional<z$1.ZodString>;\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<typeof threadQueuedMessageListResponseSchema>;\ndeclare const threadChildSummaryResponseSchema: z$1.ZodObject<{\n nonDeletedChildCount: z$1.ZodNumber;\n}, z$1.core.$strip>;\ntype ThreadChildSummaryResponse = z$1.infer<typeof threadChildSummaryResponseSchema>;\ndeclare const deleteThreadRequestSchema: z$1.ZodObject<{\n childThreadsConfirmed: z$1.ZodBoolean;\n}, z$1.core.$strip>;\ntype DeleteThreadRequest = z$1.infer<typeof deleteThreadRequestSchema>;\ndeclare const updateThreadRequestSchema: z$1.ZodObject<{\n title: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\n sectionId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\n parentThreadId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\n model: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;\n reasoningLevel: z$1.ZodOptional<z$1.ZodNullable<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 visibility: z$1.ZodOptional<z$1.ZodEnum<{\n visible: \"visible\";\n hidden: \"hidden\";\n }>>;\n}, z$1.core.$strip>;\ntype UpdateThreadRequest = z$1.infer<typeof updateThreadRequestSchema>;\ndeclare const reorderPinnedThreadRequestSchema: z$1.ZodObject<{\n previousThreadId: z$1.ZodNullable<z$1.ZodString>;\n nextThreadId: z$1.ZodNullable<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype ReorderPinnedThreadRequest = z$1.infer<typeof reorderPinnedThreadRequestSchema>;\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<typeof threadOpenSplitSchema>;\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<z$1.ZodNumber>;\n}, z$1.core.$strict>;\ntype ThreadOpenFile = z$1.infer<typeof threadOpenFileSchema>;\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<typeof threadOpenResponseSchema>;\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<typeof threadPaneActionSchema>;\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<typeof threadPaneActionResponseSchema>;\ndeclare const threadArchiveAllResponseSchema: z$1.ZodObject<{\n ok: z$1.ZodLiteral<true>;\n archivedThreadIds: z$1.ZodArray<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype ThreadArchiveAllResponse = z$1.infer<typeof threadArchiveAllResponseSchema>;\ndeclare const threadListQuerySchema: z$1.ZodObject<{\n projectId: z$1.ZodOptional<z$1.ZodString>;\n parentThreadId: z$1.ZodOptional<z$1.ZodString>;\n sourceThreadId: z$1.ZodOptional<z$1.ZodString>;\n archived: z$1.ZodOptional<z$1.ZodEnum<{\n true: \"true\";\n false: \"false\";\n }>>;\n sectionId: z$1.ZodOptional<z$1.ZodString>;\n unsectioned: z$1.ZodOptional<z$1.ZodEnum<{\n true: \"true\";\n false: \"false\";\n }>>;\n hasParent: z$1.ZodOptional<z$1.ZodEnum<{\n true: \"true\";\n false: \"false\";\n }>>;\n originKind: z$1.ZodOptional<z$1.ZodEnum<{\n fork: \"fork\";\n }>>;\n originPluginId: z$1.ZodOptional<z$1.ZodString>;\n childOrigin: z$1.ZodOptional<z$1.ZodEnum<{\n fork: \"fork\";\n }>>;\n includeHidden: z$1.ZodOptional<z$1.ZodEnum<{\n true: \"true\";\n false: \"false\";\n }>>;\n limit: z$1.ZodOptional<z$1.ZodString>;\n offset: z$1.ZodOptional<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype ThreadListQuery = z$1.infer<typeof threadListQuerySchema>;\ndeclare const threadSearchQuerySchema: z$1.ZodObject<{\n query: z$1.ZodString;\n limitPerGroup: z$1.ZodOptional<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype ThreadSearchQuery = z$1.infer<typeof threadSearchQuerySchema>;\ndeclare const threadTimelineQuerySchema: z$1.ZodObject<{\n includeNestedRows: z$1.ZodOptional<z$1.ZodEnum<{\n true: \"true\";\n false: \"false\";\n }>>;\n segmentLimit: z$1.ZodOptional<z$1.ZodString>;\n beforeAnchorSeq: z$1.ZodOptional<z$1.ZodString>;\n beforeAnchorId: z$1.ZodOptional<z$1.ZodString>;\n summaryOnly: z$1.ZodOptional<z$1.ZodEnum<{\n true: \"true\";\n false: \"false\";\n }>>;\n afterSequence: z$1.ZodOptional<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype ThreadTimelineQuery = z$1.infer<typeof threadTimelineQuerySchema>;\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<typeof timelineTurnSummaryDetailsQuerySchema>;\ndeclare const threadStorageFilesQuerySchema: z$1.ZodObject<{\n query: z$1.ZodOptional<z$1.ZodString>;\n limit: z$1.ZodOptional<z$1.ZodString>;\n}, z$1.core.$strip>;\ntype ThreadStorageFilesQuery = z$1.infer<typeof threadStorageFilesQuerySchema>;\ndeclare const threadStoragePathsQuerySchema: z$1.ZodObject<{\n query: z$1.ZodOptional<z$1.ZodString>;\n limit: z$1.ZodOptional<z$1.ZodString>;\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<typeof threadStoragePathsQuerySchema>;\ndeclare const timelineTurnSummaryDetailsResponseSchema: z$1.ZodObject<{\n rows: z$1.ZodArray<z$1.ZodType<TimelineRow, unknown, z$1.core.$ZodTypeInternals<TimelineRow, unknown>>>;\n}, z$1.core.$strip>;\ntype TimelineTurnSummaryDetailsResponse = z$1.infer<typeof timelineTurnSummaryDetailsResponseSchema>;\ndeclare const threadTimelineResponseSchema: z$1.ZodObject<{\n rows: z$1.ZodArray<z$1.ZodType<TimelineRow, unknown, z$1.core.$ZodTypeInternals<TimelineRow, unknown>>>;\n activePromptMode: z$1.ZodNullable<z$1.ZodObject<{\n mode: z$1.ZodLiteral<\"plan\">;\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<z$1.ZodObject<{\n id: z$1.ZodString;\n text: z$1.ZodString;\n startedAt: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n activeWorkflows: z$1.ZodArray<z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodObject<{\n phases: z$1.ZodArray<z$1.ZodObject<{\n index: z$1.ZodNumber;\n title: z$1.ZodString;\n kind: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>>;\n agents: z$1.ZodArray<z$1.ZodObject<{\n index: z$1.ZodNumber;\n label: z$1.ZodString;\n state: z$1.ZodEnum<{\n running: \"running\";\n failed: \"failed\";\n queued: \"queued\";\n done: \"done\";\n skipped: \"skipped\";\n }>;\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<z$1.ZodNumber>;\n phaseTitle: z$1.ZodOptional<z$1.ZodString>;\n agentType: z$1.ZodOptional<z$1.ZodString>;\n isolation: z$1.ZodOptional<z$1.ZodString>;\n queuedAt: z$1.ZodOptional<z$1.ZodNumber>;\n startedAt: z$1.ZodOptional<z$1.ZodNumber>;\n lastToolName: z$1.ZodOptional<z$1.ZodString>;\n lastToolSummary: z$1.ZodOptional<z$1.ZodString>;\n promptPreview: z$1.ZodOptional<z$1.ZodString>;\n resultPreview: z$1.ZodOptional<z$1.ZodString>;\n error: z$1.ZodOptional<z$1.ZodString>;\n tokens: z$1.ZodOptional<z$1.ZodNumber>;\n toolCalls: z$1.ZodOptional<z$1.ZodNumber>;\n durationMs: z$1.ZodOptional<z$1.ZodNumber>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n usage: z$1.ZodNullable<z$1.ZodObject<{\n totalTokens: z$1.ZodNumber;\n toolUses: z$1.ZodNumber;\n durationMs: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n summary: z$1.ZodNullable<z$1.ZodString>;\n error: z$1.ZodNullable<z$1.ZodString>;\n completedAt: z$1.ZodNullable<z$1.ZodNumber>;\n }, z$1.core.$strip>>;\n activeBackgroundCommands: z$1.ZodArray<z$1.ZodObject<{\n id: z$1.ZodString;\n threadId: z$1.ZodString;\n turnId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodString>;\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<z$1.ZodObject<{\n phases: z$1.ZodArray<z$1.ZodObject<{\n index: z$1.ZodNumber;\n title: z$1.ZodString;\n kind: z$1.ZodOptional<z$1.ZodString>;\n }, z$1.core.$strip>>;\n agents: z$1.ZodArray<z$1.ZodObject<{\n index: z$1.ZodNumber;\n label: z$1.ZodString;\n state: z$1.ZodEnum<{\n running: \"running\";\n failed: \"failed\";\n queued: \"queued\";\n done: \"done\";\n skipped: \"skipped\";\n }>;\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<z$1.ZodNumber>;\n phaseTitle: z$1.ZodOptional<z$1.ZodString>;\n agentType: z$1.ZodOptional<z$1.ZodString>;\n isolation: z$1.ZodOptional<z$1.ZodString>;\n queuedAt: z$1.ZodOptional<z$1.ZodNumber>;\n startedAt: z$1.ZodOptional<z$1.ZodNumber>;\n lastToolName: z$1.ZodOptional<z$1.ZodString>;\n lastToolSummary: z$1.ZodOptional<z$1.ZodString>;\n promptPreview: z$1.ZodOptional<z$1.ZodString>;\n resultPreview: z$1.ZodOptional<z$1.ZodString>;\n error: z$1.ZodOptional<z$1.ZodString>;\n tokens: z$1.ZodOptional<z$1.ZodNumber>;\n toolCalls: z$1.ZodOptional<z$1.ZodNumber>;\n durationMs: z$1.ZodOptional<z$1.ZodNumber>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n usage: z$1.ZodNullable<z$1.ZodObject<{\n totalTokens: z$1.ZodNumber;\n toolUses: z$1.ZodNumber;\n durationMs: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n summary: z$1.ZodNullable<z$1.ZodString>;\n error: z$1.ZodNullable<z$1.ZodString>;\n completedAt: z$1.ZodNullable<z$1.ZodNumber>;\n }, z$1.core.$strip>>;\n pendingTodos: z$1.ZodNullable<z$1.ZodObject<{\n sourceSeq: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n items: z$1.ZodArray<z$1.ZodObject<{\n id: z$1.ZodString;\n text: z$1.ZodString;\n status: z$1.ZodEnum<{\n pending: \"pending\";\n completed: \"completed\";\n in_progress: \"in_progress\";\n }>;\n }, z$1.core.$strip>>;\n }, z$1.core.$strip>>;\n goal: z$1.ZodNullable<z$1.ZodObject<{\n sourceSeq: z$1.ZodNumber;\n updatedAt: z$1.ZodNumber;\n objective: z$1.ZodString;\n status: z$1.ZodEnum<{\n active: \"active\";\n paused: \"paused\";\n budgetLimited: \"budgetLimited\";\n complete: \"complete\";\n }>;\n tokenBudget: z$1.ZodNullable<z$1.ZodNumber>;\n tokensUsed: z$1.ZodNumber;\n timeUsedSeconds: z$1.ZodNumber;\n }, z$1.core.$strip>>;\n modelFallback: z$1.ZodNullable<z$1.ZodObject<{\n sourceSeq: z$1.ZodNumber;\n detectedAt: z$1.ZodNumber;\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>>;\n contextWindowUsage: z$1.ZodOptional<z$1.ZodObject<{\n usedTokens: z$1.ZodNumber;\n modelContextWindow: z$1.ZodNumber;\n estimated: z$1.ZodBoolean;\n }, z$1.core.$strip>>;\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<z$1.ZodObject<{\n anchorSeq: z$1.ZodNumber;\n anchorId: z$1.ZodString;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>;\n maxSeq: z$1.ZodNumber;\n delta: z$1.ZodOptional<z$1.ZodObject<{\n upsertRows: z$1.ZodArray<z$1.ZodType<TimelineRow, unknown, z$1.core.$ZodTypeInternals<TimelineRow, unknown>>>;\n rowOrder: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;\n }, z$1.core.$strip>>;\n}, z$1.core.$strip>;\ntype ThreadTimelineResponse = z$1.infer<typeof threadTimelineResponseSchema>;\ndeclare const threadConversationOutlineResponseSchema: z$1.ZodObject<{\n items: z$1.ZodArray<z$1.ZodObject<{\n id: z$1.ZodString;\n role: z$1.ZodEnum<{\n user: \"user\";\n assistant: \"assistant\";\n }>;\n preview: z$1.ZodString;\n attachmentSummary: z$1.ZodNullable<z$1.ZodObject<{\n imageCount: z$1.ZodNumber;\n fileCount: z$1.ZodNumber;\n }, z$1.core.$strict>>;\n }, z$1.core.$strict>>;\n maxSeq: z$1.ZodNumber;\n}, z$1.core.$strict>;\ntype ThreadConversationOutlineResponse = z$1.infer<typeof threadConversationOutlineResponseSchema>;\ndeclare const threadStorageFileListResponseSchema: z$1.ZodObject<{\n files: z$1.ZodArray<z$1.ZodObject<{\n path: z$1.ZodString;\n name: z$1.ZodString;\n }, z$1.core.$strip>>;\n truncated: z$1.ZodBoolean;\n storageRootPath: z$1.ZodString;\n}, z$1.core.$strip>;\ntype ThreadStorageFileListResponse = z$1.infer<typeof threadStorageFileListResponseSchema>;\ndeclare const threadStoragePathListResponseSchema: z$1.ZodObject<{\n paths: z$1.ZodArray<z$1.ZodObject<{\n kind: z$1.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z$1.ZodString;\n name: z$1.ZodString;\n score: z$1.ZodNumber;\n positions: z$1.ZodArray<z$1.ZodNumber>;\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<typeof threadStoragePathListResponseSchema>;\n\ndeclare const threadTabsResponseSchema: z$1.ZodObject<{\n revision: z$1.ZodNumber;\n tabs: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"thread-info\">;\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<z$1.ZodString>;\n pluginId: z$1.ZodString;\n title: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable<z$1.ZodString>;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"workspace-file-preview\">;\n lineRange: z$1.ZodNullable<z$1.ZodObject<{\n endLineNumber: z$1.ZodNumber;\n startLineNumber: z$1.ZodNumber;\n }, z$1.core.$strict>>;\n path: z$1.ZodString;\n projectId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodLiteral<\"deleted\">>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable<z$1.ZodString>;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"host-file-preview\">;\n lineRange: z$1.ZodNullable<z$1.ZodObject<{\n endLineNumber: z$1.ZodNumber;\n startLineNumber: z$1.ZodNumber;\n }, z$1.core.$strict>>;\n path: z$1.ZodString;\n threadId: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable<z$1.ZodString>;\n id: z$1.ZodString;\n isPinned: z$1.ZodBoolean;\n kind: z$1.ZodLiteral<\"thread-storage-file-preview\">;\n lineRange: z$1.ZodNullable<z$1.ZodObject<{\n endLineNumber: z$1.ZodNumber;\n startLineNumber: z$1.ZodNumber;\n }, z$1.core.$strict>>;\n path: z$1.ZodString;\n threadId: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable<z$1.ZodString>;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"browser\">;\n title: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodNumber>;\n threadId: z$1.ZodNullable<z$1.ZodString>;\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<typeof threadTabsResponseSchema>;\ndeclare const updateThreadTabsRequestSchema: z$1.ZodObject<{\n expectedRevision: z$1.ZodNumber;\n tabs: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"thread-info\">;\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<z$1.ZodString>;\n pluginId: z$1.ZodString;\n title: z$1.ZodString;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable<z$1.ZodString>;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"workspace-file-preview\">;\n lineRange: z$1.ZodNullable<z$1.ZodObject<{\n endLineNumber: z$1.ZodNumber;\n startLineNumber: z$1.ZodNumber;\n }, z$1.core.$strict>>;\n path: z$1.ZodString;\n projectId: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodLiteral<\"deleted\">>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable<z$1.ZodString>;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"host-file-preview\">;\n lineRange: z$1.ZodNullable<z$1.ZodObject<{\n endLineNumber: z$1.ZodNumber;\n startLineNumber: z$1.ZodNumber;\n }, z$1.core.$strict>>;\n path: z$1.ZodString;\n threadId: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable<z$1.ZodString>;\n id: z$1.ZodString;\n isPinned: z$1.ZodBoolean;\n kind: z$1.ZodLiteral<\"thread-storage-file-preview\">;\n lineRange: z$1.ZodNullable<z$1.ZodObject<{\n endLineNumber: z$1.ZodNumber;\n startLineNumber: z$1.ZodNumber;\n }, z$1.core.$strict>>;\n path: z$1.ZodString;\n threadId: z$1.ZodNullable<z$1.ZodString>;\n }, z$1.core.$strict>, z$1.ZodObject<{\n environmentId: z$1.ZodNullable<z$1.ZodString>;\n id: z$1.ZodString;\n kind: z$1.ZodLiteral<\"browser\">;\n title: z$1.ZodNullable<z$1.ZodString>;\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<z$1.ZodNumber>;\n threadId: z$1.ZodNullable<z$1.ZodString>;\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<typeof updateThreadTabsRequestSchema>;\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/** 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<Input = unknown, Output = Input> {\n readonly \"~standard\": {\n readonly version: 1;\n readonly vendor: string;\n readonly validate: (value: unknown) => StandardSchemaV1Result<Output> | Promise<StandardSchemaV1Result<Output>>;\n readonly types?: {\n readonly input: Input;\n readonly output: Output;\n };\n };\n}\ntype StandardSchemaV1Result<Output> = {\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<Schema extends StandardSchemaV1> = NonNullable<Schema[\"~standard\"][\"types\"]>[\"input\"];\ntype StandardSchemaV1InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema[\"~standard\"][\"types\"]>[\"output\"];\ninterface PluginRpcMethodContract<InputSchema extends StandardSchemaV1 = StandardSchemaV1, OutputSchema extends StandardSchemaV1 = StandardSchemaV1> {\n readonly input: InputSchema;\n readonly output: OutputSchema;\n}\ntype PluginRpcContract = Readonly<Record<string, PluginRpcMethodContract>>;\n/** Define a shared RPC contract while preserving exact method/schema types. */\ndeclare function defineRpcContract<const Contract extends PluginRpcContract>(contract: Contract): Contract;\ntype PluginRpcHandlers<Contract extends PluginRpcContract> = {\n [Method in keyof Contract]: (input: StandardSchemaV1InferOutput<Contract[Method][\"input\"]>) => StandardSchemaV1InferInput<Contract[Method][\"output\"]> | Promise<StandardSchemaV1InferInput<Contract[Method][\"output\"]>>;\n};\ntype PluginRpcCallInput<Method extends PluginRpcMethodContract> = StandardSchemaV1InferInput<Method[\"input\"]>;\ntype PluginRpcCallArgs<Method extends PluginRpcMethodContract> = null extends PluginRpcCallInput<Method> ? [input?: PluginRpcCallInput<Method>] : [input: PluginRpcCallInput<Method>];\ntype PluginRpcResult<Method extends PluginRpcMethodContract> = StandardSchemaV1InferOutput<Method[\"output\"]>;\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/<pluginId>/<path>/*`, 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<void>;\n cancel(): Promise<void>;\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 * Props passed to an `experimental_threadList` component — the sidebar's\n * scrolling thread area, replaced wholesale by one plugin.\n */\ninterface PluginThreadListProps {\n /** The thread the route currently shows; null on non-thread routes. */\n activeThreadId: string | null;\n /** The project the route currently shows; null when none is selected. */\n activeProjectId: string | null;\n /** True on phone-width viewports and coarse pointers. */\n isCompactViewport: boolean;\n /**\n * Call after the user opens a thread. Closes the mobile sidebar drawer and\n * is a no-op on desktop, so always call it.\n */\n onNavigate: () => void;\n /**\n * The host search field's current text, or \"\" when the field is closed.\n * The host owns that field, so a plugin list filters by this rather than\n * shipping a second search box.\n */\n searchQuery: string;\n}\n/**\n * Props passed to an `experimental_threadHeaderAction` component, rendered in\n * the thread header's action row.\n */\ninterface PluginThreadHeaderActionProps {\n /**\n * The thread this header belongs to. Never null: the slot is not rendered\n * on the compose screen or other non-thread routes. A split layout renders\n * one header per pane, so the component mounts once per visible thread,\n * each with its own id — keep per-thread state in the component, never in a\n * module-level singleton.\n */\n threadId: string;\n projectId: string;\n /**\n * True on phone-width viewports and coarse pointers. Collapse to an\n * icon-sized control when it is true — the row is short.\n */\n isCompactViewport: boolean;\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<Record<string, string>>;\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<PluginHomepageSectionProps>;\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<PluginSettingsSectionProps>;\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/<pluginId>/`; letters, digits, `-`, `_`. */\n path: string;\n component: ComponentType<PluginNavPanelProps>;\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<PluginNavPanelProps>;\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<PluginThreadPanelProps>;\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 * `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<void>;\n}\ninterface PluginPendingInteractionRegistration {\n /** Matches `rendererId` passed to `bb.ui.requestInput`. */\n id: string;\n component: ComponentType<PluginPendingInteractionProps>;\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<void>;\n}\n/**\n * The one status bb would paint for a thread, already resolved through the\n * host's precedence (attention before work; plan and goal before the generic\n * spinner). Draw your own glyph for it — the SDK ships no status component.\n *\n * Treat an unrecognized value as \"none\": bb adds kinds over time, and an\n * older plugin must degrade to drawing nothing rather than throwing.\n *\n * \"draft\" and \"working-draft\" are never reported here: an unsubmitted composer\n * draft is per-client state the host reads per row, which an array-wide view\n * cannot. A thread holding a draft reports whatever it would report without\n * one.\n */\ntype PluginSidebarThreadIndicator = \"unread-error\" | \"waiting-for-input\" | \"working-draft\" | \"workflow\" | \"background-agent\" | \"background-command\" | \"plan-mode\" | \"goal\" | \"runtime\" | \"draft\" | \"unread-success\" | \"none\";\n/**\n * How a thread's environment presents its workspace: a worktree bb manages,\n * a worktree the user manages, or anything else (a plain checkout).\n */\ntype PluginSidebarWorkspaceKind = \"managed-worktree\" | \"unmanaged-worktree\" | \"other\";\n/** Live work counts on a thread. All zero means nothing is running. */\ninterface PluginSidebarThreadActivity {\n workflows: number;\n backgroundAgents: number;\n backgroundCommands: number;\n planMode: number;\n goals: number;\n}\n/**\n * One thread in the sidebar's live view.\n *\n * A deliberate copy of the fields a sidebar needs — not a re-export of the\n * host's internal thread row type, which changes whenever the app needs a\n * field. Timestamps are epoch milliseconds.\n */\ninterface PluginSidebarThread {\n id: string;\n projectId: string;\n /** Null while a thread is still unnamed; pair with `titleFallback`. */\n title: string | null;\n titleFallback: string | null;\n /** The thread this one was forked from or spawned under; null at the root. */\n parentThreadId: string | null;\n sectionId: string | null;\n /** How this thread came to exist under its parent; null for root threads. */\n originKind: \"fork\" | \"side-chat\" | null;\n /** The plugin that spawned it, or null for non-plugin origins. */\n originPluginId: string | null;\n /** The agent provider this thread runs on, e.g. \"codex\", \"claude-code\". */\n providerId: string;\n /** The agent is blocked on the user: an approval or a question. */\n hasPendingInteraction: boolean;\n activity: PluginSidebarThreadActivity;\n indicator: PluginSidebarThreadIndicator;\n /**\n * The host's accessible label for `indicator`, e.g. \"Thread needs user\n * input\"; null when the indicator is \"none\". Use it for `aria-label` so\n * screen-reader text stays consistent across sidebars.\n */\n indicatorLabel: string | null;\n isUnread: boolean;\n isPinned: boolean;\n isArchived: boolean;\n environment: {\n id: string | null;\n name: string | null;\n branchName: string | null;\n workspaceDisplayKind: PluginSidebarWorkspaceKind;\n } | null;\n /**\n * The machine this thread's work runs on, with the name resolved for you.\n * Null when the thread has no environment yet, or when its host is not in\n * the known-hosts list. Useful where a thread has no branch to show — a\n * personal-project thread has a machine but no worktree.\n */\n host: {\n id: string;\n name: string;\n } | null;\n createdAt: number;\n updatedAt: number;\n lastReadAt: number | null;\n latestAttentionAt: number;\n}\n/**\n * The pull request for a thread's branch, narrowed to what a sidebar row\n * needs. `attention` is bb's rolled-up \"does this need you\" signal, so a row\n * can colour a badge without reading checks, review, and mergeability itself.\n */\ninterface PluginSidebarPullRequest {\n number: number;\n title: string;\n url: string;\n state: \"draft\" | \"open\" | \"merged\" | \"closed\";\n attention: \"checks_failed\" | \"checks_pending\" | \"changes_requested\" | \"review_requested\" | \"conflicts\" | \"blocked\" | \"draft\" | \"ready_to_merge\" | \"merged\" | \"closed\" | \"none\";\n}\ninterface PluginSidebarThreadPullRequestState {\n /** True while the first lookup for this thread's environment is in flight. */\n isLoading: boolean;\n /**\n * The pull request, or null when the branch has none, the thread has no\n * environment, or the lookup could not run (a git-host hiccup). A row should\n * treat null as \"nothing to show\", never as an error.\n */\n pullRequest: PluginSidebarPullRequest | null;\n}\n/** One project in the sidebar's live view. */\ninterface PluginSidebarProject {\n id: string;\n name: string;\n /** True for the implicit personal project. */\n isPersonal: boolean;\n}\ninterface PluginSidebarThreadsState {\n status: \"loading\" | \"ready\" | \"error\";\n threads: readonly PluginSidebarThread[];\n projects: readonly PluginSidebarProject[];\n}\n/**\n * Act on threads from a plugin surface. Every method routes to the host's own\n * flow, so optimistic updates, toasts, dialogs, pane closing, and route repair\n * behave exactly as they do in the built-in sidebar. Unknown thread ids are\n * ignored by `open` and rejected by the rest.\n */\ninterface PluginSidebarThreadActions {\n /**\n * Navigate to a thread. `split: true` applies bb's split placement rules —\n * a right split by default, focus when the thread is already open, replace\n * at the pane cap — and falls back to plain navigation where splits are off.\n */\n open(threadId: string, options?: {\n split?: boolean;\n }): void;\n /**\n * Go to the new-thread screen. Passing `projectId` also makes that project\n * the composer's selection, so the thread is created where you asked.\n */\n openNewThread(options?: {\n projectId?: string;\n focusPrompt?: boolean;\n }): void;\n setPinned(threadId: string, pinned: boolean): Promise<void>;\n setRead(threadId: string, read: boolean): Promise<void>;\n /** Silent rename — no dialog. For inline editing in your own row. */\n rename(threadId: string, title: string): Promise<void>;\n /** Archives the thread AND its children, closing any panes showing them. */\n archive(threadId: string): void;\n /**\n * Opens bb's delete confirmation, which counts child threads first. Deletion\n * is destructive and recursive, so the host owns the confirmation: there is\n * deliberately no silent `delete`.\n */\n requestDelete(threadId: string): void;\n}\n/**\n * Render a plugin component in the thread header's action row.\n *\n * The frontend sibling of the backend `bb.ui.registerThreadAction`, which\n * renders a host-owned button and runs server-side. Use that one for \"do a\n * thing\"; use this one when the control must draw live state.\n *\n * The host places it at the left end of the action row, before the workspace\n * button, git actions, the panel toggle, maximize, and close. That row is a\n * 48px chrome row with 28px controls: render one inline control that fits, and\n * put anything taller in a portalled popover.\n */\ninterface PluginThreadHeaderActionRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /**\n * Names the region the host wraps around your component (a labelled group).\n * It does NOT label your control: an icon-only button still needs its own\n * accessible name.\n */\n title: string;\n component: ComponentType<PluginThreadHeaderActionProps>;\n}\n/** One pane's place in the split layout, as fractions of the split area. */\ninterface PluginSidebarSplitPane {\n paneId: string;\n rect: {\n x: number;\n y: number;\n width: number;\n height: number;\n };\n /** This pane holds the thread the row represents. */\n isMe: boolean;\n isFocused: boolean;\n}\n/**\n * Drag-to-split support for one row, plus where that thread currently sits in\n * the split layout.\n */\ninterface PluginSidebarThreadSplit {\n /**\n * Spread onto the row's interactive element. Carries the pointer handler\n * that starts a split drag; empty when splits are unavailable, so spreading\n * it is always safe.\n *\n * The host owns every rule: the gesture engages only once the pointer leaves\n * the sidebar toward the main area (so a list with its own drag-to-reorder\n * keeps working), an edge drop splits, a center drop replaces, an\n * already-open thread focuses its pane, and the pane cap coerces a split\n * into a replace.\n */\n splitProps: {\n onPointerDown?: (event: react.PointerEvent<HTMLElement>) => void;\n };\n /**\n * False on compact viewports, when the user disabled splits, and for an\n * unknown thread id. Gate any \"open in split\" affordance you draw on it.\n */\n isAvailable: boolean;\n /**\n * Where this thread sits in the split layout, or null when it is not open in\n * one (including single-pane layouts). Draw a mini-map, a tint, or nothing.\n */\n layout: {\n panes: readonly PluginSidebarSplitPane[];\n } | null;\n}\n/**\n * Replace the sidebar's thread list with a plugin component.\n *\n * Unlike every other slot, this one is EXCLUSIVE: two lists cannot share one\n * scroll area. The built-in list stays the default; the user picks a provider\n * in Settings → Appearance, stored per client. A provider that is uninstalled,\n * disabled, or crashing falls back to the built-in list rather than leaving\n * the user with no sidebar.\n *\n * The plugin gets the scrolling list and nothing else. The New-thread button,\n * the search field, the plugin nav rows, and the footer stay host-rendered in\n * every sidebar — they are shared surfaces (other plugins live in two of\n * them), and a replaced list must not be able to remove them.\n */\ninterface PluginThreadListRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Label in the Settings → Appearance → Sidebar picker. */\n title: string;\n /** Optional one-line description under the title in that picker. */\n description?: string;\n component: ComponentType<PluginThreadListProps>;\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<PluginFileOpenerProps>;\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<PluginMessageDirectiveProps>;\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().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<void>;\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 /**\n * Replace the sidebar's thread list (see\n * {@link PluginThreadListRegistration}). Experimental: see\n * docs/api_to_audit.md for what to audit before the prefix drops.\n */\n experimental_threadList(registration: PluginThreadListRegistration): void;\n /**\n * Render a component in the thread header's action row (see\n * {@link PluginThreadHeaderActionRegistration}). Experimental: see\n * docs/api_to_audit.md.\n */\n experimental_threadHeaderAction(registration: PluginThreadHeaderActionRegistration): void;\n fileOpener(registration: PluginFileOpenerRegistration): void;\n messageDirective(registration: PluginMessageDirectiveRegistration): void;\n 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 * Persistently decorate any thread row for this plugin generation.\n *\n * The status is owned by the frontend generation and therefore survives\n * route changes. Passing `null` clears the plugin's status for that thread.\n * The host clears every remaining status when the frontend generation\n * deactivates.\n *\n * Optional so bundles can feature-detect support while this experimental\n * surface rolls out across 0.x clients.\n */\n readonly experimental_setThreadRowStatus?: (threadId: string, status: PluginComposerThreadRowStatus | null) => void;\n}\n/** Cleanup returned by a frontend content script. */\ntype PluginContentScriptDisposer = () => void | Promise<void>;\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<void | PluginContentScriptDisposer>;\n}\n/** Lifecycle surface for trusted frontend content scripts. */\ninterface PluginAppContentScripts {\n register(registration: PluginContentScriptRegistration): void;\n}\ninterface PluginAppBuilder {\n slots: PluginAppSlots;\n composer: PluginAppComposer;\n 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<Contract extends PluginRpcContract = PluginRpcContract> {\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 extends Extract<keyof Contract, string>>(method: Method, ...args: PluginRpcCallArgs<Contract[Method]>): Promise<PluginRpcResult<Contract[Method]>>;\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<string, string | boolean> | 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<void>;\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 * 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<void>;\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 /**\n * Who controls the permission mode sends run with. \"inherit\" (default)\n * pins every send to the thread's own resolved default and renders the\n * picker as a dimmed label — a plugin surface can never widen it.\n * \"editable\" gives this chat its own picker, so the user can raise or\n * lower permissions for this thread independently of the thread it was\n * forked from. Ignored by `variant: \"timeline\"` (no composer).\n */\n permissionPolicy?: \"inherit\" | \"editable\";\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 * Every selection the composer resolved, JSON-serializable so a plugin can\n * forward it to its own backend rpc verbatim and hand it straight to\n * `bb.sdk.threads.spawn`.\n *\n * The split is deliberate: the composer owns *user selections*, the plugin\n * owns *filing and attribution*. `bb.sdk.threads.spawn` auto-fills\n * `origin: \"plugin\"` and `originPluginId`, so a thread created this way stays\n * attributed to the plugin — which it would not be if the component created\n * the thread itself. The plugin adds `sectionId`, `parentThreadId`, `title`,\n * and `visibility` to the request on its own; they are deliberately not\n * composer props.\n */\ninterface NewThreadRequest {\n projectId: string;\n providerId: string;\n model: string;\n reasoningLevel: ReasoningLevel;\n permissionMode: PermissionMode;\n /** Omitted when the selected provider has no service tiers. */\n serviceTier?: ServiceTier;\n /**\n * Per-field provenance (caller-explicit vs. default) for the execution\n * options above, forwarded to `spawn` so the server records what the user\n * actually chose.\n */\n executionInputSources: CreateExecutionInputSources;\n environment: CreateThreadEnvironmentArgs;\n input: PromptInput[];\n}\n/**\n * Props of the host-owned `experimental_NewThreadComposer` component — bb's\n * full new-thread compose surface (prompt editor with @-mentions and expand,\n * attachments, provider/model/reasoning picker, voice, submit, and the row\n * beneath with project, environment, branch-from, and permission mode),\n * rendered by the BB app inside a plugin slot.\n *\n * It is the create-side counterpart to `ThreadChat`: same deliberate\n * exception to the no-host-components rule (§5.5), same additive versioning.\n */\ninterface NewThreadComposerProps {\n /** Seeds the project picker. The user can change it. */\n defaultProjectId?: string;\n /**\n * Seeds the provider picker. Like every `default*` prop this is a SEED, not\n * a controlled value: the composer stays uncontrolled, the user can change\n * it, and when omitted the composer falls back to the project's remembered\n * execution defaults exactly as before. When provided it takes precedence\n * over those project defaults.\n *\n * Re-seeding: the `default*` props are value-compared each render. When any\n * of them changes after mount, the composer re-seeds EVERY execution and\n * environment selection from the new props — including selections the user\n * had already touched — so switching between two saved records in the same\n * mounted composer reloads that record's values (the same rule\n * `defaultProjectId` already follows).\n *\n * Every seeded field is reported as caller-explicit in the submitted\n * request's `executionInputSources`. That is what makes the seed survive\n * `threads.spawn`: the server drops a requested `providerId`/`model` that\n * carries no provenance source and re-derives it from the project's stored\n * defaults, which would silently undo the seed.\n */\n defaultProviderId?: string;\n /** Seeds the model picker. Same seed semantics as {@link defaultProviderId}. */\n defaultModel?: string;\n /**\n * Seeds the reasoning-level picker. Same seed semantics as\n * {@link defaultProviderId}. If the seeded model does not support this\n * level, the composer reconciles to the closest supported one.\n */\n defaultReasoningLevel?: ReasoningLevel;\n /**\n * Seeds the service-tier picker. Same seed semantics as\n * {@link defaultProviderId}. Ignored (and omitted from the submitted\n * request) when the selected provider has no service tiers.\n */\n defaultServiceTier?: ServiceTier;\n /** Seeds the permission-mode picker. Same seed semantics as {@link defaultProviderId}. */\n defaultPermissionMode?: PermissionMode;\n /**\n * Seeds the environment and branch pickers from a previously submitted\n * `NewThreadRequest.environment`. Same seed semantics as\n * {@link defaultProviderId}: a seed the user can change, taking precedence\n * over the composer's own environment default when provided.\n *\n * Round trip: feeding a submitted request's `environment` back in and\n * resubmitting untouched reproduces an equivalent environment, with these\n * documented limits — the composer cannot represent every args variant:\n *\n * - `{ type: \"project-default\" }` seeds nothing; the composer resolves its\n * own default and submits that concrete environment instead.\n * - A `host` environment whose host no longer exists (or whose project has\n * no source on it) falls back to the composer's default host, exactly as\n * the primary compose surface would.\n * - A `reuse` environment whose worktree no longer has unarchived threads\n * falls back the same way.\n * - An `unmanaged` workspace's `path` has no composer control; the seeded\n * selection submits `path: null` (the host's configured checkout). The\n * composer itself never produces a non-null `path`, so real round trips\n * are unaffected.\n * - A `managed-worktree` with `baseBranch: { kind: \"default\" }` leaves the\n * branch picker on its default, which may resolve to a named base branch\n * when the project configures a dedicated worktree base — the same branch\n * the original `default` submission would have created from.\n */\n defaultEnvironment?: CreateThreadEnvironmentArgs;\n /** Seeds the draft, only while the draft is still empty. */\n initialPrompt?: string;\n placeholder?: string;\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 editor. */\n focusRequest?: number;\n className?: string;\n /**\n * Where the draft persists. Drafts survive reloads and are shared by every\n * composer using the same key; defaults to a key scoped to this plugin.\n */\n draftKey?: string;\n /**\n * Fires on submit with every selection resolved. The draft clears when this\n * resolves and is KEPT if it throws, so a failed create never loses what the\n * user typed.\n */\n onSubmit: (request: NewThreadRequest) => void | Promise<void>;\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 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<Contract extends PluginRpcContract = PluginRpcContract>(): PluginRpcClient<Contract>;\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 sidebar's live thread view (see {@link PluginSidebarThreadsState}).\n * Reads the host's own cache and realtime subscriptions, so it costs no\n * extra request and updates exactly when the built-in sidebar does.\n * Experimental: see docs/api_to_audit.md.\n */\n experimental_useSidebarThreads(): PluginSidebarThreadsState;\n /**\n * Thread actions bound to the host's mutations (see\n * {@link PluginSidebarThreadActions}). Experimental: see\n * docs/api_to_audit.md.\n */\n experimental_useSidebarThreadActions(): PluginSidebarThreadActions;\n /**\n * The pull request for one thread's branch (see\n * {@link PluginSidebarThreadPullRequestState}).\n *\n * Per row and opt-in, because it costs a git-host lookup: it is NOT on the\n * thread payload every sidebar loads. Threads sharing an environment share\n * one query, and the host owns the polling and staleness rules — an open PR\n * with pending checks refreshes, a merged one does not.\n *\n * Experimental: see docs/api_to_audit.md.\n */\n experimental_useSidebarThreadPullRequest(threadId: string): PluginSidebarThreadPullRequestState;\n /**\n * Per-row drag-to-split support (see {@link PluginSidebarThreadSplit}).\n * Call it once per rendered row, like the built-in sidebar does.\n * Experimental: see docs/api_to_audit.md.\n */\n experimental_useSidebarThreadSplit(threadId: string): PluginSidebarThreadSplit;\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 ThreadChat: ComponentType<ThreadChatProps>;\n /**\n * The host-owned chat-message markdown renderer (see\n * {@link MarkdownProps}).\n */\n Markdown: ComponentType<MarkdownProps>;\n /**\n * The host-owned new-thread compose surface (see\n * {@link NewThreadComposerProps}). Experimental: see\n * docs/api_to_audit.md for what to audit before the prefix drops.\n */\n experimental_NewThreadComposer: ComponentType<NewThreadComposerProps>;\n useComposerView(): ComposerView;\n}\n\ninterface EnvironmentActionArgs {\n environmentId: string;\n}\ninterface EnvironmentGetArgs extends EnvironmentActionArgs {\n signal?: AbortSignal;\n}\ntype EnvironmentMergeBaseBranchUpdateValue = Exclude<UpdateEnvironmentRequest[\"mergeBaseBranch\"], undefined>;\ntype EnvironmentNameUpdateValue = Exclude<UpdateEnvironmentRequest[\"name\"], undefined>;\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<EnvironmentArchiveThreadsResult>;\n commit(args: EnvironmentCommitArgs): Promise<EnvironmentCommitResult>;\n diff(args: EnvironmentDiffArgs): Promise<EnvironmentDiffResult>;\n diffBranches(args: EnvironmentDiffBranchesArgs): Promise<EnvironmentDiffBranchesResult>;\n diffFile(args: EnvironmentDiffFileArgs): Promise<EnvironmentDiffFileResult>;\n diffFiles(args: EnvironmentDiffArgs): Promise<EnvironmentDiffFilesResult>;\n diffPatch(args: EnvironmentDiffPatchArgs): Promise<EnvironmentDiffPatchResult>;\n get(args: EnvironmentGetArgs): Promise<EnvironmentGetResult>;\n pullRequest(args: EnvironmentGetArgs): Promise<EnvironmentPullRequestResult>;\n markPullRequestDraft(args: EnvironmentActionArgs): Promise<EnvironmentMarkPullRequestDraftResult>;\n markPullRequestReady(args: EnvironmentActionArgs): Promise<EnvironmentMarkPullRequestReadyResult>;\n mergePullRequest(args: EnvironmentPullRequestMergeArgs): Promise<EnvironmentMergePullRequestResult>;\n paths(args: EnvironmentPathsArgs): Promise<EnvironmentPathsResult>;\n squashMerge(args: EnvironmentSquashMergeArgs): Promise<EnvironmentSquashMergeResult>;\n status(args: EnvironmentStatusArgs): Promise<EnvironmentStatusResult>;\n update(args: EnvironmentUpdateArgs): Promise<EnvironmentUpdateResult>;\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<FileReadResult>;\n write(args: FileWriteArgs): Promise<FileWriteResult>;\n list(args: FileListArgs): Promise<FileListResult>;\n listPaths(args: PathListArgs): Promise<PathListResult>;\n mkdir(args: FileMkdirArgs): Promise<FileMkdirResult>;\n move(args: FileMoveArgs): Promise<FileMoveResult>;\n remove(args: FileRemoveArgs): Promise<FileRemoveResult>;\n createPreview(args: FilePreviewArgs): Promise<FilePreviewResult>;\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<HostCreateJoinCodeResult>;\n delete(args: HostDeleteArgs): Promise<HostDeleteResult>;\n directory(args: HostDirectoryArgs): Promise<HostDirectoryResult>;\n get(args: HostGetArgs): Promise<HostGetResult>;\n cloneDefaultPath(args: HostCloneDefaultPathArgs): Promise<HostCloneDefaultPathResult>;\n installProviderCli(args: HostProviderCliInstallArgs): Promise<HostProviderCliInstallResult>;\n list(args?: HostListArgs): Promise<HostListResult>;\n pathsExist(args: HostPathsExistArgs): Promise<HostPathsExistResult>;\n pickFolder(args: HostPickFolderArgs): Promise<HostPickFolderResult>;\n providerCliStatus(args: HostGetArgs): Promise<HostProviderCliStatusResult>;\n retryUpdate(args: HostRetryUpdateArgs): Promise<HostRetryUpdateResult>;\n update(args: HostUpdateArgs): Promise<HostUpdateResult>;\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<ProjectFilesQuery, \"environmentId\" | \"hostId\"> & {\n projectId: string;\n signal?: AbortSignal;\n};\ntype ProjectPathsArgs = ProjectWorkspaceRoutingArgs & Omit<ProjectPathsQuery, \"environmentId\" | \"hostId\"> & {\n projectId: string;\n signal?: AbortSignal;\n};\ntype ProjectCommandsArgs = ProjectWorkspaceRoutingArgs & Omit<ProjectCommandsQuery, \"environmentId\" | \"hostId\"> & {\n projectId: string;\n signal?: AbortSignal;\n};\ntype ProjectFileContentArgs = ProjectWorkspaceRoutingArgs & Omit<ProjectFileContentQuery, \"environmentId\" | \"hostId\"> & {\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<ArrayBuffer>;\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<ProjectSourceAddResult>;\n delete(args: ProjectSourceDeleteArgs): Promise<ProjectSourceDeleteResult>;\n update(args: ProjectSourceUpdateArgs): Promise<ProjectSourceUpdateResult>;\n}\ninterface ProjectAttachmentsArea {\n copy(args: ProjectAttachmentCopyArgs): Promise<void>;\n read(args: ProjectAttachmentReadArgs): Promise<ProjectAttachmentReadResult>;\n upload(args: ProjectAttachmentUploadArgs): Promise<ProjectAttachmentUploadResult>;\n}\ninterface ProjectsArea {\n attachments: ProjectAttachmentsArea;\n branches(args: ProjectBranchesArgs): Promise<ProjectBranchesResult>;\n commands(args: ProjectCommandsArgs): Promise<ProjectCommandsResult>;\n create(args: ProjectCreateArgs): Promise<ProjectCreateResult>;\n defaultExecutionOptions(args: ProjectDefaultExecutionOptionsArgs): Promise<ProjectDefaultExecutionOptionsResult>;\n delete(args: ProjectDeleteArgs): Promise<ProjectDeleteResult>;\n fileContent(args: ProjectFileContentArgs): Promise<ProjectFileContentResult>;\n files(args: ProjectFilesArgs): Promise<ProjectFilesResult>;\n get(args: ProjectGetArgs): Promise<ProjectGetResult>;\n list(args?: ProjectListArgs): Promise<ProjectListResult>;\n paths(args: ProjectPathsArgs): Promise<ProjectPathsResult>;\n promptHistory(args: ProjectPromptHistoryArgs): Promise<ProjectPromptHistoryResult>;\n reorder(args: ProjectReorderArgs): Promise<ProjectReorderResult>;\n sources: ProjectSourcesArea;\n update(args: ProjectUpdateArgs): Promise<ProjectUpdateResult>;\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<ProviderListResult>;\n /** List models on the environment host, explicit host, or primary host. */\n models(args?: ProviderModelsArgs): Promise<ProviderModelsResult>;\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<string, JsonValue$1>;\n}\ninterface PluginTokenArgs extends PluginIdArgs {\n rotate?: boolean;\n}\ninterface PluginCheckUpdatesArgs {\n pluginId?: string;\n signal?: AbortSignal;\n}\ninterface PluginRpcArgs<TOutput> extends PluginIdArgs {\n input?: JsonValue$1;\n method: string;\n outputSchema: z$1.ZodType<TOutput>;\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<PluginInstallResult>;\n search(args: PluginCatalogSearchArgs): Promise<PluginCatalogSearchResult>;\n status(args?: PluginCatalogStatusArgs): Promise<PluginCatalogStatusResult>;\n}\ninterface PluginsArea {\n applyUpdate(args: PluginIdArgs): Promise<PluginApplyUpdateResult>;\n callRpc<TOutput>(args: PluginRpcArgs<TOutput>): Promise<TOutput>;\n checkUpdates(args?: PluginCheckUpdatesArgs): Promise<PluginCheckUpdatesResult>;\n catalog: PluginCatalogArea;\n disable(args: PluginIdArgs): Promise<PluginDisableResult>;\n enable(args: PluginIdArgs): Promise<PluginEnableResult>;\n getSettings(args: PluginGetSettingsArgs): Promise<PluginGetSettingsResult>;\n getSource(args: PluginGetSourceArgs): Promise<PluginGetSourceResult>;\n install(args: PluginInstallArgs): Promise<PluginInstallResult>;\n list(args?: PluginListArgs): Promise<PluginListResult>;\n listUpdateResults(args?: PluginListUpdateResultsArgs): Promise<PluginCheckUpdatesResult>;\n reload(args?: PluginReloadArgs): Promise<PluginReloadResult>;\n remove(args: PluginIdArgs): Promise<PluginRemoveResult>;\n token(args: PluginTokenArgs): Promise<PluginTokenResult>;\n updateSettings(args: PluginSettingsUpdateArgs): Promise<PluginUpdateSettingsResult>;\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<ChangedMessage, {\n entity: \"thread\";\n}>;\ntype ProjectRealtimeEvent = Extract<ChangedMessage, {\n entity: \"project\";\n}>;\ntype EnvironmentRealtimeEvent = Extract<ChangedMessage, {\n entity: \"environment\";\n}>;\ntype HostRealtimeEvent = Extract<ChangedMessage, {\n entity: \"host\";\n}>;\ntype SystemRealtimeEvent = Extract<ChangedMessage, {\n entity: \"system\";\n}>;\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<TEventName extends BbRealtimeEventName> = (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<TEventName extends BbRealtimeEventName = BbRealtimeEventName> = Extract<BbRealtimeSubscribeArgsUnion, {\n event: TEventName;\n}>;\ninterface BbRealtime {\n subscribe<TEventName extends BbRealtimeEventName>(args: BbRealtimeSubscribeArgs<TEventName>): 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<StatusResult>;\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}\n/**\n * Registry calls proxy out to skills.sh and GitHub, and the browse grid fans\n * out one per card. Callers pass their query's AbortSignal so abandoning a\n * page cancels its requests instead of leaving them in flight.\n */\ninterface AbortableArgs {\n signal?: AbortSignal;\n}\ninterface RegistrySkillsSearchArgs extends AbortableArgs {\n query?: string;\n page?: number;\n perPage?: number;\n}\ninterface RegistrySkillIdArgs extends AbortableArgs {\n registrySkillId: string;\n}\ninterface RegistrySkillSourceArgs extends AbortableArgs {\n source: string;\n skillId: string;\n}\ninterface RegistryRepositoryArgs extends AbortableArgs {\n source: string;\n}\n/**\n * Install is a mutation and deliberately takes no signal: its body is parsed\n * with a strict schema, so an extra key would throw at runtime.\n */\ninterface RegistrySkillInstallArgs {\n registrySkillId: string;\n}\ninterface SkillsRegistryArea {\n detail(args: RegistrySkillSourceArgs): Promise<RegistrySkillDetail>;\n get(args: RegistrySkillIdArgs): Promise<RegistrySkill>;\n install(args: RegistrySkillInstallArgs): Promise<RegistrySkillInstallResponse>;\n repositoryStars(args: RegistryRepositoryArgs): Promise<RegistryRepositoryStars>;\n search(args?: RegistrySkillsSearchArgs): Promise<RegistrySkillsPage>;\n}\ninterface SkillsArea {\n getContent(args: SkillContentArgs): Promise<SkillContentResponse>;\n list(args: SkillListArgs): Promise<SkillListResponse>;\n listFiles(args: SkillIdentityArgs): Promise<SkillFilesResponse>;\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<ThemeGetResult>;\n /** The custom-theme directory plus discovered themes and the active palette. */\n catalog(args?: ThemeCatalogArgs): Promise<ThemeCatalogResult>;\n /** Set the complete app appearance selection in one request. */\n set(selection: ThemeSetInput): Promise<ThemeSetResult>;\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<ThemeSetResult>;\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 SystemInstallCliSkillsArgs = SystemInstallCliSkillsRequest;\ninterface SystemCliSkillsStatusArgs {\n /** Omit for every enrolled machine. */\n hostIds?: readonly string[];\n signal?: AbortSignal;\n}\ntype SystemCliSkillsStatusResult = SystemCliSkillsStatusResponse;\ntype SystemInstallCliSkillsResult = SystemInstallCliSkillsResponse;\ntype SystemVoiceTranscriptionResult = SystemVoiceTranscriptionResponse;\ntype SystemUpdateExperimentsResult = Experiments;\ntype SystemUpdateGeneralSettingsResult = AppSettings;\ntype SystemUpdateKeyboardSettingsResult = AppKeybindingOverrides;\ntype SystemUsageLimitsResult = ProviderUsageResponse;\ninterface SystemOnboardingArgs extends SystemOnboardingReposQuery {\n signal?: AbortSignal;\n}\ntype SystemOnboardingAgentsResult = OnboardingAgentOverview;\ntype SystemOnboardingReposResult = DiscoverReposResult;\ntype SystemVersionResult = SystemVersionResponse;\ninterface SystemArea {\n attention(args?: SystemAttentionArgs): Promise<SystemAttentionResult>;\n config(args?: SystemConfigArgs): Promise<SystemConfigResult>;\n executionOptions(args?: SystemExecutionOptionsArgs): Promise<SystemExecutionOptionsResult>;\n /**\n * Copy bb's built-in CLI skills into each named machine's global agent skill\n * roots (`~/.agents/skills` and `~/.claude/skills`). Machines install\n * independently; the result reports each machine's outcome.\n */\n /** Per-machine install state of bb's built-in CLI skills. */\n cliSkillsStatus(args?: SystemCliSkillsStatusArgs): Promise<SystemCliSkillsStatusResult>;\n installCliSkills(args: SystemInstallCliSkillsArgs): Promise<SystemInstallCliSkillsResult>;\n reloadConfig(): Promise<SystemReloadConfigResult>;\n transcribeVoice(args: SystemVoiceTranscriptionArgs): Promise<SystemVoiceTranscriptionResult>;\n updateExperiments(args: Experiments): Promise<SystemUpdateExperimentsResult>;\n updateGeneralSettings(args: AppSettings): Promise<SystemUpdateGeneralSettingsResult>;\n updateKeyboardSettings(args: AppKeybindingOverrides): Promise<SystemUpdateKeyboardSettingsResult>;\n /** Report one onboarding funnel event to anonymous telemetry. */\n onboardingEvent(args: OnboardingTelemetryEvent): Promise<{\n ok: true;\n }>;\n /** Live agent state for onboarding: install, auth, and plan per provider. */\n onboardingAgents(args?: SystemOnboardingArgs): Promise<SystemOnboardingAgentsResult>;\n /** Candidate projects discovered on the host, ranked for onboarding. */\n onboardingRepos(args?: SystemOnboardingArgs): Promise<SystemOnboardingReposResult>;\n usageLimits(args?: SystemUsageLimitsArgs): Promise<SystemUsageLimitsResult>;\n version(args?: SystemVersionArgs): Promise<SystemVersionResult>;\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<TerminalCloseResult>;\n create(args: TerminalCreateArgs): Promise<TerminalCreateResult>;\n get(args: TerminalGetArgs): Promise<TerminalGetResult>;\n input(args: TerminalInputArgs): Promise<TerminalInputResult>;\n list(args: TerminalListArgs): Promise<TerminalListResult>;\n output(args: TerminalOutputArgs): Promise<TerminalOutputResult>;\n rename(args: TerminalRenameArgs): Promise<TerminalRenameResult>;\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<TerminalRestartResult>;\n resize(args: TerminalResizeArgs): Promise<TerminalResizeResult>;\n}\n\ninterface ThreadListArgs {\n archived?: boolean;\n sectionId?: string;\n hasParent?: boolean;\n includeHidden?: boolean;\n limit?: number;\n offset?: number;\n originKind?: ThreadListQuery[\"originKind\"];\n originPluginId?: string;\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 ThreadImportResult = 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<CreateThreadRequest, \"childOrigin\" | \"input\" | \"origin\" | \"originKind\" | \"startedOnBehalfOf\"> {\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<ForkThreadRequest, \"origin\" | \"visibility\" | \"workspace\"> {\n origin?: ForkThreadRequest[\"origin\"];\n visibility?: ForkThreadRequest[\"visibility\"];\n workspace?: ForkThreadRequest[\"workspace\"];\n}\ninterface ThreadImportArgs extends Omit<ImportThreadRequest, \"origin\" | \"visibility\"> {\n origin?: ImportThreadRequest[\"origin\"];\n visibility?: ImportThreadRequest[\"visibility\"];\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$1;\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<ThreadEventWaitResult>;\n matched: true;\n target: Extract<ThreadWaitTarget, {\n kind: \"event\";\n }>;\n threadId: string;\n} | {\n matched: true;\n target: Extract<ThreadWaitTarget, {\n kind: \"status\";\n }>;\n thread: ThreadGetResult;\n threadId: string;\n};\ninterface ThreadInteractionsArea {\n cancel(args: ThreadInteractionTargetArgs): Promise<ThreadInteractionCancelResult>;\n get(args: ThreadInteractionGetArgs): Promise<ThreadInteractionGetResult>;\n list(args: ThreadInteractionListArgs): Promise<ThreadInteractionListResult>;\n resolve(args: ThreadInteractionResolveArgs): Promise<ThreadInteractionResolveResult>;\n respond(args: ThreadInteractionRespondArgs): Promise<ThreadInteractionRespondResult>;\n}\ninterface ThreadEventsArea {\n list(args: ThreadEventsListArgs): Promise<ThreadEventsListResult>;\n wait(args: ThreadEventWaitArgs): Promise<ThreadEventWaitResult>;\n}\ninterface ThreadQueuedMessagesArea {\n create(args: ThreadQueuedMessageCreateArgs): Promise<ThreadQueuedMessageCreateResult>;\n delete(args: ThreadQueuedMessageTargetArgs): Promise<ThreadQueuedMessageDeleteResult>;\n list(args: ThreadQueuedMessageArgs): Promise<ThreadQueuedMessagesResult>;\n reorder(args: ThreadQueuedMessageReorderArgs): Promise<ThreadQueuedMessageReorderResult>;\n send(args: ThreadQueuedMessageSendArgs): Promise<ThreadQueuedMessageSendResult>;\n setGroupBoundary(args: ThreadQueuedMessageGroupBoundaryArgs): Promise<ThreadQueuedMessageGroupBoundaryResult>;\n update(args: ThreadQueuedMessageUpdateArgs): Promise<ThreadQueuedMessageUpdateResult>;\n}\ninterface ThreadTabsArea {\n get(args: ThreadStatusArgs): Promise<ThreadTabsResult>;\n update(args: ThreadTabsUpdateArgs): Promise<ThreadTabsUpdateResult>;\n}\ninterface ThreadsArea {\n archive(args: ThreadActionArgs): Promise<ThreadArchiveResult>;\n archiveAll(args: ThreadActionArgs): Promise<ThreadArchiveAllResult>;\n childSummary(args: ThreadStatusArgs): Promise<ThreadChildSummaryResult>;\n cancelPlan(args: ThreadActionArgs): Promise<ThreadBannerActionResult>;\n clearGoal(args: ThreadActionArgs): Promise<ThreadBannerActionResult>;\n conversationOutline(args: ThreadStatusArgs): Promise<ThreadConversationOutlineResult>;\n defaultExecutionOptions(args: ThreadStatusArgs): Promise<ThreadDefaultExecutionOptionsResult>;\n delete(args: ThreadDeleteArgs): Promise<ThreadDeleteResult>;\n events: ThreadEventsArea;\n fork(args: ThreadForkArgs): Promise<ThreadForkResult>;\n get(args: ThreadGetArgs): Promise<ThreadGetResult>;\n import(args: ThreadImportArgs): Promise<ThreadImportResult>;\n interactions: ThreadInteractionsArea;\n list(args?: ThreadListArgs): Promise<ThreadListResult>;\n markRead(args: ThreadActionArgs): Promise<ThreadReadStateResult>;\n markUnread(args: ThreadActionArgs): Promise<ThreadReadStateResult>;\n open(args: ThreadOpenArgs): Promise<ThreadOpenResult>;\n paneAction(args: ThreadPaneActionArgs): Promise<ThreadPaneActionResult>;\n output(args: ThreadOutputArgs): Promise<ThreadOutputResponse>;\n pin(args: ThreadActionArgs): Promise<ThreadMutationResult>;\n promptHistory(args: ThreadPromptHistoryArgs): Promise<ThreadPromptHistoryResult>;\n queuedMessages: ThreadQueuedMessagesArea;\n reorderPinned(args: ThreadPinOrderArgs): Promise<ThreadPinOrderResult>;\n search(args: ThreadSearchArgs): Promise<ThreadSearchResult>;\n send(args: ThreadSendArgs): Promise<ThreadSendResult>;\n spawn(args: ThreadSpawnArgs): Promise<ThreadSpawnResult>;\n stop(args: ThreadActionArgs): Promise<ThreadStopResult>;\n tabs: ThreadTabsArea;\n timeline(args: ThreadTimelineArgs): Promise<ThreadTimelineResult>;\n timelineTurnSummaryDetails(args: ThreadTimelineTurnSummaryDetailsArgs): Promise<ThreadTimelineTurnSummaryDetailsResult>;\n storageFiles(args: ThreadStorageFilesArgs): Promise<ThreadStorageFilesResult>;\n storagePaths(args: ThreadStoragePathsArgs): Promise<ThreadStoragePathsResult>;\n unarchive(args: ThreadActionArgs): Promise<ThreadUnarchiveResult>;\n unpin(args: ThreadActionArgs): Promise<ThreadMutationResult>;\n update(args: ThreadUpdateArgs): Promise<ThreadMutationResult>;\n wait(args: ThreadWaitArgs): Promise<ThreadWaitResult>;\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<ThreadSectionCreateResult>;\n delete(args: DeleteThreadSectionRequest): Promise<ThreadSectionDeleteResult>;\n list(args?: ThreadSectionListArgs): Promise<ThreadSectionListResult>;\n update(args: UpdateThreadSectionRequest): Promise<ThreadSectionUpdateResult>;\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 <dataDir>/plugins/<id>/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<string, PluginSettingDescriptor>;\ntype PluginSettingValue = string | boolean;\n/** `default` present → non-optional value; absent → `T | undefined`. */\ntype PluginSettingsValues<Ds extends Record<string, PluginSettingDescriptor>> = {\n [K in keyof Ds]: Ds[K] extends {\n default: string | boolean;\n } ? PluginSettingValueOf<Ds[K]> : PluginSettingValueOf<Ds[K]> | undefined;\n};\ntype PluginSettingValueOf<D extends PluginSettingDescriptor> = D extends {\n type: \"boolean\";\n} ? boolean : string;\ninterface PluginSettingsHandle<Ds extends Record<string, PluginSettingDescriptor>> {\n /** Load-safe: callable inside the factory. */\n get(): Promise<PluginSettingsValues<Ds>>;\n /** Fires after values change through the settings route/CLI. */\n onChange(listener: (next: PluginSettingsValues<Ds>, prev: PluginSettingsValues<Ds>) => void): void;\n}\ninterface PluginSettings {\n define<Ds extends Record<string, PluginSettingDescriptor>>(descriptors: Ds): PluginSettingsHandle<Ds>;\n}\ninterface PluginKvStorage {\n get<T>(key: string): Promise<T | undefined>;\n set(key: string, value: unknown): Promise<void>;\n delete(key: string): Promise<void>;\n list(prefix?: string): Promise<string[]>;\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 * <dataDir>/plugins/<id>/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<E extends PluginThreadEventName> = (payload: PluginThreadEventPayloads[E]) => void | Promise<void>;\ntype PluginHttpAuthMode = \"local\" | \"token\" | \"none\";\ntype PluginHttpHandler = (context: Context) => Response | Promise<Response>;\ninterface PluginHttp {\n /**\n * Register an HTTP route, mounted at\n * `/api/v1/plugins/<id>/http/<path>`. 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 <id>`) 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/<id>/rpc/<method>` 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 extends PluginRpcContract>(contract: Contract, handlers: PluginRpcHandlers<Contract>): 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<void>;\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>): 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;\n} | {\n outcome: \"cancelled\";\n reason: PluginInteractionCancelReason;\n};\ninterface PluginInteractionRequest {\n threadId: string;\n rendererId: string;\n title: string;\n payload: JsonValue;\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 <name> …`): 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<PluginCliResult>;\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}\n/**\n * Native timeline labels for a plugin tool, keyed by BB's own timeline row\n * status. This is experimental: BB may refine its presentation contract\n * before the field is stabilized.\n */\ninterface PluginAgentToolExperimentalStatusLabels {\n /** Label shown while the tool call is pending. */\n pending: string;\n /** Label shown after the tool call completes successfully. */\n completed: string;\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 * Optional native timeline labels. When omitted, BB shows the standard\n * tool name and arguments (for example, `Ran tool search_docs …`). Labels\n * apply only while the call is pending and after successful completion;\n * approval, error, and interruption states keep BB's standard rendering.\n */\n experimental_statusLabels?: PluginAgentToolExperimentalStatusLabels;\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 /** How the thread was spawned. A side chat is the builtin side-chat\n * plugin's fork: `{ kind: \"fork\", pluginId: \"side-chat\" }`. */\n origin: {\n kind: \"fork\" | 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<string, unknown>;\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<string | PluginAgentToolSelection>;\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 chats\n * are ordinary plugin-owned forks here — read `origin` to detect them — and\n * their returned tool, skill, and dynamic-instruction selections apply at the\n * same boundaries.\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<Schema extends z.ZodType>(tool: PluginAgentToolRegistrationBase & {\n parameters: Schema;\n execute(params: z.output<Schema>, ctx: PluginAgentToolContext): PluginAgentToolResult | Promise<PluginAgentToolResult>;\n }): void;\n registerTool(tool: PluginAgentToolRegistrationBase & {\n /** Raw JSON-schema escape hatch; params arrive unvalidated. */\n parameters: Record<string, unknown>;\n execute(params: unknown, ctx: PluginAgentToolContext): PluginAgentToolResult | Promise<PluginAgentToolResult>;\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 */\n contributeInstructions(provider: (ctx: {\n threadId: string;\n projectId: string;\n }) => string | null): void;\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 \"<providerId>:<itemId>\"). */\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<PluginMentionItem[]>;\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<PluginInteractionResult>;\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<E extends PluginThreadEventName>(event: E, handler: PluginThreadEventHandler<E>): 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<PluginSharedPortTunnelIdentity>;\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 <id>` 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/<id>/http/* (design §4.6). */\n readonly http: PluginHttp;\n /** RPC methods under /api/v1/plugins/<id>/rpc/<method> (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>): void;\n}\n\nexport { PLUGIN_CLI_OUTPUT_MAX_BYTES, defineRpcContract };\nexport type { BbContext, BbNavigate, BbPluginApi, ComposerCustomization, ComposerPlusMenuItem, ComposerRichTextSpec, ComposerStructuredDraft, ComposerView, JsonValue, MarkdownProps, NewThreadComposerProps, NewThreadRequest, PluginAgentConfiguration, PluginAgentConfigurationContext, PluginAgentToolContentPart, PluginAgentToolContext, PluginAgentToolExperimentalStatusLabels, 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, PluginSidebarProject, PluginSidebarPullRequest, PluginSidebarSplitPane, PluginSidebarThread, PluginSidebarThreadActions, PluginSidebarThreadActivity, PluginSidebarThreadIndicator, PluginSidebarThreadPullRequestState, PluginSidebarThreadSplit, PluginSidebarThreadsState, PluginSidebarWorkspaceKind, PluginStatusApi, PluginStorage, PluginThreadEventHandler, PluginThreadEventName, PluginThreadEventPayloads, PluginThreadHeaderActionProps, PluginThreadHeaderActionRegistration, PluginThreadListProps, PluginThreadListRegistration, PluginThreadPanelActionContext, PluginThreadPanelActionRegistration, PluginThreadPanelProps, PluginUi, 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/get-bb/bb\n\nimport * as react from 'react';\nimport { ComponentType, ReactNode } from 'react';\nimport { z } from 'zod';\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<Input = unknown, Output = Input> {\n readonly \"~standard\": {\n readonly version: 1;\n readonly vendor: string;\n readonly validate: (value: unknown) => StandardSchemaV1Result<Output> | Promise<StandardSchemaV1Result<Output>>;\n readonly types?: {\n readonly input: Input;\n readonly output: Output;\n };\n };\n}\ntype StandardSchemaV1Result<Output> = {\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<Schema extends StandardSchemaV1> = NonNullable<Schema[\"~standard\"][\"types\"]>[\"input\"];\ntype StandardSchemaV1InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema[\"~standard\"][\"types\"]>[\"output\"];\ninterface PluginRpcMethodContract<InputSchema extends StandardSchemaV1 = StandardSchemaV1, OutputSchema extends StandardSchemaV1 = StandardSchemaV1> {\n readonly input: InputSchema;\n readonly output: OutputSchema;\n}\ntype PluginRpcContract = Readonly<Record<string, PluginRpcMethodContract>>;\ntype PluginRpcHandlers<Contract extends PluginRpcContract> = {\n [Method in keyof Contract]: (input: StandardSchemaV1InferOutput<Contract[Method][\"input\"]>) => StandardSchemaV1InferInput<Contract[Method][\"output\"]> | Promise<StandardSchemaV1InferInput<Contract[Method][\"output\"]>>;\n};\ntype PluginRpcCallInput<Method extends PluginRpcMethodContract> = StandardSchemaV1InferInput<Method[\"input\"]>;\ntype PluginRpcCallArgs<Method extends PluginRpcMethodContract> = null extends PluginRpcCallInput<Method> ? [input?: PluginRpcCallInput<Method>] : [input: PluginRpcCallInput<Method>];\ntype PluginRpcResult<Method extends PluginRpcMethodContract> = StandardSchemaV1InferOutput<Method[\"output\"]>;\n\ndeclare const reasoningLevelSchema: z.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}>;\ntype ReasoningLevel = z.infer<typeof reasoningLevelSchema>;\ndeclare const serviceTierSchema: z.ZodEnum<{\n default: \"default\";\n fast: \"fast\";\n}>;\ntype ServiceTier = z.infer<typeof serviceTierSchema>;\ndeclare const permissionModeSchema: z.ZodEnum<{\n full: \"full\";\n auto: \"auto\";\n \"accept-edits\": \"accept-edits\";\n}>;\ntype PermissionMode = z.infer<typeof permissionModeSchema>;\ndeclare const promptInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{\n visibility: z.ZodOptional<z.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z.ZodLiteral<\"text\">;\n text: z.ZodString;\n mentions: z.ZodDefault<z.ZodArray<z.ZodObject<{\n start: z.ZodNumber;\n end: z.ZodNumber;\n resource: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDiscriminatedUnion<[z.ZodObject<{\n kind: z.ZodLiteral<\"thread\">;\n threadId: z.ZodString;\n projectId: z.ZodOptional<z.ZodString>;\n label: z.ZodString;\n }, z.core.$strip>, z.ZodObject<{\n kind: z.ZodLiteral<\"project\">;\n projectId: z.ZodString;\n label: z.ZodString;\n }, z.core.$strip>, z.ZodObject<{\n kind: z.ZodLiteral<\"section\">;\n sectionId: z.ZodString;\n label: z.ZodString;\n }, z.core.$strip>, z.ZodObject<{\n kind: z.ZodLiteral<\"path\">;\n source: z.ZodEnum<{\n workspace: \"workspace\";\n \"thread-storage\": \"thread-storage\";\n }>;\n entryKind: z.ZodEnum<{\n file: \"file\";\n directory: \"directory\";\n }>;\n path: z.ZodString;\n label: z.ZodString;\n }, z.core.$strip>, z.ZodObject<{\n kind: z.ZodLiteral<\"command\">;\n trigger: z.ZodEnum<{\n \"/\": \"/\";\n }>;\n name: z.ZodString;\n source: z.ZodEnum<{\n command: \"command\";\n skill: \"skill\";\n }>;\n origin: z.ZodEnum<{\n user: \"user\";\n project: \"project\";\n builtin: \"builtin\";\n }>;\n label: z.ZodString;\n argumentHint: z.ZodNullable<z.ZodString>;\n }, z.core.$strip>, z.ZodObject<{\n kind: z.ZodLiteral<\"plugin\">;\n pluginId: z.ZodString;\n icon: z.ZodOptional<z.ZodNullable<z.ZodString>>;\n itemId: z.ZodString;\n label: z.ZodString;\n }, z.core.$strip>], \"kind\">>;\n }, z.core.$strip>>>;\n}, z.core.$strip>, z.ZodObject<{\n visibility: z.ZodOptional<z.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z.ZodLiteral<\"image\">;\n url: z.ZodString;\n}, z.core.$strip>, z.ZodObject<{\n visibility: z.ZodOptional<z.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z.ZodLiteral<\"localImage\">;\n path: z.ZodString;\n}, z.core.$strip>, z.ZodObject<{\n visibility: z.ZodOptional<z.ZodEnum<{\n \"agent-only\": \"agent-only\";\n }>>;\n type: z.ZodLiteral<\"localFile\">;\n path: z.ZodString;\n name: z.ZodOptional<z.ZodString>;\n sizeBytes: z.ZodOptional<z.ZodNumber>;\n mimeType: z.ZodOptional<z.ZodString>;\n}, z.core.$strip>], \"type\">;\ntype PromptInput = z.infer<typeof promptInputSchema>;\n\ndeclare const createThreadEnvironmentArgsSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{\n type: z.ZodLiteral<\"reuse\">;\n environmentId: z.ZodString;\n}, z.core.$strip>, z.ZodObject<{\n type: z.ZodLiteral<\"host\">;\n hostId: z.ZodOptional<z.ZodString>;\n workspace: z.ZodDiscriminatedUnion<[z.ZodObject<{\n type: z.ZodLiteral<\"unmanaged\">;\n path: z.ZodNullable<z.ZodString>;\n branch: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{\n kind: z.ZodLiteral<\"existing\">;\n name: z.ZodString;\n }, z.core.$strict>, z.ZodObject<{\n kind: z.ZodLiteral<\"new\">;\n baseBranch: z.ZodString;\n }, z.core.$strict>], \"kind\">>;\n }, z.core.$strip>, z.ZodObject<{\n type: z.ZodLiteral<\"managed-worktree\">;\n baseBranch: z.ZodDiscriminatedUnion<[z.ZodObject<{\n kind: z.ZodLiteral<\"named\">;\n name: z.ZodString;\n }, z.core.$strip>, z.ZodObject<{\n kind: z.ZodLiteral<\"default\">;\n }, z.core.$strip>], \"kind\">;\n }, z.core.$strip>, z.ZodObject<{\n type: z.ZodLiteral<\"personal\">;\n }, z.core.$strip>], \"type\">;\n}, z.core.$strip>, z.ZodObject<{\n type: z.ZodLiteral<\"project-default\">;\n}, z.core.$strip>], \"type\">;\ntype CreateThreadEnvironmentArgs = z.infer<typeof createThreadEnvironmentArgsSchema>;\n\ndeclare const createExecutionInputSourcesSchema: z.ZodObject<{\n providerId: z.ZodOptional<z.ZodEnum<{\n explicit: \"explicit\";\n \"client-preference\": \"client-preference\";\n }>>;\n model: z.ZodOptional<z.ZodEnum<{\n explicit: \"explicit\";\n \"client-preference\": \"client-preference\";\n }>>;\n serviceTier: z.ZodOptional<z.ZodEnum<{\n explicit: \"explicit\";\n \"client-preference\": \"client-preference\";\n }>>;\n reasoningLevel: z.ZodOptional<z.ZodEnum<{\n explicit: \"explicit\";\n \"client-preference\": \"client-preference\";\n }>>;\n permissionMode: z.ZodOptional<z.ZodEnum<{\n explicit: \"explicit\";\n \"client-preference\": \"client-preference\";\n }>>;\n}, z.core.$strict>;\ntype CreateExecutionInputSources = z.infer<typeof createExecutionInputSourcesSchema>;\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/<pluginId>/<path>/*`, 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<void>;\n cancel(): Promise<void>;\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 * Props passed to an `experimental_threadList` component — the sidebar's\n * scrolling thread area, replaced wholesale by one plugin.\n */\ninterface PluginThreadListProps {\n /** The thread the route currently shows; null on non-thread routes. */\n activeThreadId: string | null;\n /** The project the route currently shows; null when none is selected. */\n activeProjectId: string | null;\n /** True on phone-width viewports and coarse pointers. */\n isCompactViewport: boolean;\n /**\n * Call after the user opens a thread. Closes the mobile sidebar drawer and\n * is a no-op on desktop, so always call it.\n */\n onNavigate: () => void;\n /**\n * The host search field's current text, or \"\" when the field is closed.\n * The host owns that field, so a plugin list filters by this rather than\n * shipping a second search box.\n */\n searchQuery: string;\n}\n/**\n * Props passed to an `experimental_threadHeaderAction` component, rendered in\n * the thread header's action row.\n */\ninterface PluginThreadHeaderActionProps {\n /**\n * The thread this header belongs to. Never null: the slot is not rendered\n * on the compose screen or other non-thread routes. A split layout renders\n * one header per pane, so the component mounts once per visible thread,\n * each with its own id — keep per-thread state in the component, never in a\n * module-level singleton.\n */\n threadId: string;\n projectId: string;\n /**\n * True on phone-width viewports and coarse pointers. Collapse to an\n * icon-sized control when it is true — the row is short.\n */\n isCompactViewport: boolean;\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<Record<string, string>>;\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<PluginHomepageSectionProps>;\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<PluginSettingsSectionProps>;\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/<pluginId>/`; letters, digits, `-`, `_`. */\n path: string;\n component: ComponentType<PluginNavPanelProps>;\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<PluginNavPanelProps>;\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<PluginThreadPanelProps>;\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 * `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<void>;\n}\ninterface PluginPendingInteractionRegistration {\n /** Matches `rendererId` passed to `bb.ui.requestInput`. */\n id: string;\n component: ComponentType<PluginPendingInteractionProps>;\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<void>;\n}\n/**\n * The one status bb would paint for a thread, already resolved through the\n * host's precedence (attention before work; plan and goal before the generic\n * spinner). Draw your own glyph for it — the SDK ships no status component.\n *\n * Treat an unrecognized value as \"none\": bb adds kinds over time, and an\n * older plugin must degrade to drawing nothing rather than throwing.\n *\n * \"draft\" and \"working-draft\" are never reported here: an unsubmitted composer\n * draft is per-client state the host reads per row, which an array-wide view\n * cannot. A thread holding a draft reports whatever it would report without\n * one.\n */\ntype PluginSidebarThreadIndicator = \"unread-error\" | \"waiting-for-input\" | \"working-draft\" | \"workflow\" | \"background-agent\" | \"background-command\" | \"plan-mode\" | \"goal\" | \"runtime\" | \"draft\" | \"unread-success\" | \"none\";\n/**\n * How a thread's environment presents its workspace: a worktree bb manages,\n * a worktree the user manages, or anything else (a plain checkout).\n */\ntype PluginSidebarWorkspaceKind = \"managed-worktree\" | \"unmanaged-worktree\" | \"other\";\n/** Live work counts on a thread. All zero means nothing is running. */\ninterface PluginSidebarThreadActivity {\n workflows: number;\n backgroundAgents: number;\n backgroundCommands: number;\n planMode: number;\n goals: number;\n}\n/**\n * One thread in the sidebar's live view.\n *\n * A deliberate copy of the fields a sidebar needs — not a re-export of the\n * host's internal thread row type, which changes whenever the app needs a\n * field. Timestamps are epoch milliseconds.\n */\ninterface PluginSidebarThread {\n id: string;\n projectId: string;\n /** Null while a thread is still unnamed; pair with `titleFallback`. */\n title: string | null;\n titleFallback: string | null;\n /** The thread this one was forked from or spawned under; null at the root. */\n parentThreadId: string | null;\n sectionId: string | null;\n /** How this thread came to exist under its parent; null for root threads. */\n originKind: \"fork\" | \"side-chat\" | null;\n /** The plugin that spawned it, or null for non-plugin origins. */\n originPluginId: string | null;\n /** The agent provider this thread runs on, e.g. \"codex\", \"claude-code\". */\n providerId: string;\n /** The agent is blocked on the user: an approval or a question. */\n hasPendingInteraction: boolean;\n activity: PluginSidebarThreadActivity;\n indicator: PluginSidebarThreadIndicator;\n /**\n * The host's accessible label for `indicator`, e.g. \"Thread needs user\n * input\"; null when the indicator is \"none\". Use it for `aria-label` so\n * screen-reader text stays consistent across sidebars.\n */\n indicatorLabel: string | null;\n isUnread: boolean;\n isPinned: boolean;\n isArchived: boolean;\n environment: {\n id: string | null;\n name: string | null;\n branchName: string | null;\n workspaceDisplayKind: PluginSidebarWorkspaceKind;\n } | null;\n /**\n * The machine this thread's work runs on, with the name resolved for you.\n * Null when the thread has no environment yet, or when its host is not in\n * the known-hosts list. Useful where a thread has no branch to show — a\n * personal-project thread has a machine but no worktree.\n */\n host: {\n id: string;\n name: string;\n } | null;\n createdAt: number;\n updatedAt: number;\n lastReadAt: number | null;\n latestAttentionAt: number;\n}\n/**\n * The pull request for a thread's branch, narrowed to what a sidebar row\n * needs. `attention` is bb's rolled-up \"does this need you\" signal, so a row\n * can colour a badge without reading checks, review, and mergeability itself.\n */\ninterface PluginSidebarPullRequest {\n number: number;\n title: string;\n url: string;\n state: \"draft\" | \"open\" | \"merged\" | \"closed\";\n attention: \"checks_failed\" | \"checks_pending\" | \"changes_requested\" | \"review_requested\" | \"conflicts\" | \"blocked\" | \"draft\" | \"ready_to_merge\" | \"merged\" | \"closed\" | \"none\";\n}\ninterface PluginSidebarThreadPullRequestState {\n /** True while the first lookup for this thread's environment is in flight. */\n isLoading: boolean;\n /**\n * The pull request, or null when the branch has none, the thread has no\n * environment, or the lookup could not run (a git-host hiccup). A row should\n * treat null as \"nothing to show\", never as an error.\n */\n pullRequest: PluginSidebarPullRequest | null;\n}\n/** One project in the sidebar's live view. */\ninterface PluginSidebarProject {\n id: string;\n name: string;\n /** True for the implicit personal project. */\n isPersonal: boolean;\n}\ninterface PluginSidebarThreadsState {\n status: \"loading\" | \"ready\" | \"error\";\n threads: readonly PluginSidebarThread[];\n projects: readonly PluginSidebarProject[];\n}\n/**\n * Act on threads from a plugin surface. Every method routes to the host's own\n * flow, so optimistic updates, toasts, dialogs, pane closing, and route repair\n * behave exactly as they do in the built-in sidebar. Unknown thread ids are\n * ignored by `open` and rejected by the rest.\n */\ninterface PluginSidebarThreadActions {\n /**\n * Navigate to a thread. `split: true` applies bb's split placement rules —\n * a right split by default, focus when the thread is already open, replace\n * at the pane cap — and falls back to plain navigation where splits are off.\n */\n open(threadId: string, options?: {\n split?: boolean;\n }): void;\n /**\n * Go to the new-thread screen. Passing `projectId` also makes that project\n * the composer's selection, so the thread is created where you asked.\n */\n openNewThread(options?: {\n projectId?: string;\n focusPrompt?: boolean;\n }): void;\n setPinned(threadId: string, pinned: boolean): Promise<void>;\n setRead(threadId: string, read: boolean): Promise<void>;\n /** Silent rename — no dialog. For inline editing in your own row. */\n rename(threadId: string, title: string): Promise<void>;\n /** Archives the thread AND its children, closing any panes showing them. */\n archive(threadId: string): void;\n /**\n * Opens bb's delete confirmation, which counts child threads first. Deletion\n * is destructive and recursive, so the host owns the confirmation: there is\n * deliberately no silent `delete`.\n */\n requestDelete(threadId: string): void;\n}\n/**\n * Render a plugin component in the thread header's action row.\n *\n * The frontend sibling of the backend `bb.ui.registerThreadAction`, which\n * renders a host-owned button and runs server-side. Use that one for \"do a\n * thing\"; use this one when the control must draw live state.\n *\n * The host places it at the left end of the action row, before the workspace\n * button, git actions, the panel toggle, maximize, and close. That row is a\n * 48px chrome row with 28px controls: render one inline control that fits, and\n * put anything taller in a portalled popover.\n */\ninterface PluginThreadHeaderActionRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /**\n * Names the region the host wraps around your component (a labelled group).\n * It does NOT label your control: an icon-only button still needs its own\n * accessible name.\n */\n title: string;\n component: ComponentType<PluginThreadHeaderActionProps>;\n}\n/** One pane's place in the split layout, as fractions of the split area. */\ninterface PluginSidebarSplitPane {\n paneId: string;\n rect: {\n x: number;\n y: number;\n width: number;\n height: number;\n };\n /** This pane holds the thread the row represents. */\n isMe: boolean;\n isFocused: boolean;\n}\n/**\n * Drag-to-split support for one row, plus where that thread currently sits in\n * the split layout.\n */\ninterface PluginSidebarThreadSplit {\n /**\n * Spread onto the row's interactive element. Carries the pointer handler\n * that starts a split drag; empty when splits are unavailable, so spreading\n * it is always safe.\n *\n * The host owns every rule: the gesture engages only once the pointer leaves\n * the sidebar toward the main area (so a list with its own drag-to-reorder\n * keeps working), an edge drop splits, a center drop replaces, an\n * already-open thread focuses its pane, and the pane cap coerces a split\n * into a replace.\n */\n splitProps: {\n onPointerDown?: (event: react.PointerEvent<HTMLElement>) => void;\n };\n /**\n * False on compact viewports, when the user disabled splits, and for an\n * unknown thread id. Gate any \"open in split\" affordance you draw on it.\n */\n isAvailable: boolean;\n /**\n * Where this thread sits in the split layout, or null when it is not open in\n * one (including single-pane layouts). Draw a mini-map, a tint, or nothing.\n */\n layout: {\n panes: readonly PluginSidebarSplitPane[];\n } | null;\n}\n/**\n * Replace the sidebar's thread list with a plugin component.\n *\n * Unlike every other slot, this one is EXCLUSIVE: two lists cannot share one\n * scroll area. The built-in list stays the default; the user picks a provider\n * in Settings → Appearance, stored per client. A provider that is uninstalled,\n * disabled, or crashing falls back to the built-in list rather than leaving\n * the user with no sidebar.\n *\n * The plugin gets the scrolling list and nothing else. The New-thread button,\n * the search field, the plugin nav rows, and the footer stay host-rendered in\n * every sidebar — they are shared surfaces (other plugins live in two of\n * them), and a replaced list must not be able to remove them.\n */\ninterface PluginThreadListRegistration {\n /** Unique within the plugin; letters, digits, `-`, `_`. */\n id: string;\n /** Label in the Settings → Appearance → Sidebar picker. */\n title: string;\n /** Optional one-line description under the title in that picker. */\n description?: string;\n component: ComponentType<PluginThreadListProps>;\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<PluginFileOpenerProps>;\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<PluginMessageDirectiveProps>;\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().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<void>;\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 /**\n * Replace the sidebar's thread list (see\n * {@link PluginThreadListRegistration}). Experimental: see\n * docs/api_to_audit.md for what to audit before the prefix drops.\n */\n experimental_threadList(registration: PluginThreadListRegistration): void;\n /**\n * Render a component in the thread header's action row (see\n * {@link PluginThreadHeaderActionRegistration}). Experimental: see\n * docs/api_to_audit.md.\n */\n experimental_threadHeaderAction(registration: PluginThreadHeaderActionRegistration): void;\n fileOpener(registration: PluginFileOpenerRegistration): void;\n messageDirective(registration: PluginMessageDirectiveRegistration): void;\n 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 * Persistently decorate any thread row for this plugin generation.\n *\n * The status is owned by the frontend generation and therefore survives\n * route changes. Passing `null` clears the plugin's status for that thread.\n * The host clears every remaining status when the frontend generation\n * deactivates.\n *\n * Optional so bundles can feature-detect support while this experimental\n * surface rolls out across 0.x clients.\n */\n readonly experimental_setThreadRowStatus?: (threadId: string, status: PluginComposerThreadRowStatus | null) => void;\n}\n/** Cleanup returned by a frontend content script. */\ntype PluginContentScriptDisposer = () => void | Promise<void>;\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<void | PluginContentScriptDisposer>;\n}\n/** Lifecycle surface for trusted frontend content scripts. */\ninterface PluginAppContentScripts {\n register(registration: PluginContentScriptRegistration): void;\n}\ninterface PluginAppBuilder {\n slots: PluginAppSlots;\n composer: PluginAppComposer;\n 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<Contract extends PluginRpcContract = PluginRpcContract> {\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 extends Extract<keyof Contract, string>>(method: Method, ...args: PluginRpcCallArgs<Contract[Method]>): Promise<PluginRpcResult<Contract[Method]>>;\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<string, string | boolean> | 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<void>;\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 * 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<void>;\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 /**\n * Who controls the permission mode sends run with. \"inherit\" (default)\n * pins every send to the thread's own resolved default and renders the\n * picker as a dimmed label — a plugin surface can never widen it.\n * \"editable\" gives this chat its own picker, so the user can raise or\n * lower permissions for this thread independently of the thread it was\n * forked from. Ignored by `variant: \"timeline\"` (no composer).\n */\n permissionPolicy?: \"inherit\" | \"editable\";\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 * Every selection the composer resolved, JSON-serializable so a plugin can\n * forward it to its own backend rpc verbatim and hand it straight to\n * `bb.sdk.threads.spawn`.\n *\n * The split is deliberate: the composer owns *user selections*, the plugin\n * owns *filing and attribution*. `bb.sdk.threads.spawn` auto-fills\n * `origin: \"plugin\"` and `originPluginId`, so a thread created this way stays\n * attributed to the plugin — which it would not be if the component created\n * the thread itself. The plugin adds `sectionId`, `parentThreadId`, `title`,\n * and `visibility` to the request on its own; they are deliberately not\n * composer props.\n */\ninterface NewThreadRequest {\n projectId: string;\n providerId: string;\n model: string;\n reasoningLevel: ReasoningLevel;\n permissionMode: PermissionMode;\n /** Omitted when the selected provider has no service tiers. */\n serviceTier?: ServiceTier;\n /**\n * Per-field provenance (caller-explicit vs. default) for the execution\n * options above, forwarded to `spawn` so the server records what the user\n * actually chose.\n */\n executionInputSources: CreateExecutionInputSources;\n environment: CreateThreadEnvironmentArgs;\n input: PromptInput[];\n}\n/**\n * Props of the host-owned `experimental_NewThreadComposer` component — bb's\n * full new-thread compose surface (prompt editor with @-mentions and expand,\n * attachments, provider/model/reasoning picker, voice, submit, and the row\n * beneath with project, environment, branch-from, and permission mode),\n * rendered by the BB app inside a plugin slot.\n *\n * It is the create-side counterpart to `ThreadChat`: same deliberate\n * exception to the no-host-components rule (§5.5), same additive versioning.\n */\ninterface NewThreadComposerProps {\n /** Seeds the project picker. The user can change it. */\n defaultProjectId?: string;\n /**\n * Seeds the provider picker. Like every `default*` prop this is a SEED, not\n * a controlled value: the composer stays uncontrolled, the user can change\n * it, and when omitted the composer falls back to the project's remembered\n * execution defaults exactly as before. When provided it takes precedence\n * over those project defaults.\n *\n * Re-seeding: the `default*` props are value-compared each render. When any\n * of them changes after mount, the composer re-seeds EVERY execution and\n * environment selection from the new props — including selections the user\n * had already touched — so switching between two saved records in the same\n * mounted composer reloads that record's values (the same rule\n * `defaultProjectId` already follows).\n *\n * Every seeded field is reported as caller-explicit in the submitted\n * request's `executionInputSources`. That is what makes the seed survive\n * `threads.spawn`: the server drops a requested `providerId`/`model` that\n * carries no provenance source and re-derives it from the project's stored\n * defaults, which would silently undo the seed.\n */\n defaultProviderId?: string;\n /** Seeds the model picker. Same seed semantics as {@link defaultProviderId}. */\n defaultModel?: string;\n /**\n * Seeds the reasoning-level picker. Same seed semantics as\n * {@link defaultProviderId}. If the seeded model does not support this\n * level, the composer reconciles to the closest supported one.\n */\n defaultReasoningLevel?: ReasoningLevel;\n /**\n * Seeds the service-tier picker. Same seed semantics as\n * {@link defaultProviderId}. Ignored (and omitted from the submitted\n * request) when the selected provider has no service tiers.\n */\n defaultServiceTier?: ServiceTier;\n /** Seeds the permission-mode picker. Same seed semantics as {@link defaultProviderId}. */\n defaultPermissionMode?: PermissionMode;\n /**\n * Seeds the environment and branch pickers from a previously submitted\n * `NewThreadRequest.environment`. Same seed semantics as\n * {@link defaultProviderId}: a seed the user can change, taking precedence\n * over the composer's own environment default when provided.\n *\n * Round trip: feeding a submitted request's `environment` back in and\n * resubmitting untouched reproduces an equivalent environment, with these\n * documented limits — the composer cannot represent every args variant:\n *\n * - `{ type: \"project-default\" }` seeds nothing; the composer resolves its\n * own default and submits that concrete environment instead.\n * - A `host` environment whose host no longer exists (or whose project has\n * no source on it) falls back to the composer's default host, exactly as\n * the primary compose surface would.\n * - A `reuse` environment whose worktree no longer has unarchived threads\n * falls back the same way.\n * - An `unmanaged` workspace's `path` has no composer control; the seeded\n * selection submits `path: null` (the host's configured checkout). The\n * composer itself never produces a non-null `path`, so real round trips\n * are unaffected.\n * - A `managed-worktree` with `baseBranch: { kind: \"default\" }` leaves the\n * branch picker on its default, which may resolve to a named base branch\n * when the project configures a dedicated worktree base — the same branch\n * the original `default` submission would have created from.\n */\n defaultEnvironment?: CreateThreadEnvironmentArgs;\n /** Seeds the draft, only while the draft is still empty. */\n initialPrompt?: string;\n placeholder?: string;\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 editor. */\n focusRequest?: number;\n className?: string;\n /**\n * Where the draft persists. Drafts survive reloads and are shared by every\n * composer using the same key; defaults to a key scoped to this plugin.\n */\n draftKey?: string;\n /**\n * Fires on submit with every selection resolved. The draft clears when this\n * resolves and is KEPT if it throws, so a failed create never loses what the\n * user typed.\n */\n onSubmit: (request: NewThreadRequest) => void | Promise<void>;\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 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<Contract extends PluginRpcContract = PluginRpcContract>(): PluginRpcClient<Contract>;\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 sidebar's live thread view (see {@link PluginSidebarThreadsState}).\n * Reads the host's own cache and realtime subscriptions, so it costs no\n * extra request and updates exactly when the built-in sidebar does.\n * Experimental: see docs/api_to_audit.md.\n */\n experimental_useSidebarThreads(): PluginSidebarThreadsState;\n /**\n * Thread actions bound to the host's mutations (see\n * {@link PluginSidebarThreadActions}). Experimental: see\n * docs/api_to_audit.md.\n */\n experimental_useSidebarThreadActions(): PluginSidebarThreadActions;\n /**\n * The pull request for one thread's branch (see\n * {@link PluginSidebarThreadPullRequestState}).\n *\n * Per row and opt-in, because it costs a git-host lookup: it is NOT on the\n * thread payload every sidebar loads. Threads sharing an environment share\n * one query, and the host owns the polling and staleness rules — an open PR\n * with pending checks refreshes, a merged one does not.\n *\n * Experimental: see docs/api_to_audit.md.\n */\n experimental_useSidebarThreadPullRequest(threadId: string): PluginSidebarThreadPullRequestState;\n /**\n * Per-row drag-to-split support (see {@link PluginSidebarThreadSplit}).\n * Call it once per rendered row, like the built-in sidebar does.\n * Experimental: see docs/api_to_audit.md.\n */\n experimental_useSidebarThreadSplit(threadId: string): PluginSidebarThreadSplit;\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 ThreadChat: ComponentType<ThreadChatProps>;\n /**\n * The host-owned chat-message markdown renderer (see\n * {@link MarkdownProps}).\n */\n Markdown: ComponentType<MarkdownProps>;\n /**\n * The host-owned new-thread compose surface (see\n * {@link NewThreadComposerProps}). Experimental: see\n * docs/api_to_audit.md for what to audit before the prefix drops.\n */\n experimental_NewThreadComposer: ComponentType<NewThreadComposerProps>;\n useComposerView(): ComposerView;\n}\n\ndeclare const definePluginApp: (setup: PluginAppSetup) => PluginAppDefinition;\ndeclare const ThreadChat: react.ComponentType<ThreadChatProps>;\ndeclare const Markdown: react.ComponentType<MarkdownProps>;\ndeclare const experimental_NewThreadComposer: react.ComponentType<NewThreadComposerProps>;\ndeclare const useRpc: <Contract extends PluginRpcContract = Readonly<Record<string, PluginRpcMethodContract<StandardSchemaV1<unknown, unknown>, StandardSchemaV1<unknown, unknown>>>>>() => PluginRpcClient<Contract>;\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;\ndeclare const experimental_useSidebarThreads: () => PluginSidebarThreadsState;\ndeclare const experimental_useSidebarThreadActions: () => PluginSidebarThreadActions;\ndeclare const experimental_useSidebarThreadPullRequest: (threadId: string) => PluginSidebarThreadPullRequestState;\ndeclare const experimental_useSidebarThreadSplit: (threadId: string) => PluginSidebarThreadSplit;\n\nexport { Markdown, ThreadChat, definePluginApp, experimental_NewThreadComposer, experimental_useSidebarThreadActions, experimental_useSidebarThreadPullRequest, experimental_useSidebarThreadSplit, experimental_useSidebarThreads, useBbContext, useBbNavigate, useComposer, useComposerView, useRealtime, useRealtimeConnectionState, useRpc, useSettings };\nexport type { BbContext, BbNavigate, ComposerCustomization, ComposerPlusMenuItem, ComposerRichTextSpec, ComposerStructuredDraft, ComposerView, JsonValue, MarkdownProps, NewThreadComposerProps, NewThreadRequest, 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, PluginSidebarProject, PluginSidebarPullRequest, PluginSidebarSplitPane, PluginSidebarThread, PluginSidebarThreadActions, PluginSidebarThreadActivity, PluginSidebarThreadIndicator, PluginSidebarThreadPullRequestState, PluginSidebarThreadSplit, PluginSidebarThreadsState, PluginSidebarWorkspaceKind, PluginThreadHeaderActionProps, PluginThreadHeaderActionRegistration, PluginThreadListProps, PluginThreadListRegistration, PluginThreadPanelActionContext, PluginThreadPanelActionRegistration, PluginThreadPanelProps, StandardSchemaV1, StandardSchemaV1InferInput, StandardSchemaV1InferOutput, StandardSchemaV1Issue, StandardSchemaV1Result, ThreadChatMessageAction, ThreadChatMessageReference, ThreadChatProps };\n"; diff --git a/packages/templates/src/generated/templates.generated.ts b/packages/templates/src/generated/templates.generated.ts index a978acafe1..0a11a34ee2 100644 --- a/packages/templates/src/generated/templates.generated.ts +++ b/packages/templates/src/generated/templates.generated.ts @@ -127,7 +127,7 @@ export const templateDefinitions = [ }, { "id": "bbGuideThreads", - "body": "Thread commands\n\nEvery command supports --json for machine-readable output.\n\nSpawning:\n\n bb thread spawn --project <id> --prompt \"...\" [options]\n\n --prompt <prompt> Initial prompt (required)\n --title <title> Thread title\n --project <id> Project (required)\n --parent-thread <id> Parent thread\n --parent-self Parent to the current thread (BB_THREAD_ID)\n --provider <id> Provider override\n --model <model> Model override\n --reasoning-level <level> Reasoning level: low, medium, high, xhigh, max (provider-dependent)\n --environment <id-or-path> Attach to an existing environment (ID or workspace path)\n --new-environment <kind> Create a new environment (worktree)\n --base-branch <branch> Base branch for a new managed worktree\n --machine <id-or-name> Run on a machine (--host is an alias)\n --service-tier <tier> Service tier: fast, default\n --permission-mode <mode> Permission mode: accept-edits, auto, or full\n --section <id> Create the thread in a section\n --visibility <visibility> visible or hidden; a child inherits its parent by default\n --file <path> Host-readable absolute or uploaded file path\n --image <path> Host-readable absolute or uploaded image path\n --origin-kind <kind> Create a fork thread\n --source-thread <id> Source thread for a fork\n --source-seq-end <seq> Last included source event sequence\n\n Execution defaults resolve from explicit flags, live parent execution, and\n remembered project defaults. With no remembered model, bb uses the explicitly\n requested provider or Codex and resolves its provider-reported default model\n on the target machine. The product reasoning and permission defaults are\n medium and auto.\n accept-edits uses workspace sandboxing with user-reviewed escalation. auto uses\n the same workspace sandbox with provider-native automatic review. full is the\n explicit sandbox and approval bypass. Plan mode is separate from permissions.\n When spawning a subagent, pass --permission-mode full unless the user or task explicitly requests restricted access.\n Parenting is opt-in. Inside a thread, pass --parent-self to parent the new thread to the current thread.\n Hidden threads are for plugin/background workers. They remain addressable by\n ID while staying out of sidebar organization and unread/pending favicon\n attention. Thread lists exclude them unless\n --include-hidden is passed; direct-ID operations remain available.\n A new child thread inherits the visibility of its parent, so the subagents of\n a hidden thread stay hidden too. Pass --visibility to override the inherited\n value. A hidden child still reports its turns and blockers to its parent\n thread; only source-derived forks stay silent.\n A machine selector accepts an exact ID or an unambiguous name. It works with\n an unmanaged --environment path, --new-environment worktree, or the personal\n workspace. It cannot be combined with an existing environment ID because that\n environment already selects its machine. Without the flag, local/primary\n machine resolution is unchanged.\n\nForking:\n\n bb thread fork <source-thread-id> [options]\n\n --prompt <prompt> Optional first prompt; omit for an idle fork\n --source-seq-end <seq> Fork at this source event sequence (tip by default)\n --workspace <mode> isolated (default) or reuse\n --title <title> Thread title\n --permission-mode <mode> Inherit source by default; accepts accept-edits, auto, full\n --visibility <visibility> visible (default) or hidden\n --agent-context-seed <text> Persist agent-only context without a first run\n --file <path> Host-readable absolute or uploaded file path\n --image <path> Host-readable absolute or uploaded image path\n\n Forks clone the source provider session on the same machine. Isolated forks\n create a fresh managed worktree (or personal workspace for personal threads);\n reuse attaches the source environment. Omit --prompt to create an idle fork.\n\nListing:\n\n bb thread list List threads\n --project <id> Filter by project\n --parent-thread <id> Filter by parent thread\n --archived Show only archived threads\n --section <id> Filter by section\n --unsectioned Show only threads outside sections\n --include-hidden Include hidden threads\n\n bb thread search <query> Search threads and messages\n bb thread history <id> List prompt history\n\nSections:\n\n bb thread section list\n bb thread section create <name>\n bb thread section rename <id> <name>\n bb thread section delete <id> [--yes]\n\nInspecting:\n\n bb thread show [id] Show thread details and pull request status\n --self Target current thread\n --work-status Include git working-tree status\n --git-diff Include git diff\n --diff-target <type> Diff scope: uncommitted, branch_committed, all, commit\n --diff-sha <sha> Commit SHA (for --diff-target commit)\n --diff-merge-base <branch> Override merge-base branch for diff\n --merge-base-branches List available merge-base branches\n\n Shows pull request status for the attached environment branch when available.\n\n bb thread log [id] Show thread event log\n --self Target current thread\n --format <format> Output format: json, minimal, verbose\n --limit <count> Limit entries\n --after-seq <seq> Paginate after sequence number\n\n bb thread output [id] Get the final output of a thread\n --self Target current thread\n\n bb thread wait <id> Wait for a thread status or event (defaults to --status idle)\n --status <status> Wait for this status\n --event <type> Wait for this event type\n --timeout <seconds> Timeout in seconds (default: 1200 / 20 min)\n --poll-interval <ms> Polling interval in milliseconds\n\nOpening threads and files in the app:\n\n bb thread open <path> Open a file in the current BB thread panel\n bb thread open <thread-id> [path] Open a thread, optionally with a panel file\n --line <number> Line number to focus\n --split <placement> right, down, left, top, or replace\n bb thread pane <action> [thread-id] Maximize, restore, or toggle an open thread pane\n\n Inside a BB thread, BB_THREAD_ID selects the current thread automatically and\n the thread ID argument is omitted for file-only opens. Pass an explicit thread\n ID with --split to open another thread. Outside a BB thread, pass the thread ID\n as the first argument. A thread already open in a pane is focused instead of\n duplicated. Edge placement creates panes through the eighth pane; at eight\n panes, it replaces the focused pane.\n Pane actions broadcast to connected BB app windows and affect the matching\n already-open pane without changing its split tree.\n Paths can be thread-relative workspace paths, or absolute paths inside the\n target thread workspace. Absolute paths under BB_THREAD_STORAGE open as\n thread-storage files for the current thread. Use this for Markdown or HTML\n artifacts you create for the user so they open in the BB IDE.\n\nMessaging:\n\n bb thread tell <id> <message> Send a follow-up message\n --mode <mode> Message mode: steer (default), queue, or auto\n --model <model> Model override for this turn\n --reasoning-level <level> Reasoning level override\n --file <path> Host-readable absolute or uploaded file path\n --image <path> Host-readable absolute or uploaded image path\n\n Tell steers by default, delivering the message immediately into the active\n turn. Use --mode queue for non-urgent follow-ups that can wait until the agent\n is free.\n\n bb thread stop [id] Stop an active or provisioning thread\n bb thread cancel-plan [id] Exit the provider's active Plan mode\n bb thread clear-goal [id] Clear the provider's active Goal\n --self Target current thread\n\nOwnership:\n\n bb thread update [id] Update thread metadata\n --self Target current thread\n --title <title> Set title\n --parent-thread <id> Assign to a parent thread\n --clear-parent-thread Remove parent assignment\n --section <id> Move into a section\n --clear-section Remove section assignment\n --visibility <visibility> Set visible or hidden\n\n bb thread read [id] Mark read\n bb thread unread [id] Mark unread\n bb thread reorder-pinned <id> [--after <id>] [--before <id>]\n\nQueued messages:\n\n bb thread queue list <thread-id>\n bb thread queue create <thread-id> <message>\n bb thread queue update <thread-id> <message-id> <message> [--file <path>] [--image <path>]\n bb thread queue send <thread-id> <message-id> [--mode auto|steer]\n bb thread queue reorder <thread-id> <message-id> [--after <id>] [--before <id>]\n bb thread queue group <thread-id> <boundary-id> --prefix <comma-separated-ids>\n bb thread queue delete <thread-id> <message-id>\n\nPersisted panel tabs:\n\n bb thread tabs show <thread-id>\n bb thread tabs set <thread-id> --expected-revision <n> --tabs-json '<json>'\n\nLifecycle:\n\n bb thread archive [id] Archive a thread (and children/hidden forks)\n --self Archive current thread\n\n bb thread unarchive [id] Unarchive a thread\n --self Unarchive current thread\n\n bb thread delete <id> Delete permanently\n --yes Skip confirmation\n\nRead-only commands require a thread ID or --self where supported.\nMutating thread lifecycle and messaging commands require an explicit ID or --self.", + "body": "Thread commands\n\nEvery command supports --json for machine-readable output.\n\nSpawning:\n\n bb thread spawn --project <id> --prompt \"...\" [options]\n\n --prompt <prompt> Initial prompt (required)\n --title <title> Thread title\n --project <id> Project (required)\n --parent-thread <id> Parent thread\n --parent-self Parent to the current thread (BB_THREAD_ID)\n --provider <id> Provider override\n --model <model> Model override\n --reasoning-level <level> Reasoning level: low, medium, high, xhigh, max (provider-dependent)\n --environment <id-or-path> Attach to an existing environment (ID or workspace path)\n --new-environment <kind> Create a new environment (worktree)\n --base-branch <branch> Base branch for a new managed worktree\n --machine <id-or-name> Run on a machine (--host is an alias)\n --service-tier <tier> Service tier: fast, default\n --permission-mode <mode> Permission mode: accept-edits, auto, or full\n --section <id> Create the thread in a section\n --visibility <visibility> visible or hidden; a child inherits its parent by default\n --file <path> Host-readable absolute or uploaded file path\n --image <path> Host-readable absolute or uploaded image path\n --origin-kind <kind> Create a fork thread\n --source-thread <id> Source thread for a fork\n --source-seq-end <seq> Last included source event sequence\n\n Execution defaults resolve from explicit flags, live parent execution, and\n remembered project defaults. With no remembered model, bb uses the explicitly\n requested provider or Codex and resolves its provider-reported default model\n on the target machine. The product reasoning and permission defaults are\n medium and auto.\n accept-edits uses workspace sandboxing with user-reviewed escalation. auto uses\n the same workspace sandbox with provider-native automatic review. full is the\n explicit sandbox and approval bypass. Plan mode is separate from permissions.\n When spawning a subagent, pass --permission-mode full unless the user or task explicitly requests restricted access.\n Parenting is opt-in. Inside a thread, pass --parent-self to parent the new thread to the current thread.\n Hidden threads are for plugin/background workers. They remain addressable by\n ID while staying out of sidebar organization and unread/pending favicon\n attention. Thread lists exclude them unless\n --include-hidden is passed; direct-ID operations remain available.\n A new child thread inherits the visibility of its parent, so the subagents of\n a hidden thread stay hidden too. Pass --visibility to override the inherited\n value. A hidden child still reports its turns and blockers to its parent\n thread; only source-derived forks stay silent.\n A machine selector accepts an exact ID or an unambiguous name. It works with\n an unmanaged --environment path, --new-environment worktree, or the personal\n workspace. It cannot be combined with an existing environment ID because that\n environment already selects its machine. Without the flag, local/primary\n machine resolution is unchanged.\n\nForking:\n\n bb thread fork <source-thread-id> [options]\n\n --prompt <prompt> Optional first prompt; omit for an idle fork\n --source-seq-end <seq> Fork at this source event sequence (tip by default)\n --workspace <mode> isolated (default) or reuse\n --title <title> Thread title\n --permission-mode <mode> Inherit source by default; accepts accept-edits, auto, full\n --visibility <visibility> visible (default) or hidden\n --agent-context-seed <text> Persist agent-only context without a first run\n --file <path> Host-readable absolute or uploaded file path\n --image <path> Host-readable absolute or uploaded image path\n\n Forks clone the source provider session on the same machine. Isolated forks\n create a fresh managed worktree (or personal workspace for personal threads);\n reuse attaches the source environment. Omit --prompt to create an idle fork.\n\nImporting:\n\n bb thread import --project <id> --provider <acp-provider> --provider-session <external-session-id> --cwd <path> [options]\n\n --project <id> Project the imported thread belongs to (required)\n --provider <acp-provider> ACP provider that owns the session, e.g. acp-omp (required)\n --provider-session <id> External provider session ID to import (required)\n --cwd <path> Working directory the session ran in (required)\n --host <id> Host the session lives on (default: primary host)\n --title <title> Thread title\n --permission-mode <mode> Permission mode: accept-edits, auto, or full\n --visibility <visibility> visible (default) or hidden\n --json Print machine-readable JSON output\n\n Imports an existing external ACP agent session (for example an `omp acp`\n session) as a bb thread bound to the caller-supplied provider session ID.\n The agent must support ACP session/load; bb replays the session's full\n history into the thread timeline as read-only historical events (no live\n turn runs) and the thread lands idle, ready for follow-up turns. --cwd is\n required: it is your assertion of the working directory the session ran\n in (bb cannot read this back from the external session itself) and must\n match the project source path or an existing workspace already attached\n to the project — anything else is refused. A cwd the agent itself detects\n as wrong surfaces as a thread start failure. Importing a provider session\n another live thread already binds is refused.\n\nListing:\n\n bb thread list List threads\n --project <id> Filter by project\n --parent-thread <id> Filter by parent thread\n --archived Show only archived threads\n --section <id> Filter by section\n --unsectioned Show only threads outside sections\n --include-hidden Include hidden threads\n\n bb thread search <query> Search threads and messages\n bb thread history <id> List prompt history\n\nSections:\n\n bb thread section list\n bb thread section create <name>\n bb thread section rename <id> <name>\n bb thread section delete <id> [--yes]\n\nInspecting:\n\n bb thread show [id] Show thread details and pull request status\n --self Target current thread\n --work-status Include git working-tree status\n --git-diff Include git diff\n --diff-target <type> Diff scope: uncommitted, branch_committed, all, commit\n --diff-sha <sha> Commit SHA (for --diff-target commit)\n --diff-merge-base <branch> Override merge-base branch for diff\n --merge-base-branches List available merge-base branches\n\n Shows pull request status for the attached environment branch when available.\n\n bb thread log [id] Show thread event log\n --self Target current thread\n --format <format> Output format: json, minimal, verbose\n --limit <count> Limit entries\n --after-seq <seq> Paginate after sequence number\n\n bb thread output [id] Get the final output of a thread\n --self Target current thread\n\n bb thread wait <id> Wait for a thread status or event (defaults to --status idle)\n --status <status> Wait for this status\n --event <type> Wait for this event type\n --timeout <seconds> Timeout in seconds (default: 1200 / 20 min)\n --poll-interval <ms> Polling interval in milliseconds\n\nOpening threads and files in the app:\n\n bb thread open <path> Open a file in the current BB thread panel\n bb thread open <thread-id> [path] Open a thread, optionally with a panel file\n --line <number> Line number to focus\n --split <placement> right, down, left, top, or replace\n bb thread pane <action> [thread-id] Maximize, restore, or toggle an open thread pane\n\n Inside a BB thread, BB_THREAD_ID selects the current thread automatically and\n the thread ID argument is omitted for file-only opens. Pass an explicit thread\n ID with --split to open another thread. Outside a BB thread, pass the thread ID\n as the first argument. A thread already open in a pane is focused instead of\n duplicated. Edge placement creates panes through the eighth pane; at eight\n panes, it replaces the focused pane.\n Pane actions broadcast to connected BB app windows and affect the matching\n already-open pane without changing its split tree.\n Paths can be thread-relative workspace paths, or absolute paths inside the\n target thread workspace. Absolute paths under BB_THREAD_STORAGE open as\n thread-storage files for the current thread. Use this for Markdown or HTML\n artifacts you create for the user so they open in the BB IDE.\n\nMessaging:\n\n bb thread tell <id> <message> Send a follow-up message\n --mode <mode> Message mode: steer (default), queue, or auto\n --model <model> Model override for this turn\n --reasoning-level <level> Reasoning level override\n --file <path> Host-readable absolute or uploaded file path\n --image <path> Host-readable absolute or uploaded image path\n\n Tell steers by default, delivering the message immediately into the active\n turn. Use --mode queue for non-urgent follow-ups that can wait until the agent\n is free.\n\n bb thread stop [id] Stop an active or provisioning thread\n bb thread cancel-plan [id] Exit the provider's active Plan mode\n bb thread clear-goal [id] Clear the provider's active Goal\n --self Target current thread\n\nOwnership:\n\n bb thread update [id] Update thread metadata\n --self Target current thread\n --title <title> Set title\n --parent-thread <id> Assign to a parent thread\n --clear-parent-thread Remove parent assignment\n --section <id> Move into a section\n --clear-section Remove section assignment\n --visibility <visibility> Set visible or hidden\n\n bb thread read [id] Mark read\n bb thread unread [id] Mark unread\n bb thread reorder-pinned <id> [--after <id>] [--before <id>]\n\nQueued messages:\n\n bb thread queue list <thread-id>\n bb thread queue create <thread-id> <message>\n bb thread queue update <thread-id> <message-id> <message> [--file <path>] [--image <path>]\n bb thread queue send <thread-id> <message-id> [--mode auto|steer]\n bb thread queue reorder <thread-id> <message-id> [--after <id>] [--before <id>]\n bb thread queue group <thread-id> <boundary-id> --prefix <comma-separated-ids>\n bb thread queue delete <thread-id> <message-id>\n\nPersisted panel tabs:\n\n bb thread tabs show <thread-id>\n bb thread tabs set <thread-id> --expected-revision <n> --tabs-json '<json>'\n\nLifecycle:\n\n bb thread archive [id] Archive a thread (and children/hidden forks)\n --self Archive current thread\n\n bb thread unarchive [id] Unarchive a thread\n --self Unarchive current thread\n\n bb thread delete <id> Delete permanently\n --yes Skip confirmation\n\nRead-only commands require a thread ID or --self where supported.\nMutating thread lifecycle and messaging commands require an explicit ID or --self.", "fileName": "bb-guide-threads.md", "kind": "instruction", "title": "bb Guide — Threads", diff --git a/packages/templates/src/templates/bb-guide-threads.md b/packages/templates/src/templates/bb-guide-threads.md index 1b033cd807..d4a0920747 100644 --- a/packages/templates/src/templates/bb-guide-threads.md +++ b/packages/templates/src/templates/bb-guide-threads.md @@ -77,6 +77,32 @@ Forking: create a fresh managed worktree (or personal workspace for personal threads); reuse attaches the source environment. Omit --prompt to create an idle fork. +Importing: + + bb thread import --project <id> --provider <acp-provider> --provider-session <external-session-id> --cwd <path> [options] + + --project <id> Project the imported thread belongs to (required) + --provider <acp-provider> ACP provider that owns the session, e.g. acp-omp (required) + --provider-session <id> External provider session ID to import (required) + --cwd <path> Working directory the session ran in (required) + --host <id> Host the session lives on (default: primary host) + --title <title> Thread title + --permission-mode <mode> Permission mode: accept-edits, auto, or full + --visibility <visibility> visible (default) or hidden + --json Print machine-readable JSON output + + Imports an existing external ACP agent session (for example an `omp acp` + session) as a bb thread bound to the caller-supplied provider session ID. + The agent must support ACP session/load; bb replays the session's full + history into the thread timeline as read-only historical events (no live + turn runs) and the thread lands idle, ready for follow-up turns. --cwd is + required: it is your assertion of the working directory the session ran + in (bb cannot read this back from the external session itself) and must + match the project source path or an existing workspace already attached + to the project — anything else is refused. A cwd the agent itself detects + as wrong surfaces as a thread start failure. Importing a provider session + another live thread already binds is refused. + Listing: bb thread list List threads